summaryrefslogtreecommitdiff
path: root/functions.config
diff options
context:
space:
mode:
Diffstat (limited to 'functions.config')
-rw-r--r--functions.config30
1 files changed, 30 insertions, 0 deletions
diff --git a/functions.config b/functions.config
index 304f222..eb8194b 100644
--- a/functions.config
+++ b/functions.config
@@ -84,6 +84,36 @@ DestroyFunc MPDControl
AddToFunc MPDControl
+ I Exec mpc -q $*
+# update desk_min/max for a given window
+# this needs to be in a separate function from UpdateNumDesks,
+# so that all the variables get updated on each invocation of the script
+DestroyFunc UpdateNumDesksForWindow
+AddToFunc UpdateNumDesksForWindow
++ I PipeRead '\
+ if [ $[w.desk] -lt $[infostore.desk_min] ]; then \
+ echo InfoStoreAdd desk_min $[w.desk]; \
+ fi; \
+ if [ $[w.desk] -gt $[infostore.desk_max] ]; then \
+ echo InfoStoreAdd desk_max $[w.desk]; \
+ fi \
+'
+
+DestroyFunc UpdateNumDesks
+AddToFunc UpdateNumDesks
++ I InfoStoreAdd desk_min 0
++ I InfoStoreAdd desk_max 0
++ I NoWindow All (!StickyAcrossDesks) UpdateNumDesksForWindow
+
+DestroyFunc DeskNext
+AddToFunc DeskNext
++ I UpdateNumDesks
++ I GotoDesk 1 0 $[infostore.desk_min] $[infostore.desk_max]
+
+DestroyFunc DeskPrev
+AddToFunc DeskPrev
++ I UpdateNumDesks
++ I GotoDesk -1 0 $[infostore.desk_min] $[infostore.desk_max]
+
DestroyFunc FormDeskName
AddToFunc FormDeskName
+ I Module FvwmForm FormDeskName DESK=$[desk.n]