summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-08-13 13:05:34 +0200
committerAnton Khirnov <anton@khirnov.net>2012-08-19 08:39:04 +0200
commit09e2ffa33f135754dd110983e04eac402d01293a (patch)
treea5973ad23b29df5d2dea955126329d247e70307a
parent88fbc9b4a2b68556e3dec33afdc98edd6273cf51 (diff)
Use InfoStore instead of polluting the environment.
-rw-r--r--bindings.config10
-rw-r--r--config15
-rw-r--r--functions.config2
-rw-r--r--initvars.config70
-rw-r--r--menu.config4
-rwxr-xr-xscripts/midclick_menu.sh4
-rwxr-xr-xscripts/random_wallpaper.py10
7 files changed, 57 insertions, 58 deletions
diff --git a/bindings.config b/bindings.config
index 6bdbcdb..0cf3227 100644
--- a/bindings.config
+++ b/bindings.config
@@ -91,19 +91,19 @@ Test (x xkill) Key Escape A M Exec xkill
Key Delete A CM Restart
# Lock screen
-Test (EnvIsSet fvwm_config_lock) Key L A 4 Exec $[fvwm_config_lock]
+Key L A 4 Exec $[infostore.lock]
####################
# Launching apps #
####################
# FvwmConsole
-Key F A 4 FvwmConsole -terminal $[fvwm_config_terminal]
+Key F A 4 FvwmConsole -terminal $[infostore.terminal]
# Launch preferred applications
-Key T A 4 Exec exec $[fvwm_config_terminal]
-Key V A 4 Exec exec $[fvwm_config_terminal] -e alsamixer
-Key Escape A 4 Exec exec $[fvwm_config_terminal] -e htop
+Key T A 4 Exec exec $[infostore.terminal]
+Key V A 4 Exec exec $[infostore.terminal] -e alsamixer
+Key Escape A 4 Exec exec $[infostore.terminal] -e htop
# screenshot
Key Space A 4 Exec exec import -window root $[HOME]/screen-$(date +%Y%m%d_%H%M%S).png
diff --git a/config b/config
index af1aed0..962f59c 100644
--- a/config
+++ b/config
@@ -21,8 +21,8 @@ Read deco.config
Read menu.config
# 96 pixels per page
-PipeRead 'echo SetEnv fvwm_config_num_pages $(($[fvwm_config_pagerheight]/96))'
-DesktopSize 1x$[fvwm_config_num_pages]
+PipeRead 'echo InfoStoreAdd num_pages $(($[infostore.pagerheight]/96))'
+DesktopSize 1x$[infostore.num_pages]
EdgeThickness 0
EdgeScroll 100 100
@@ -44,12 +44,11 @@ AddToFunc StartFunction
+ I Module FvwmButtons -g 124x$[i]-0+0
+ I UnsetEnv i
+ I All (Maximized) WindowStyle !Borders, !Title, ResizeHintOverride
-+ I All (Maximized) Maximize true
+ I UpdateStyles
+ I Module FvwmCommandS
+ I Module FvwmEvent
-+ I Test (EnvIsSet fvwm_config_xkb_tool, Init) Exec exec $[fvwm_config_xkb_tool]
-+ I Test (EnvIsSet fvwm_config_clipboard_manager, Init) Exec exec $[fvwm_config_clipboard_manager]
++ I Test (Init) Exec exec $[infostore.xkb_tool]
++ I Test (Init) Exec exec $[infostore.clipboard_manager]
#########################
# Modules configuration #
@@ -89,6 +88,6 @@ DestroyModuleConfig FvwmButtons: *
*FvwmButtons: Colorset 1
*FvwmButtons: Rows $[vp.height]
*FvwmButtons: Columns 1
-*FvwmButtons: (1x$[fvwm_config_pagerheight], Swallow 'FvwmPager' 'FvwmPager')
-*FvwmButtons: (1x$[fvwm_config_trayheight], Swallow (NoClose, UseOld) stalonetray 'Exec exec stalonetray')
-*FvwmButtons: (1x$[fvwm_config_clockheight], Swallow '$[fvwm_config_clock]' 'Exec exec $[fvwm_config_clock]')
+*FvwmButtons: (1x$[infostore.pagerheight], Swallow 'FvwmPager' 'FvwmPager')
+*FvwmButtons: (1x$[infostore.trayheight], Swallow (NoClose, UseOld) stalonetray 'Exec exec stalonetray')
+*FvwmButtons: (1x$[infostore.clockheight], Swallow '$[infostore.clock]' 'Exec exec $[infostore.clock]')
diff --git a/functions.config b/functions.config
index 6cd76e4..b0c36ea 100644
--- a/functions.config
+++ b/functions.config
@@ -78,7 +78,7 @@ AddToFunc SlideshowOn
DestroyFunc RandomWall
AddToFunc RandomWall
-+ I Exec '$[FVWM_USERDIR]/scripts/random_wallpaper.py'
++ I Exec '$[FVWM_USERDIR]/scripts/random_wallpaper.py' '$[infostore.wallpaperdir]'
DestroyFunc MPDControl
AddToFunc MPDControl
diff --git a/initvars.config b/initvars.config
index 24b21e0..aaa4dd2 100644
--- a/initvars.config
+++ b/initvars.config
@@ -1,13 +1,9 @@
## Initialization of variables
-# Height and width of the viewport
-SetEnv height $[vp.height]
-SetEnv width $[vp.width]
-
# heights of panel apps
-SetEnv fvwm_config_trayheight 26
-SetEnv fvwm_config_clockheight 64
-PipeRead 'echo SetEnv fvwm_config_pagerheight $(($[vp.height] - 64 -26))'
+InfoStoreAdd trayheight 26
+InfoStoreAdd clockheight 64
+PipeRead 'echo InfoStoreAdd pagerheight $(($[vp.height] - $[infostore.trayheight] - $[infostore.clockheight]))'
##############################
## Set default applications ##
@@ -16,36 +12,36 @@ PipeRead 'echo SetEnv fvwm_config_pagerheight $(($[vp.height] - 64 -26))'
# Default terminal
DestroyFunc set_terminal
AddToFunc set_terminal
-+ I Test (EnvIsSet fvwm_config_terminal) Nop
++ I Test (EnvIsSet fvwm_config_terminal) InfoStoreAdd terminal $[fvwm_config_terminal]
+ I TestRc (Match) Break
-+ I Test (x urxvt) SetEnv fvwm_config_terminal urxvt
++ I Test (x urxvt) InfoStoreAdd terminal urxvt
+ I TestRc (Match) Break
-+ I Test (x urxvtcd) SetEnv fvwm_config_terminal urxvtcd
++ I Test (x urxvtcd) InfoStoreAdd terminal urxvtcd
+ I TestRc (Match) Break
-+ I Test (x gnome-terminal) SetEnv fvwm_config_terminal gnome-terminal
++ I Test (x gnome-terminal) InfoStoreAdd terminal gnome-terminal
+ I TestRc (Match) Break
-+ I Test (x konsole) SetEnv fvwm_config_terminal konsole
++ I Test (x konsole) InfoStoreAdd terminal konsole
+ I TestRc (Match) Break
-+ I Test (x rxvt) SetEnv fvwm_config_terminal rxvt
++ I Test (x rxvt) InfoStoreAdd terminal rxvt
+ I TestRc (Match) Break
-+ I Test (x mrxvt) SetEnv fvwm_config_terminal mrxvtv
++ I Test (x mrxvt) InfoStoreAdd terminal mrxvtv
+ I TestRc (Match) Break
-+ I Test (x eterm) SetEnv fvwm_config_terminal eterm
++ I Test (x eterm) InfoStoreAdd terminal eterm
+ I TestRc (Match) Break
-+ I Test (x aterm) SetEnv fvwm_config_terminal aterm
++ I Test (x aterm) InfoStoreAdd terminal aterm
+ I TestRc (Match) Break
-+ I Test (x xterm) SetEnv fvwm_config_terminal xterm
++ I Test (x xterm) InfoStoreAdd terminal xterm
set_terminal
DestroyFunc set_terminal
#keyboard layout tool
DestroyFunc set_xkb_tool
AddToFunc set_xkb_tool
-+ I Test (EnvIsSet fvwm_config_xkb_tool) Nop
++ I Test (EnvIsSet fvwm_config_xkb_tool) InfoStoreAdd xkb_tool $[fvwm_config_xkb_tool]
+ I TestRc (Match) Break
-+ I Test (x fbxkb) SetEnv fvwm_config_xkb_tool fbxkb
++ I Test (x fbxkb) InfoStoreAdd xkb_tool fbxkb
+ I TestRc (Match) Break
-+ I Test (x kxkb) SetEnv fvwm_config_xkb_tool kxkb
++ I Test (x kxkb) InfoStoreAdd xkb_tool kxkb
+ I TestRc (Match) Break
set_xkb_tool
DestroyFunc set_xkb_tool
@@ -53,11 +49,11 @@ DestroyFunc set_xkb_tool
#clipboard manager
DestroyFunc set_clipboard_manager
AddToFunc set_clipboard_manager
-+ I Test (EnvIsSet fvwm_config_clipboard_manager) Nop
++ I Test (EnvIsSet fvwm_config_clipboard_manager) InfoStoreAdd clipboard_manager $[fvwm_config_clipboard_manager]
+ I TestRc (Match) Break
-+ I Test (x parcellite) SetEnv fvwm_config_clipboard_manager parcellite
++ I Test (x parcellite) InfoStoreAdd clipboard_manager parcellite
+ I TestRc (Match) Break
-+ I Test (x klipper) SetEnv fvwm_config_clipboard_manager klipper
++ I Test (x klipper) InfoStoreAdd clipboard_manager klipper
+ I TestRc (Match) Break
set_clipboard_manager
DestroyFunc set_clipboard_manager
@@ -65,26 +61,28 @@ DestroyFunc set_clipboard_manager
# Wallpaper directory
DestroyFunc set_wallpaper_dir
AddToFunc set_wallpaper_dir
-+ I Test (x "$[HOME]/gallery/wallpapers") SetEnv WALLPAPERDIR "$[HOME]/gallery/wallpapers/"
++ I Test (EnvIsSet fvwm_config_wallpaperdir) InfoStoreAdd wallpaperdir $[fvwm_config_wallpaperdir]
++ I TestRC (Match) Break
++ I Test (x "$[HOME]/gallery/wallpapers") InfoStoreAdd wallpaperdir "$[HOME]/gallery/wallpapers/"
+ I TestRC (Match) Break
-+ I Test (x "$[HOME]/system/wallpapers") SetEnv WALLPAPERDIR "$[HOME]/system/wallpapers/"
++ I Test (x "$[HOME]/system/wallpapers") InfoStoreAdd wallpaperdir "$[HOME]/system/wallpapers/"
+ I TestRc (Match) Break
-+ I Test (x "$[HOME]/wallpapers") SetEnv WALLPAPERDIR "$[HOME]/wallpapers/"
++ I Test (x "$[HOME]/wallpapers") InfoStoreAdd wallpaperdir "$[HOME]/wallpapers/"
+ I TestRc (Match) Break
-+ I Test (x "$[FVWM_USERDIR]/wallpapers") SetEnv WALLPAPERDIR "$[FVWM_USERDIR]/wallpapers/"
++ I Test (x "$[FVWM_USERDIR]/wallpapers") InfoStoreAdd wallpaperdir "$[FVWM_USERDIR]/wallpapers/"
+ I TestRc (Match) Break
-+ I SetEnv WALLPAPERDIR "$[FVWM_USERDIR]"
++ I InfoStoreAdd wallpaperdir "$[FVWM_USERDIR]"
set_wallpaper_dir
DestroyFunc set_wallpaper_dir
# Clock
DestroyFunc set_clock
AddToFunc set_clock
-+ I Test (EnvIsSet fvwm_config_clock) Nop
++ I Test (EnvIsSet fvwm_config_clock) InfoStoreAdd clock $[fvwm_config_clock]
+ I TestRc (Match) Break
-+ I Test (x dclock) SetEnv fvwm_config_clock dclock
++ I Test (x dclock) InfoStoreAdd clock dclock
+ I TestRc (Match) Break
-+ I Test (x xclock) SetEnv fvwm_config_clock xclock
++ I Test (x xclock) InfoStoreAdd clock xclock
+ I TestRc (Match) Break
set_clock
DestroyFunc set_clock
@@ -92,15 +90,15 @@ DestroyFunc set_clock
# Lock screen
DestroyFunc set_lock
AddToFunc set_lock
-+ I Test (EnvIsSet fvwm_config_lock) Nop
++ I Test (EnvIsSet fvwm_config_lock) InfoStoreAdd lock $[fvwm_config_lock]
+ I TestRc (Match) Break
-+ I Test (x xlock) SetEnv fvwm_config_lock xlock
++ I Test (x xlock) InfoStoreAdd lock xlock
+ I TestRc (Match) Break
-+ I Test (x xscreensaver-command) SetEnv fvwm_config_lock "xscreensaver-command -lock"
++ I Test (x xscreensaver-command) InfoStoreAdd lock "xscreensaver-command -lock"
+ I TestRc (Match) Break
-+ I Test (x alock) SetEnv fvwm_config_lock alock
++ I Test (x alock) InfoStoreAdd lock alock
+ I TestRc (Match) Break
-+ I Test (x slock) SetEnv fvwm_config_lock slock
++ I Test (x slock) InfoStoreAdd lock slock
+ I TestRc (Match) Break
set_lock
DestroyFunc set_lock
diff --git a/menu.config b/menu.config
index da070de..b1788e4 100644
--- a/menu.config
+++ b/menu.config
@@ -24,7 +24,7 @@ AddToMenu menu_RootOps
AddToFunc RootOpsMenuFunc
+ I DestroyMenu recreate menu_RootOps
+ I AddToMenu menu_RootOps "Root menu" Title
-+ I Test (EnvIsSet fvwm_config_lock) + "%xapp_big.png%&1. Lock screen" Exec exec $[fvwm_config_lock]
++ I + "%xapp_big.png%&1. Lock screen" Exec exec $[infostore.lock]
+ I + "%xapp_big.png%&2. $[gt.Restart]" Restart
+ I + "%xapp_big.png%&3. $[gt.Close]" Popup Quit-Verify
@@ -93,4 +93,4 @@ AddToFunc DynamicPagesMenu
+ I AddToMenu menu_WindowSendToPage DynamicPopupAction DynamicPagesMenu
+ I AddToMenu menu_WindowSendToPage
+ I + "$[gt.Send to page]" Title
-+ I Piperead `$[FVWM_USERDIR]/scripts/midclick_menu.sh $[gt.Send to page]`
++ I Piperead `$[FVWM_USERDIR]/scripts/midclick_menu.sh $[infostore.num_pages] $[gt.Send to page]`
diff --git a/scripts/midclick_menu.sh b/scripts/midclick_menu.sh
index 90fa578..8af6a48 100755
--- a/scripts/midclick_menu.sh
+++ b/scripts/midclick_menu.sh
@@ -1,6 +1,8 @@
#!/bin/bash
#i=$(cat ${FVWM_USERDIR}/config-options/desktop_size)
-i=1x$[fvwm_config_num_pages]
+num_pages=$1
+shift 1
+i=1x${num_pages}
j=${i}
i=${i%x*}
diff --git a/scripts/random_wallpaper.py b/scripts/random_wallpaper.py
index fa9fd5d..aed95bd 100755
--- a/scripts/random_wallpaper.py
+++ b/scripts/random_wallpaper.py
@@ -8,11 +8,11 @@ import os.path
import sys
import random
-if not 'WALLPAPERDIR' in os.environ:
- sys.stderr.write('WALLPAPERDIR variable not set, using default value.\n')
- d = os.path.expandvars('${HOME}/${FVWM_USERDIR}/images')
-else:
- d = os.path.expandvars('${WALLPAPERDIR}')
+if len(sys.argv) < 2:
+ sys.stderr.write('Usage: %s <wallpaper_dir>\n'%(sys.argv[0]))
+ sys.exit(-1)
+
+d = os.path.expandvars(sys.argv[1])
sys.stderr.write('Trying directory %s.\n'%d)
if not os.path.isdir(d):