summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-12-26 12:46:06 +0100
committerAnton Khirnov <anton@khirnov.net>2013-12-26 15:03:58 +0100
commit0a158488734ae043f466b64b01741d634ff883a8 (patch)
treebc4d88a7188813a4947b9723b7079ed2fa1d29cc
parent187862ed07028976c9840d2de195b609abf0d5a5 (diff)
bindings: add shortcuts for changing desktops
-rw-r--r--bindings.config13
-rw-r--r--config1
-rw-r--r--functions.config30
3 files changed, 41 insertions, 3 deletions
diff --git a/bindings.config b/bindings.config
index c25f9ae..3fce6c6 100644
--- a/bindings.config
+++ b/bindings.config
@@ -36,8 +36,6 @@ Mouse 1 1 A Menu menu_WindowOps
# Key bindings for windows
Key M A 4 FvwmWindowMaximizeNoClick
-Key H A 4 Resize w+0 w+10
-Key H A S4 Resize w+0 w-10
Key G A 4 Resize w+10 w+10
Key G A S4 Resize w-10 w-10
Key S A 4 Pick Resize warptoborder
@@ -73,6 +71,15 @@ Silent Mouse 7 T N Resize br w+10 w+10
Silent Mouse 8 W N FvwmWindowMove
Silent Mouse 9 W N FvwmWindowResize
+# move across desktops with arrows
+Key Left A 4 DeskPrev
+Key H A 4 DeskPrev
+Key Right A 4 DeskNext
+Key L A 4 DeskNext
+
+# select a desktop with win+<f*>
+Piperead 'for i in `seq 0 11`; do j=$(($i+1)); echo Key F$j A 4 GotoDesk 0 $i; done'
+
# name desktops
Key n A 4 FormDeskName
@@ -97,7 +104,7 @@ Test (x xkill) Key Escape A M Exec xkill
Key Delete A CM Restart
# Lock screen
-Key L A 4 Exec $[infostore.lock]
+Key Pause A 4 Exec $[infostore.lock]
####################
# Launching apps #
diff --git a/config b/config
index 536881e..424ddcd 100644
--- a/config
+++ b/config
@@ -44,6 +44,7 @@ AddToFunc StartFunction
+ I UnsetEnv i
+ I All (Maximized) WindowStyle !Borders, !Title, ResizeHintOverride
+ I UpdateStyles
++ I UpdateNumDesks
+ I Module FvwmCommandS
+ I Module FvwmEvent
+ I Test (Init) Exec exec $[infostore.xkb_tool]
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]