PipeRead "echo Echo Config load started at $(date)" # This makes ibus trigger appropriately without having to edit shell # environment settings with separate .rc files. SetEnv GTK_IM_MODULE ibus SetEnv XMODIFIERS @im=ibus SetEnv QT_IM_MODULE ibus # Configurable preference variables -- I set a bunch of variables at the top of # my config. These are all default values for the preference. To change these # values, I create additional configuration files under $[fvwm_preferences_dir] # where I over-ride the values set here. # # Color Preferences SetEnv FG_COLOR white SetEnv FG_COLOR_INACTIVE grey SetEnv BG_COLOR #4a516a SetEnv BG_COLOR_LIGHTER #7d849d # Icons on the desk will be this size: SetEnv ICON_SIZE 64x64 # Icons in title bars will be this size: SetEnv MINI_ICON_SIZE 24x24 # Size used in screenshot menu SetEnv SCREEN_SHOT_SCALE 256 # Size used in wallpaper menu SetEnv WALLPAPER_SCALE 512 SetEnv MENU_FONT_FAMILY "DejaVu Sans Mono" SetEnv MENU_FONT_SIZE 20 SetEnv DEFAULT_FONT_FAMILY "Droid Sans Mono" SetEnv DEFAULT_FONT_SIZE 12 # Sizes for DesktopSize SetEnv PAGES_X 1 SetEnv PAGES_Y 9 SetEnv ICONBOX_GEOMETRY $[vp.width]x$[vp.height] SetEnv ICONFILL_UD Bottom SetEnv ICONFILL_LR Left # Settings menu entry for volume control SetEnv VOLUME_APP "x-terminal-emulator -e alsamixer" Test (x pavucontrol) SetEnv VOLUME_APP pavucontrol # These are used to avoid hard-coded paths in the config file. SetEnv fvwm_wallpapers_dir $[FVWM_USERDIR]/wallpapers/ SetEnv fvwm_screenshots_dir $[FVWM_USERDIR]/screenshots/ SetEnv fvwm_icons_dir $[FVWM_USERDIR]/icons/ SetEnv fvwm_preferences_dir $[FVWM_USERDIR]/preferences/ SetEnv fvwm_color_scheme_preference $[fvwm_preferences_dir]/color_scheme SetEnv fvwm_font_preferences $[fvwm_preferences_dir]/font # These are so it's easier to change titlebar button positions SetEnv fvwm_title_button_miniicon 1 SetEnv fvwm_title_button_clip 2 SetEnv fvwm_title_button_arrow_up 4 # This puts the icons directory content (from Keyamoon's Free Pack - 450 Icons) # in the image search path. ImagePath $[fvwm_icons_dir]:+ # Use some of the hicolor icons for apps that have them but no other specificied icons Test (x .local/share/icons/hicolor/256x256) ImagePath +:.local/share/icons/hicolor/256x256 # This is where I save/load the current wallpaper (SetEnv WALLPAPER path.png) SetEnv fvwm_wallpaper_preference $[fvwm_preferences_dir]/wallpaper # This block creates the directories needed for my config to function # correctly. #Test (!x $[fvwm_wallpapers_dir]) Exec exec mkdir -p $[fvwm_wallpapers_dir] Test (!x $[fvwm_screenshots_dir]) Exec exec mkdir -p $[fvwm_screenshots_dir] Test (!x $[fvwm_preferences_dir]) Exec exec mkdir -p $[fvwm_preferences_dir] #Test (!x $[fvwm_icons_dir]) Exec exec mkdir -p $[fvwm_icons_dir] ## # Now, read all over-rides from the preferences directory # This must happen early in the config so that colorsets and other # configurations that use the variables are set early enough. Test (f $[fvwm_preferences_dir]) PipeRead 'for f in "$[fvwm_preferences_dir]"*; do \ cat $f ; \ echo Echo loaded preferences from $f ; \ done' ## # Font settings are constructed from variables stored as pieces SetEnv DEFAULT_FONT "xft:$[DEFAULT_FONT_FAMILY]:size=$[DEFAULT_FONT_SIZE]" SetEnv MENU_FONT "xft:$[MENU_FONT_FAMILY]:size=$[MENU_FONT_SIZE]" DefaultFont "$[DEFAULT_FONT]" # This next block contains page size, edge scrolling, and geometry window # settings. # ┌─────┐ # │ 0 │ I like a 1x9 vertical desktop of pages. And while I # │┄┄┄┄┄│ don't like the mouse making the page scroll when the # │ 1 │ edge of the screen is reached, I do like being able # │┄┄┄┄┄│ to drag windows across pages and have the page switch # │ 2 │ while doing so. # │┄┄┄┄┄│ # │ 3 │ I also think the Geometry Window that displays X and # │┄┄┄┄┄│ Y coordinates while dragging a window is really only # │ 4 │ useful in a handful of situations, so I hide that. # │┄┄┄┄┄│ # │ ⋮ │ I also like to see the window contents while # └─────┘ dragging a window. # DesktopSize $[PAGES_X]x$[PAGES_Y] EdgeScroll 0 0 EdgeThickness 1 HideGeometryWindow Always OpaqueMoveSize unlimited # ┌─────┬─────────────────────────────────────────────────────────┬─────┬─────┐ # │ I-1 │ Title │ I-4 │ I-2 │ # └─────┴─────────────────────────────────────────────────────────┴─────┴─────┘ # This block defines how windows and menus are decorated and colored. # # Window titles are a blueish color with white text and inactive windows have a # gray title. The blue really looks better with transparency turned on (ala # xcompmgr.) All titles have a flat look with no 3D bevels. # # Icon 1 is a mini icon for the window that pops up a dynamic options list and # Icon 2 is a paper clip icon that toggles window stickiness. Additionally, # Icon 2 is only displayed when for the currently active window. # Icon 4 is n up arrow that does a custom maximize (see CustomMax function). # Icons are only displayed for the currently active window. # # In case I should ever toggle a border back on, handles are disabled (and set # to width zero just in case). # # Menus would also be flat, but some damned thing is making them have a 3D # border, so I set that to zero to hide the ugliness. ColorSet 0 bg $[BG_COLOR], fg $[FG_COLOR_INACTIVE] ColorSet 1 Tint $[BG_COLOR] 50, bg $[BG_COLOR], fg $[FG_COLOR], fgsh black BorderStyle -- flat ButtonStyle All (Colorset 0 -- flat) AddButtonStyle $[fvwm_title_button_miniicon] Active MiniIcon (HiddenHandles NoInset Hilight3Doff -- flat) TitleStyle (Colorset 0 -- flat) Style * NoHandles, BorderWidth 0, SloppyFocus, MinOverlapPlacement, \ SnapAttraction 3 SameType Screen, Colorset 0, HilightFore white, \ HilightBack $[BG_COLOR], \ IconTitleRelief 0, IconBackgroundRelief 0, IconTitleColorset 0, \ IconBackgroundPadding 1, HilightIconTitleColorset 1 # IconBackgroundColorset 0, specify a colorset to add a background Style * IconBox $[ICONBOX_GEOMETRY], IconFill $[ICONFILL_UD] $[ICONFILL_LR] Mouse 1 $[fvwm_title_button_arrow_up] N CustomMax # # Menu formats are a little tricky to describe, but the FVWM man page does a # great job, search it for ItemFormat. # # ┌────┬──────────────────────────┐┌───┬──────────┐ # │ S │ Active Sub menu ▷ ││ s │ item │ # │ i │ Inactive sub menu ▶ ││ i │ item │ # │ d │ ⓘ item with icon ││ d │ item │ # │ e │ item without icon ││ e │ ⋮ │ # │ │ ⋮ ││ │ ⋮ │ # │ g │ ⋮ ││ g │ ⋮ │ # │ r │ ⋮ ││ r │ ⋮ │ # │ a │ ⋮ ││ ⋮ │ ⋮ │ # │ p │ ⋮ │└───┴──────────┘ # │ h │ ⋮ │ # │ i │ ⋮ │ # │ c │ ⋮ │ # └────┴──────────────────────────┘ # # MenuStyle * MenuColorset 1, BorderWidth 0, ItemFormat "%s %| %i %l %|% %> ", \ PopupOffset 0 100, Hilight3DOff, ActiveFore $[FG_COLOR], ForeGround $[FG_COLOR], \ HilightBack $[BG_COLOR_LIGHTER], Font "$[MENU_FONT]" # Set up icons for stuff... Style "Android SDK Manager" Icon download.svg:$[ICON_SIZE], MiniIcon download.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride, DecorateTransient Style "Apvlv" MiniIcon file-pdf.svg:$[MINI_ICON_SIZE] Style blobwars Icon radio-unchecked.svg:$[ICON_SIZE], MiniIcon radio-unchecked.svg:$[MINI_ICON_SIZE] Style "* - Chat" MiniIcon bubble2.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style "Chromium-browser" Icon chrome.svg:$[ICON_SIZE], MiniIcon chrome.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style "Firefox" MiniIcon firefox.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style Freeciv Icon office.svg:$[ICON_SIZE], MiniIcon office.svg:$[MINI_ICON_SIZE] Style "Friends" MiniIcon bubbles4.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style FvwmIdent Icon question.svg:$[ICON_SIZE], MiniIcon question.svg:$[MINI_ICON_SIZE] Style Gimp MiniIcon image2.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style Inkscape Icon crop.svg:$[ICON_SIZE], MiniIcon crop.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style "Layers - Brushes" MiniIcon images.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style MPlayer Icon play2.svg:$[ICON_SIZE], MiniIcon play2.svg:$[MINI_ICON_SIZE] Style "*nautilus*" MiniIcon folder.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style POWDER Icon wand.svg:$[ICON_SIZE], MiniIcon wand.svg:$[MINI_ICON_SIZE] Style "*rox*" MiniIcon folder.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style "Steam" NoIcon, Icon steam.svg:$[ICON_SIZE], MiniIcon steam.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style "Toolbox*" MiniIcon hammer.svg:$[MINI_ICON_SIZE], EWMHMiniIconOverride Style "URxvt" Icon console.svg:$[ICON_SIZE], Icon console.svg:$[ICON_SIZE], MiniIcon console.svg:$[MINI_ICON_SIZE] Style "Vim *" MiniIcon code.svg:$[MINI_ICON_SIZE] Style "Vim" Icon code.svg:$[ICON_SIZE], MiniIcon code.svg:$[MINI_ICON_SIZE] Style "xcalc" MiniIcon calculate.svg:$[MINI_ICON_SIZE] Style "XClipboard" Icon paste2.svg:$[ICON_SIZE], MiniIcon paste2.svg:$[MINI_ICON_SIZE] Style "*rxvt*" MiniIcon console.svg:$[MINI_ICON_SIZE] Style "Minetest*" NoTitle Style "FightTheDragon" NoTitle # Bind left clicking I-1 to the options menu, but double-click should close the # window. More specifically, double click will close, single clicking will # display a menu, holding the mouse down will display a menu, and moving the # mouse while clicking it will move the window. Mouse 1 $[fvwm_title_button_miniicon] N Ops-or-Close DestroyFunc Ops-or-Close AddToFunc Ops-or-Close + D Close + C Menu DynamicWindowOpsMenu + H Menu DynamicWindowOpsMenu + M Move # The root menu consists of the following: # ┌─────────────────┐ # │ Apps ▷ │ # │ Games ▷ │ # │ Console │ # │ Screenshots ▷ │ # │ Settings ▷ │ # ├─────────────────┤ # │ Reload │ # │ Lock │ # │ Exit │ # └─────────────────┘ DestroyMenu MenuFvwmRoot AddToMenu MenuFvwmRoot + "%enter.svg:$[MINI_ICON_SIZE]%Apps" Popup DynamicAppMenu + "%happy.svg:$[MINI_ICON_SIZE]%Games" Popup DynamicGameMenu + "%console.svg:$[MINI_ICON_SIZE]%Console" FvwmConsole + MissingSubmenuFunction ScreenshotBrowser + "%screen.svg:$[MINI_ICON_SIZE]%Screenshots" Popup $[fvwm_screenshots_dir] + "%settings.svg:$[MINI_ICON_SIZE]%Settings" Popup SettingsMenu + "" Nop + "%loop2.svg:$[MINI_ICON_SIZE]%Reload" Restart # Put a lock icon in the menu if xautolock is present Test (x xautolock) AddToMenu MenuFvwmRoot "%lock.svg:$[MINI_ICON_SIZE]%Lock" Exec exec xautolock -locknow # Put the exit option at the end of the menu AddToMenu MenuFvwmRoot + "%exit.svg:$[MINI_ICON_SIZE]%Exit" FvwmForm FvwmForm-QuitVerify Style FvwmForm-QuitVerify !Title # # The settings menu consists of the following: # ┌─────────────────┐ # │ Wallpaper ▷ │ # │ Colors ▷ │ # │ Fonts ▷ │ # └─────────────────┘ DestroyMenu SettingsMenu AddToMenu SettingsMenu + "FVWM Settings" Title + MissingSubmenuFunction WallpaperBrowser + "%images.svg:$[MINI_ICON_SIZE]%Wallpaper" Popup $[fvwm_wallpapers_dir] + "%paint-format.svg:$[MINI_ICON_SIZE]%Colors" Popup ColorMenu + "%font.svg:$[MINI_ICON_SIZE]%Fonts" Popup FontsMenu + "System" Title Test (x wifi.sh) AddToMenu SettingsMenu "%connection.svg:$[MINI_ICON_SIZE]%Wifi" Popup WifiMenu AddToMenu SettingsMenu "%volume-high.svg:$[MINI_ICON_SIZE]%Volume Control" Exec exec $[VOLUME_APP] DestroyMenu WifiMenu AddToMenu WifiMenu + "Connect to any" Exec exec x-terminal-emulator +sb -e wifi.sh -a + "Disconnect" Exec exec x-terminal-emulator +sb -e wifi.sh -k # # These colors are from various wallpapers, they're hideous, but they sort of # work. DestroyMenu ColorMenu AddToMenu ColorMenu + "Blue" UpdateColors 4A516A + "Cake" UpdateColors 6f4d10 + "Clouds" UpdateColors 236a64 + "Swirl" UpdateColors 232323 + "Zombies" UpdateColors 38512e # # This function calls the color_helper script with a background color and then # restarts DestroyFunc UpdateColors AddToFunc UpdateColors + I Exec exec python $[FVWM_USERDIR]/color_helper.py $0 > $[fvwm_color_scheme_preference] + I Schedule 250 Restart # Dynamic App Menu Generation # If they exist, put rxvt, xterm, rox, and nautilus in Apps menu: Test (x rxvt) AddToMenu DynamicAppMenu "%console.svg:$[MINI_ICON_SIZE]%RXvt" Exec exec rxvt Test (x xterm) AddToMenu DynamicAppMenu "%console.svg:$[MINI_ICON_SIZE]%XTerm" Exec exec xterm Test (x rox) AddToMenu DynamicAppMenu "%folder-open.svg:$[MINI_ICON_SIZE]%Rox Filer" Exec exec rox Test (x nautilus) AddToMenu DynamicAppMenu "%folder-open.svg:$[MINI_ICON_SIZE]%Nautilus" Exec exec nautilus --no-desktop # Internet-related stuff # If they exist, put firefox, chromium, and steam into the Apps menu: Test (x firefox) AddToMenu DynamicAppMenu "%firefox.svg:$[MINI_ICON_SIZE]%Firefox" Exec exec firefox Test (x chromium-browser) AddToMenu DynamicAppMenu "%chrome.svg:$[MINI_ICON_SIZE]%Chromium" Exec exec chromium-browser Test (x steam) AddToMenu DynamicAppMenu "%steam.svg:$[MINI_ICON_SIZE]%Steam" Exec exec steam Test (x steam) AddToMenu DynamicAppMenu "%bubbles4.svg:$[MINI_ICON_SIZE]%Steam Friends" Exec exec steam "steam://open/friends" Test (x steam) AddToMenu DynamicAppMenu "%steam.svg:$[MINI_ICON_SIZE]%Steam Library" Exec exec steam "steam://open/games" # Games # If they exist, put various games in the Games menu: Test (x abe) AddToMenu DynamicGameMenu "%hammer.svg:$[MINI_ICON_SIZE]%Abe's Amazing Adventure" Exec exec abe Test (x blobwars) AddToMenu DynamicGameMenu "%radio-unchecked.svg:$[MINI_ICON_SIZE]%Blobwars: Metal Blob Solid" Exec exec blobwars Test (x freeciv) AddToMenu DynamicGameMenu "%office.svg:$[MINI_ICON_SIZE]%FreeCiv" Exec exec freeciv Test (x freecol) AddToMenu DynamicGameMenu "%globe.svg:$[MINI_ICON_SIZE]%FreeCol" Exec exec freecol Test (x freedink) AddToMenu DynamicGameMenu "%lab.svg:$[MINI_ICON_SIZE]%Dink Smallwood" Exec exec freedink Test (x freedroidRPG) AddToMenu DynamicGameMenu "%question.svg:$[MINI_ICON_SIZE]%FreeDroid RPG" Exec exec freedroidRPG Test (x nethack,x x-terminal-emulator) AddToMenu DynamicGameMenu "%at.svg:$[MINI_ICON_SIZE]%Nethack (console)" Exec exec x-terminal-emulator +sb -e nethack Test (x nexuiz) AddToMenu DynamicGameMenu "nexuiz" Exec exec nexuiz Test (x powder) AddToMenu DynamicGameMenu "%wand.svg:$[MINI_ICON_SIZE]%Powder" Exec exec powder Test (x sauerbraten) AddToMenu DynamicGameMenu "sauerbraten" Exec exec sauerbraten Test (x slashem,x x-terminal-emulator) AddToMenu DynamicGameMenu "%bug.svg:!$[MINI_ICON_SIZE]%Slashem (console)" Exec exec x-terminal-emulator +sb -e slashem Test (x tmw) AddToMenu DynamicGameMenu "%question.svg:!$[MINI_ICON_SIZE]%The Mana World" Exec exec tmw #I have some shortcuts in ~/bin ending in .exe that invoke wine, #if they exist, put these in the Games menu, too. Test (x poe.exe) AddToMenu DynamicGameMenu "%hammer.svg:$[MINI_ICON_SIZE]%Path of Exile" Exec exec poe.exe Test (x marvel.exe) AddToMenu DynamicGameMenu "Marvel heroes" Exec exec marvel.exe Test (x warframe.exe) AddToMenu DynamicGameMenu "Warframe" Exec exec warframe.exe # Editors/Utilities # If they exist, put various editors into the Apps menu: Test (x vim,x x-terminal-emulator) AddToMenu DynamicAppMenu "%code.svg:$[MINI_ICON_SIZE]%Vim" Exec exec x-terminal-emulator +sb -T Vim -e vim Test (x gvim) AddToMenu DynamicAppMenu "%code.svg:$[MINI_ICON_SIZE]%GVim" Exec exec gvim Test (x gedit) AddToMenu DynamicAppMenu "%file3.svg:$[MINI_ICON_SIZE]%GEdit" Exec exec gedit Test (x xclipboard) AddToMenu DynamicAppMenu "%paste2.svg:$[MINI_ICON_SIZE]%Clipboard" Exec exec xclipboard Test (x gimp) AddToMenu DynamicAppMenu "%image2.svg:$[MINI_ICON_SIZE]%Gimp" Exec exec gimp Test (x inkscape) AddToMenu DynamicAppMenu "%crop.svg:$[MINI_ICON_SIZE]%Inkscape" Exec exec inkscape # Settings # If it exists, put the bluetooth-wizard into the Settings menu Test (x bluetooth-wizard) AddToMenu SettingsMenu "Bluetooth Wizard" Exec exec bluetooth-wizard Test (x blueman-manager) AddToMenu SettingsMenu "Bluetooth Manager" Exec exec blueman-manager # Resize on win+r Key r A 4 Resize Direction SE # Touchpad enable/disable Test (x touchpad.sh) Key F5 A 4 Exec exec touchpad.sh # Place again on win+p Key p A 4 PlaceAgain # When Win+Right is pressed, move to the right edge of the screen Key Right A 4 AnimatedMove -0 keep Warp # When Win+Left is pressed, move to the left edge of the screen Key Left A 4 AnimatedMove 0 keep Warp # When Win+T is pressed, open a terminal Key t A 4 LaunchWarp x-terminal-emulator +sb # When Win+S is pressed, shade the window Key s A 4 WindowShade # Bind Win+Right Mouse to resize function Mouse 3 FSTW 4 Resize-or-not # Bind Win+Left Mouse to Moving, raising, and lowering actions Mouse 1 FSTW 4 Move-Raise-or-Lower # Bind Mouse 1 on Icons to DynamicWindowOpsMenu Mouse 1 I A Menu DynamicWindowOpsMenu Key M A 4 Move # Move up or down by a page when win+k or win+j are held Key k A 4 GoToPage +0p -1p Key j A 4 GoToPage +0p +1p # Move between windows on the current page with Win+h/l Key h A 4 Focus-Prev-Window Key l A 4 Focus-Next-Window # Win+Esc pop up the menu Key Escape A 4 Menu MenuFvwmRoot Key Print A A Screenshot root -screen Key F4 A A Screenshot root -screen Key Tab A 4 Menu NewAltTabMenu #Use mpc for music controls Key XF86AudioPlay A A Exec exec mpc pause Key XF86AudioNext A A Exec exec mpc next Key XF86AudioPrev A A Exec exec mpc prev # Click and release: start resizing the window on right and bottom edges, left # click to accept, right to cancel # OR # Click and drag to resize in whatever direction the mouse goes DestroyFunc Resize-or-not AddToFunc Resize-or-not + H Nop + M Resize + C Resize Direction SE # Click and release to raise, # Click and Hold to move, (or immediately move after clicking...) # Double Click to Lower DestroyFunc Move-Raise-or-Lower AddToFunc Move-Raise-or-Lower + H Move + M Move + C Raise + D Lower DestroyFunc Focus-Prev-Window AddToFunc Focus-Prev-Window + I Prev (!WindowListSkip, AcceptsFocus, !Iconic, CurrentPage) Warp-Focus DestroyFunc Focus-Next-Window AddToFunc Focus-Next-Window + I Next (!WindowListSkip, AcceptsFocus, !Iconic, CurrentPage) Warp-Focus DestroyFunc Warp-Focus AddToFunc Warp-Focus + I WarpToWindow 5p 5p # cycle through other windows of the same class # similar to gnome/osx but without displaying an icon or list of other windows # of the same class Key grave A 4 Focus-Next-Class DestroyFunc Focus-Next-Class AddToFunc Focus-Next-Class + I Next (!WindowListSkip, AcceptsFocus, CurrentPage, $[w.class]) Warp-Focus # # Provides a means of letting the user pick a new wallpaper from a folder. # # It only likes png files. # # Creates the browser for wallpaper and puts it into a menu DestroyFunc WallpaperBrowser AddToFunc WallpaperBrowser I PipeRead 'test ! -d "$0/.thumbs" && mkdir "$0/.thumbs"; \ for i in "$0/"*; do \ iname=${i##*/} ; \ test -f "$0/.thumbs/${iname}" \ -a "${i}" -ot "$0/.thumbs/${iname}" || { \ convert -quality 0 -scale $[WALLPAPER_SCALE] "${i}" "png:$0/.thumbs/${iname}" 2>/dev/null \ || continue; \ }; \ done; \ for i in "$0/.thumbs/"*; do \ test -f "$0/${i##*/}" || rm $i ; \ done' + I DestroyMenu $0 + I AddToMenu $[fvwm_wallpapers_dir] Refresh DestroyMenu $0 + I PipeRead 'for file in "$0/".thumbs/*; do \ iname=${file##*/} ; \ echo AddToMenu $0 "\*$0/.thumbs/$iname*$iname" ChangeWallpaper \"$0/$iname\" ;\ done' # Add an option to browse the wallpaper directory with Rox (if installed) + I Piperead \ 'which rox >/dev/null && echo \'AddToMenu $0 "\*folder-open.svg:$[MINI_ICON_SIZE]*Browse Directory (rox)" Exec exec rox "$0" \' || echo Nop' # Add an option to browse the wallpaper directory with Nautilus (if installed) + I Piperead \ 'which nautilus >/dev/null && echo \'AddToMenu $0 "\*folder-open.svg:$[MINI_ICON_SIZE]*Browse Directory (nautilus)" Exec exec nautilus --no-desktop "$0" \' || echo Nop' DestroyFunc ScreenshotBrowser AddToFunc ScreenshotBrowser I PipeRead 'test ! -d "$0/.thumbs" && mkdir "$0/.thumbs"; \ for i in "$0/"*; do \ test -f "$0/.thumbs/${i##*/}" \ -a "${i}" -ot "$0/.thumbs/${i##*/}" || { \ convert -quality 0 -scale $[SCREEN_SHOT_SCALE] "${i}" "png:$0/.thumbs/${i##*/}" 2>/dev/null \ || continue; \ }; \ done; \ for i in "$0/.thumbs/"*; do \ test -f "$0/${i##*/}" || rm $i ; \ done' + I DestroyMenu $0 + I AddToMenu $[fvwm_screenshots_dir] Refresh DestroyMenu $0 + I PipeRead 'for file in "$0/".thumbs/*; do \ iname=${file##*/} ; \ echo AddToMenu $0 "\*$0/.thumbs/$iname*$iname" Exec exec display \"$0/$iname\" ;\ done' # Add an option to browse the wallpaper directory with Rox (if installed) + I Piperead \ 'which rox >/dev/null && echo \'AddToMenu $0 "\*folder-open.svg:$[ICON_SIZE]*Browse Directory (rox)" Exec exec rox "$0" \' || echo Nop' # Add an option to browse the wallpaper directory with Nautilus (if installed) + I Piperead \ 'which nautilus >/dev/null && echo \'AddToMenu $0 "\*folder-open.svg:$[ICON_SIZE]*Browse Directory (nautilus)" Exec exec nautilus --no-desktop "$0" \' || echo Nop' DestroyFunc ImageBrowser AddToFunc ImageBrowser + I PipeRead 'test ! -d "$0"/.thumbs && mkdir "$0"/.thumbs; \ for i in "$0/"*; do \ test -f "$0/.thumbs/${i##*/}" \ -a "${i} -ot "$0/.thumbs/${i##*/}" || { \ convert -quality 0 -scale 128 "${i}" "png:$0/.thumbs/${i##*/}" 2>/dev/null \ || continue ; \ }; \ done' + I DestroyMenu $0 + I AddToMenu $0 "Browsing $0" Title + I PipeRead 'for file in "$0/".thumbs/*; do \ iname=${file##*/} ; \ echo AddToMenu "$0 "\*$0/.thumbs/$iname*$iname" display \"$0/$iname\" ;\ done' # Add an option to browse the wallpaper directory with Rox (if installed) + I Piperead \ 'which rox >/dev/null && echo \'AddToMenu $0 "\*folder-open.svg:$[ICON_SIZE]*Browse Directory (rox)" Exec exec rox "$0" \' || echo Nop' # Add an option to browse the wallpaper directory with Nautilus (if installed) + I Piperead \ 'which nautilus >/dev/null && echo \'AddToMenu $0 "\*folder-open.svg:$[ICON_SIZE]*Browse Directory (nautilus)" Exec exec nautilus --no-desktop "$0" \' || echo Nop' # # The user can select different images to use as the wallpaper at any time. # Such selections are saved to and loaded from the wallpaper file in the # preferences folder. # This function changes the wallpaper preference to the image file it is passed DestroyFunc ChangeWallpaper AddToFunc ChangeWallpaper + I Exec exec echo SetEnv WALLPAPER "$0" > $[fvwm_wallpaper_preference] + I SetEnv WALLPAPER "$0" + I Schedule 250 LoadWallpaper # This function loads the wallpaper from the preference file DestroyFunc LoadWallpaper AddToFunc LoadWallpaper + I Test (f $[fvwm_wallpaper_preference]) Exec exec fvwm-root -r --dither $[WALLPAPER] # Make sure wallpaper loading happens on startup: AddToFunc StartFunction + I LoadWallpaper + I Test (init) Exec exec ibus-daemon -drx + I Test (init, x xcompmgr, x transset) Exec exec xcompmgr + I Module FvwmEvent + I Test (Restart, x xcompmgr, x transset) Retransit + I Test (init, x bluetooth-applet) Exec exec bluetooth-applet + I Test (init, x blueman-applet) Exec exec blueman-applet + I Test (init, x synclient) Exec exec synclient HorizTwoFingerScroll=1 + I Test (init, x synclient) Exec exec synclient TapButton3=2 *FvwmEvent: Cmd *FvwmEvent: add_window WindowAdded *FvwmEvent: PassId DestroyFunc LaunchWarp AddToFunc LaunchWarp + I PipeRead 'if [ -z $WarpCounter ] ; then \ echo SetEnv WarpCounter 0 ; \ else \ echo SetEnv WarpCounter $((WarpCounter+1)) ; \ fi' + I Exec exec $* DestroyFunc WindowAdded AddToFunc WindowAdded + I ThisWindow ( URxvt ) MakeTrans + I ThisWindow ( xterm ) MakeTrans + I Test (EnvIsSet WarpCounter) Warp-Focus + I Test (EnvIsSet WarpCounter) PipeRead '\ if [ $WarpCounter -gt 0 ] ; then \ echo SetEnv WarpCounter $((WarpCounter-1)) ; \ else \ echo UnsetEnv WarpCounter ; \ fi' DestroyFunc MakeTrans AddToFunc MakeTrans + I Exec exec transset -i $[w.id] 0.9 # I have a ButtonBar on the right edge of the screen # ┌─────────┐ that is comprised of a pager, a system # │ 0 │ tray, and a conky network graph. # │┄┄┄┄┄┄┄┄┄│ # │ 1 │ The network graph displays something # │┄┄┄┄┄┄┄┄┄│ like this: # │ 2 │ # │┄┄┄┄┄┄┄┄┄│ eth1: up, addr 192.168.4.102 # │ 3 │ Up Down # │┄┄┄┄┄┄┄┄┄│ ┌─────────────┬─────────────┐ # │ 4 │ │ ╱╲ │ │ # │┄┄┄┄┄┄┄┄┄│ │┄┄┄╱╲╱┄┄╲┄┄┄ │┄┄┄╱╲╱╲╱╲┄┄┄ │ # │ ⋮ │ └─────────────┴─────────────┘ # ├─────────┤ # │ trayer │ # ├─────────┤ # │ conky │ # └─────────┘ # DestroyModuleConfig RightBar *RightBar: Colorset 0 *RightBar: Rows 22 *RightBar: (1x18, Swallow (UseOld, NoKill, Respawn) "FvwmPager" FvwmPager) *RightBar: (1x1, Swallow (UseOld, NoKill, Respawn) "trayer" "Exec exec trayer --widthtype request --heighttype request --align right 2>/dev/null") *RightBar: (1x3, Swallow (UseOld, NoKill, Respawn) "Conky" "Exec exec conky -o -c $[FVWM_USERDIR]/conkyconf -a top_left 2>/dev/null") *RightBar: Frame 0 Style RightBar NoTitle, WindowListSkip, NeverFocus, Sticky AddToFunc StartFunction + I FvwmButtons RightBar *RightBar: Geometry 203x813-0+0 *FvwmPager: Colorset 0 *FvwmPager: Font none *FvwmPager: SmallFont "xft:Droid Sans Mono:size=6" *FvwmPager: WindowLabelFormat "%t" *FvwmPager: Balloons *FvwmPager: BalloonFont "xft:Droid Sans Mono:size=12" *FvwmPager: MiniIcons *FvwmPager: WindowColors wheat $[BG_COLOR] white $[BG_COLOR_LIGHTER] *FvwmPager: Colorset * 1 *FvwmPager: UseSkipList #*FvwmPager: Hilight gray Test (x $[FVWM_USERDIR]/font_helper.sh) PipeRead '$[FVWM_USERDIR]/font_helper.sh' # Window options menu DestroyMenu DynamicWindowOpsMenu AddToMenu DynamicWindowOpsMenu DynamicPopupAction DynamicWindowOpsMenuFunction # This is the function for creating context-sensitive menus DestroyFunc DynamicWindowOpsMenuFunction AddToFunc DynamicWindowOpsMenuFunction + I DestroyMenu recreate DynamicWindowOpsMenu + I AddToMenu DynamicWindowOpsMenu "Window Options: $[w.name]" Title + I Test (x xcompmgr, x transset) AddToMenu DynamicWindowOpsMenu "Solidify" Exec exec transset -i $[w.id] 1.0 + I ThisWindow ("Firefox",!Iconic) AddToMenu DynamicWindowOpsMenu "New Tab" Exec exec firefox -remote "openurl(about:blank,new-tab)" + I ThisWindow ("Firefox") AddToMenu DynamicWindowOpsMenu "New Window" Exec exec firefox -remote "openurl(about:blank,new-window)" + I TestRc (Match) AddToMenu DynamicWindowOpsMenu "" Nop + I AddToMenu DynamicWindowOpsMenu "Identify" FvwmIdent + I ThisWindow (!Iconic) AddToMenu DynamicWindowOpsMenu "Get Screenshot" Screenshot $[w.id] + I ThisWindow (!Iconic) AddToMenu DynamicWindowOpsMenu "Get Screenshot (with borders)" Screenshot $[w.id] -frame + I AddToMenu DynamicWindowOpsMenu "" Nop + I ThisWindow (Iconic) AddToMenu DynamicWindowOpsMenu "Deiconify" Iconify off + I ThisWindow (!Iconic) AddToMenu DynamicWindowOpsMenu "Iconify" Iconify + I TestRc (Match) AddToMenu DynamicWindowOpsMenu "Resize" Resize + I AddToMenu DynamicWindowOpsMenu "Move" Move + I ThisWindow (Maximized) AddToMenu DynamicWindowOpsMenu "Un-Maximize" Maximize + I TestRc (NoMatch) AddToMenu DynamicWindowOpsMenu "Maximize" Maximize + I ThisWindow (Shaded) AddToMenu DynamicWindowOpsMenu "Un-Shade" WindowShade + I TestRc (NoMatch) AddToMenu DynamicWindowOpsMenu "Shade" WindowShade + I ThisWindow (Sticky) AddToMenu DynamicWindowOpsMenu "Un-Stick" WindowStyle !Sticky + I TestRc (NoMatch) AddToMenu DynamicWindowOpsMenu "Stick" WindowStyle Sticky + I AddToMenu DynamicWindowOpsMenu "" Nop + I AddToMenu DynamicWindowOpsMenu "Close" Close + I AddToMenu DynamicWindowOpsMenu "Kill" Destroy + I AddToMenu DynamicWindowOpsMenu "" Nop + I AddToMenu DynamicWindowOpsMenu "Group Actions" Popup DynamicGroupMenuThingy # Function to do screenshots DestroyFunc Screenshot AddToFunc Screenshot + I Raise + I Exec exec import -window $0 $1 $[fvwm_screenshots_dir]/`date +%Y_%b_%d_%H:%M:%S.png` + I Schedule 250 ScreenshotBrowser $[fvwm_screenshots_dir] # This is the context-sensitive group menu DestroyMenu DynamicGroupMenuThingy AddToMenu DynamicGroupMenuThingy DynamicPopupAction DynamicGroupMenuThingyFunction # This creates a context menu for windows based on group (window class) DestroyFunc DynamicGroupMenuThingyFunction AddToFunc DynamicGroupMenuThingyFunction + I DestroyMenu recreate DynamicGroupMenuThingy + I AddToMenu DynamicGroupMenuThingy "Group: $[w.class]" Title + I Current + "Close All" Current All ($[w.class]) Close + I Current + "Shade All" Current All ($[w.class], !Shaded) WindowShade True + I Current + "Un-Shade All" Current All ($[w.class], !Shaded) WindowShade False + I Current + "Iconfiy All" Current All ($[w.class], !Iconic) Iconify + I Current + "Deiconfiy All" Current All ($[w.class], Iconic) Iconify off + I Current + "List" Popup QuickWindowList #This is used to build the List option of the group context-menu DestroyMenu QuickWindowList AddToMenu QuickWindowList DynamicPopupAction DynamicQuickWindowListFunction QuickWindowList # This creates a window list similar to the NewAltTabFunction, but is used within the group context menu DestroyFunc DynamicQuickWindowListFunction AddToFunc DynamicQuickWindowListFunction + I DestroyMenu recreate QuickWindowList + I AddToMenu QuickWindowList "Desk: $[desk.n]" Title + I ThisWindow (Iconic) Current All ($[w.class], CirculateHit, Iconic, AcceptsFocus) EvalQuickWindowList QuickWindowList + I ThisWindow (!Iconic) Current All ($[w.class], CirculateHit, !Iconic, AcceptsFocus) EvalQuickWindowList QuickWindowList # This creates an alt-tab like menu, but it lists the non-iconified windows and then iconified windows - # the iconified windows have their thumbnails displayed, non-iconified display mini-icons DestroyMenu NewAltTabMenu AddToMenu NewAltTabMenu DynamicPopupAction NewAltTabFunction DestroyFunc NewAltTabFunction AddToFunc NewAltTabFunction + I DestroyMenu NewAltTabMenu + I AddToMenu NewAltTabMenu DynamicPopupAction NewAltTabFunction + I Current All ( !"Fvwm*", !Iconic, AcceptsFocus ) EvalQuickWindowList NewAltTabMenu + I Current All ( !"Fvwm*", Iconic, AcceptsFocus ) EvalQuickWindowListIcons NewAltTabMenu # Used to create a menu of non-iconified windows DestroyFunc EvalQuickWindowList AddToFunc EvalQuickWindowList + I Current AddToMenu $0 %$[w.miniiconfile]:30x30%"$[w.class]: $[w.name]" WindowId $[w.id] Warp-Focus # Used to create a menu of the iconified windows DestroyFunc EvalQuickWindowListIcons AddToFunc EvalQuickWindowListIcons + I Current AddToMenu $0 %$[w.miniiconfile]:30x30%"(i) $[w.class]: $[w.name]" WindowId $[w.id] Warp-Focus #+ I Current AddToMenu $0 %$[temp_icon_dir]/icon.tmp.$[w.id].png%"$[w.class]: $[w.name]" WindowId $[w.id] WindowListSelectFunction # Note the above function will not work because I'm not using the temp_icon_dir stuff in this config # Used to un-iconify windows in the group context menu DestroyFunc WindowListSelectFunction AddToFunc WindowListSelectFunction + I Iconify off + I Warp-Focus # CustomMax moves the window through various sizes. # # Normal HalfMax FullMax # ┌┄┄┄┄┄┄┄┄┄┐ ┌─────┐┄┄┄┐ ┌─────────┐ # ┊ ┊ │ │ ┊ │ │ # ┌─────┐ ┊ │ │ ┊ │ │ # │ │ ┊ ▶▶▶ │ │ ┊ ▶▶▶ │ │ # │ │ ┊ │ │ ┊ │ │ # └─────┘ ┊ │ │ ┊ │ │ # ┊ ┊ │ │ ┊ │ │ # └┄┄┄┄┄┄┄┄┄┘ └─────┘┄┄┄┘ └─────────┘ # Normal is the default size. # # HalfMax is vertically maximized. # # FullMax is vertically and horizontally # maximized. # CustomMax uses a horribly complex set of functions to traverse a state # machine to put the window into the various sizes. # # CustomMax and those other crazy functions use State 1 and State 2 to decide # what state to go into. # !1, !2 -> HalfMax, 1, !2 # 1, !2 -> FullMax, !1, 2 # !1, 2 -> Restore, !1, !2 # # Or, as a sort of grey code truth table: # 0 0 -> HalfMax and set (1 0) # 1 0 -> FullMax and set (0 1) # 0 1 -> Restore and set (0 0) # Key F A 4 CustomMax # Entry-point to custom maximization state machine # Transition from initial state to half max (2) # or figure out what other state it could be in via Resolve1or2 DestroyFunc CustomMax AddToFunc CustomMax + I ThisWindow (!State 1, !State 2) HalfMax + I TestRc (NoMatch) Resolve1or2 # Called when the state machine is not in the initial state # and the state can only be 1 or 2, so figure out if it's # currently state 1 and go to full max # or (if it's state 2,) restore initial state DestroyFunc Resolve1or2 AddToFunc Resolve1or2 + I ThisWindow ( State 1 ) FullMax + I TestRc (NoMatch) Restore # Called when the state machine is in state 1 transitioning to state 2 DestroyFunc FullMax AddToFunc FullMax + I State 1 off + I State 2 on + I Maximize on # Called when the state machine is going to state 1 DestroyFunc HalfMax AddToFunc HalfMax + I State 1 on + I MakePartlyFull + I WindowStyle NoTitle # Called when the state machine is going to state 2 DestroyFunc MakePartlyFull AddToFunc MakePartlyFull + I State 2 on + I ResizeMoveMaximize 1226p 100% keep 0 # Called when the state machine is going back to initial state DestroyFunc Restore AddToFunc Restore + I State 2 off + I Maximize off + I WindowStyle Title # Disable Attention Grabbers DestroyFunc UrgencyFunc Style "*" !FPGrabFocus, GrabFocusOff # Transparent Windows on Restart DestroyFunc Retransit AddToFunc Retransit + I All WindowAdded $[w.id] # Put a paperclip icon (I-2) in the upper right of the active window AddButtonStyle $[fvwm_title_button_clip] Active (Pixmap attachment.svg:14x14 -- flat) # Put an up arrow (I-4) in the upper right of the active window AddButtonStyle $[fvwm_title_button_arrow_up] Active (Pixmap arrow-up2.svg:14x14 -- flat) # Make clicking the paper clip (I-2) call the toggle sticky function Mouse 1 $[fvwm_title_button_clip] N ToggleSticky #Mouse 1 I N Iconify Off # Makes the window sticky (or removes stickyness) DestroyFunc ToggleSticky AddToFunc ToggleSticky + I ThisWindow (Sticky) WindowStyle !Sticky + I TestRc (NoMatch) WindowStyle Sticky # media keys Key XF86AudioMute A A Exec exec amixer set Master toggle #Key F6 A A Exec exec brightness.sh -d #Key F7 A A Exec exec brightness.sh -u Key F8 A A Exec exec amixer -D pulse sset Master toggle Key F9 A A Exec exec amixer -D pulse sset Master 5%- Key F10 A A Exec exec amixer -D pulse sset Master 5%+ Key XF86PowerOff A A FvwmForm FvwmForm-QuitVerify PipeRead "echo Echo Config load ended at $(date)"