chiark / gitweb /
xbatmon-simple-tray: User settings hook
[chiark-tcl-applet.git] / xbatmon-simple-tray
index 72ed960b0b4db277231791d1c83e9e1789890d5e..1c9c8644115b99238822cf5775eef718b4135fac 100755 (executable)
@@ -14,6 +14,7 @@ set lib .
 source $lib/subproc.tcl
 source $lib/utils.tcl
 source $lib/args.tcl
+source $lib/applet.tcl
 
 proc cmdline {id orientation} {
     global argv
@@ -201,7 +202,7 @@ proc tt-info {chan} {
 #----- modes -----
 
 proc mode/normal {} {
-    uplevel #0 { source $lib/applet.tcl }
+    uplevel #0 { applet::become }
     applet::setup-subproc cmdline
     applet::setup-tooltip tt-show tt-invisible
 }
@@ -214,6 +215,7 @@ proc mode/-tooltip-string {} {
 #----- command line parsing -----
 
 set mode normal
+set usersettings $env(HOME)/.config/xbatmon-simple-tray
 
 while {[args::next_special arg]} {
     switch -exact -- $arg {
@@ -223,4 +225,8 @@ while {[args::next_special arg]} {
     }
 }
 
+if {[file exists $usersettings]} {
+    source $usersettings
+}
+
 mode/$mode