This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Author: Sergiy Kolodyazhnyy | |
Date: August 2nd, 2016 | |
Written for: http://askubuntu.com/q/805515/295286 | |
Tested on Ubuntu 16.04 LTS | |
""" | |
import gi | |
gi.require_version('Gdk', '3.0') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Author: Serg Kolo | |
# Date: Oct 3rd, 2016 | |
# Description: Script for aligning the center of | |
# user's active window with the center of the monitor | |
# Tested on: Ubuntu 16.04 | |
# Written for: http://askubuntu.com/q/832720/295286 | |
from __future__ import print_function | |
import gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Author: Sergiy Kolodyazhnyy | |
Date: August 2nd, 2016 | |
Written for: http://askubuntu.com/q/806212/295286 | |
Tested on Ubuntu 16.04 LTS | |
usage: dynamic_mouse_speed.py [-h] [-q] [-p POINTER] [-s SCROLL] [-v] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gi | |
gi.require_version('Notify', '0.7') | |
from gi.repository import Notify | |
import subprocess | |
import os | |
import sys | |
def send_notif(n,title, text): | |
try: | |
if Notify.init(__file__): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run script like so: bash thirds.sh NUMBER | |
# where NUMBER is 0,1 or 2 | |
# 0 is left, 1 is center, 2 is right | |
get_screen_geometry() | |
{ | |
# determine size of the desktop | |
xwininfo -root | \ | |
awk -F ':' '/Width/{printf "%d",$2/3}/Height/{print $2}' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Author: Serg Kolo | |
# Date: Oct 3rd, 2016 | |
# Description: Script for aligning the center of | |
# user's active window with the center of the monitor | |
# Tested on: Ubuntu 16.04 | |
from __future__ import print_function | |
from gi.repository import Gdk,Gio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from gi.repository import Notify | |
import subprocess | |
from time import sleep, time | |
from sys import argv | |
import dbus | |
def send_notification(title, text): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS ring_log; | |
CREATE TABLE ring_log ( | |
timestamp INT, | |
data TEXT | |
); | |
CREATE TRIGGER remove_oldest BEFORE INSERT ON ring_log | |
WHEN ( SELECT COUNT(*)>5 FROM ring_log ) | |
BEGIN | |
DELETE FROM ring_log WHERE timestamp in ( SELECT timestamp FROM ring_log LIMIT 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
get_window_paths() | |
{ | |
qdbus org.ayatana.bamf /org/ayatana/bamf/matcher org.ayatana.bamf.matcher.WindowPaths | |
} | |
get_running_apps() | |
{ | |
qdbus org.ayatana.bamf /org/ayatana/bamf/matcher org.ayatana.bamf.matcher.RunningApplications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]){ | |
FILE *stream; | |
char *line = NULL; | |
size_t len = 0; | |
ssize_t nread; | |
NewerOlder