Skip to content

Instantly share code, notes, and snippets.

@infirit
infirit / blueman-loggin.py
Created July 1, 2015 19:18
python logging experiment
import logging
import logging.handlers
import os
color_map = {
"bold":"\033[1m%s\033[0m",
"green":"\x1b[32;01m%s\x1b[39;49;00m",
"blue":"\x1b[34;01m%s\x1b[39;49;00m",
"yellow":"\x1b[33;01m%s\x1b[39;49;00m"
}
@infirit
infirit / caja-colums.py
Created October 4, 2014 21:04
Caja colums for additinal metadate info on list-view
#!/usr/bin/python
# this script can installed to the current user account by running the following commands:
# sudo apt-get install python-caja python-mutagen GExiv2 python-kaa-metadata
# mkdir ~/.local/share/caja-python/extensions/
# cp bsc-v2.py ~/.local/share/caja-python/extensions/
# chmod a+x ~/.local/share/caja-python/extensions/bsc-v2.py
# alternatively, you can be able to place the script in:
@infirit
infirit / confirm_deny_notification.py
Last active August 29, 2015 14:07
Notify example for mate-notification-daemon
from __future__ import print_function, unicode_literals
from gi.repository import Notify, GLib, Gdk
screen = Gdk.Screen.get_default()
monitor = screen.get_monitor_geometry(0)
x_hint = GLib.Variant('i', monitor.width / 2)
y_hint = GLib.Variant('i', monitor.height / 2)
sound_hint = GLib.Variant('s', '/usr/share/sounds/freedesktop/stereo/dialog-information.oga')
from gi.repository import Gio
base_schema = 'org.mate.terminal.global'
profile_schema = 'org.mate.terminal.profile'
base_profile_path = '/org/mate/terminal/profiles/'
base_settings = Gio.Settings.new(base_schema)
default_profile = base_settings.get_string('default-profile') + '/'
default_path = base_profile_path + default_profile
@infirit
infirit / panel_dump_layout.py
Last active August 29, 2015 14:05
panel_dump_layout
from __future__ import unicode_literals, print_function, absolute_import
from gi.repository import Gio
import os.path
VALID = {'toplevel': ('expand', 'size', 'orientation'),
'launcher': ('object-type', 'launcher-location', 'locked', 'menu-path', 'position', 'toplevel-id'),
'applet': ('object-type', 'applet-iid', 'toplevel-id', 'position', 'locked'),
'menu-bar': ('object-type', 'applet-iid', 'toplevel-id', 'position', 'locked'),
'menu': ('object-type', 'toplevel-id', 'position', 'locked'),
'action': ('object-type', 'action-type', 'position', 'toplevel-id')}