PLUGIN: wm_tweaks.py
This plugin will change the window title and icon whenever a song changes.
This commit is contained in:
parent
adc3af3779
commit
b2c5ad96cb
|
@ -0,0 +1,30 @@
|
|||
# Bryan Schumaker (10/30/2010)
|
||||
|
||||
import ocarina
|
||||
libsaria = ocarina.libsaria
|
||||
lib_find_id = libsaria.collection.lib_find_id
|
||||
lib_get_attr = libsaria.collection.lib_get_attr
|
||||
invite = libsaria.event.invite
|
||||
|
||||
def reset(*args):
|
||||
ocarina.set_window_icon("images/ocarina.png")
|
||||
ocarina.set_window_title(ocarina.__vers__)
|
||||
|
||||
def tweak_icon(file):
|
||||
if file != None:
|
||||
ocarina.set_window_icon(file)
|
||||
|
||||
def tweak_title(filepath):
|
||||
if filepath != None:
|
||||
id = lib_find_id(filepath)
|
||||
title = lib_get_attr(id, "title")
|
||||
ocarina.set_window_title(title)
|
||||
|
||||
def start():
|
||||
invite("PRELOAD", reset)
|
||||
invite("POSTLOAD", tweak_title)
|
||||
invite("POSTGETART", tweak_icon)
|
||||
|
||||
|
||||
def stop():
|
||||
pass
|
Loading…
Reference in New Issue