Fvwm3 Tutorial

In my continuing saga of trying and using window managers (wm), I have installed Fvwm3. By way of providing a bit of background I’ll start by describing my environment:

  1. Fvwm3 is partnered on a single MX Linux 19.3 installation along side of dwm (from Suckless).
  2. Both window managers (Fvwm3 & dwm) operate from within the same user account.
  3. The two wms share about 90% of my total keyboard, desktop, and application infrastructure.
  4. My hardware platform’s description may be found at the end of this tutorial (a ways down below).

Now for the obligatory desktop screenshot:

To begin with you will need to install Fvwm3. Depending upon your Distro this will vary. In my case, I installed Fvwm3 via the TestRepos from MX Linux version 19.3 (a Debian non-systemd base). If you are an arch fan, I am pretty certain that any arch distro offers Fvwm3 from within either their repos or AUR. As for other Buster Debian distros, you most probably will need to compile your install. I don’t know of any beyond MX that provide repo access to Fvwm3.

Note: If you are installing Fvwm3 on a clean base, I recommend you start with a simple xfce installation and install Fvwm in the same user area. I know I’m not supposed to recommend that. But… I am going to recommend later that you clean off everything you don’t need from the xfce4 tools because our objective is to build a clean Fvwm3 desktop.

Remember window managers like Fvwm3 & dwm don’t do everything for you (or as much for you) as Desktop Environments. Having those niceties like a power-manager, screenshooter, etc. is helpful. Certainly you can change whatever you like over time.

Here are the major building blocks I use (you may wish to use what I do or perhaps roll your own.). Here are my heavy hitters:

  • sxhkd: I use this to share keybindings across window managers. I use it ‘mostly for application keybindings
  • .xsessionrc: This is used to autostart (load) system infrastructure functions. If you run arch you can simply rename my .xsessionrc to .xprofile and place it in your home directory.
  • .Xdefaults / .Xresources: I never can remember which is needed for which apps so I make these both the same. They will load magically when you start your system. Their real purpose, in my use, is to add pretty colors to windows and terminals.
  • yad & zenity: These are used to provide a common set of popup help functions across my sundry window managers. Most generally they provide quick access to scripts that either perform system functions or to gain access to help information. I’m old and my remembery needs help…
  • conky: This is used to provide both system information and a degree of eye-candy. Adn, I just like it.
  • rofi: I use rofi for two major functions.
    1. To run my menus that way I don’t have to have weird and different menus on each of my desktops.
    2. To obtain a list of all active workspaces and tasks as well as getting me directly to the one I want.
  • xcompmgr: I am a big fan of this old school compositor because it “just works”!
  • dunst: I use it for notifications.
  • xautolock, i3lock-fancy: As the tools used to perform screenlocking functions.
  • feh: That old time favorite to manage and regularly change my desktop wallpapers.
  • st (LukeSmithxyz’s version with mods by me): Quite simply is my favorite terminal.

Dependencies

As of this writing the core dependencies are (according to the Fvwm3 Github account):

  • libbson-dev (>= 1.16.2)
  • libevent-dev (>= 2.0)
  • libx11-dev
  • libxrandr-dev (>= 1.5)
  • libxrender-dev
  • libxt-dev

Optional dependencies are (according to the Fvwm3 Github account):

  • asciidoctor
  • libfontconfig-dev
  • libfreetype6-dev
  • libfribidi-dev
  • libncurses5-dev
  • libpng-dev
  • libreadline-dev
  • librsvg-dev
  • libsm-dev
  • libx11-dev
  • libxcursor-dev
  • libxext-dev
  • libxft-dev
  • libxi-dev
  • libxpm-dev
  • sharutils

Shared application & software infrastructure

A shared infrastructure, to me, means running many or all of the same applications and software tools across all my different desktops. In my case, I run exactly the same apps in both Fvwm3 and dwm. In the past, I have done that with all manner of window managers including bspwm, hlwm, openbox, jwm, iceWM…. I mix and match them to my heart’s content. (Yes, I’m fickle.)

Getting the base infrastructure built (installed) is not a big problem. Install what you like. I have a nice little script I run in MX (Debian), with small modifications I take this script and use it on arch based distros as well.

Here’s an example of my install script; yours may look different:

sudo apt install apt-notifier caffeine celluloid conky Conky-manager cron djview djview-plugin djview4 dunst  feh ffmpegthumbnailer ffmpegthumbs file-roller filezilla firefox gcc gdebi geany gimp git grub-customizer gucharmap i3lock-fancy keepassxc libharfbuzz-dev libreoffice libx11-dev libxft-dev libxinerama-dev luckybackup lxpolkit lxsession make moc mousepad neofetch nnn powertop python-pip python3-pip python3-venv qpdfview ranger rofi sl stacer sxhkd sxiv thefuck thermald thunar thunar-archive-plugin thunderbird timeshift tlp transmission udiskie xarchiver xautolock xcompmgr xdo xdotool xfce4-power-manager xorg yad zathura zenity zim 

Shared application keybindings

The tool I use to store and manage my common application keybindings is sxhkd. The way I remember what the keybindings are is via zenity. Here’s an image of my App Keybinding pop-up:

Here’s the sxhkd base.conf file I use to manage application keybindings. If you look closely at the code you’ll notice that there are a few other tricks and short-cuts I ‘perform’ listed within the same base.conf file.

#               
#	 		sxhkdrc ~ common functions              
#            dwm - and most other wms                   
#
#########################
# SUPER + FUNCTION KEYS #
#########################
# if you want to assign applications to specific tags or workspaces
# add a command behind the application to focus on that workspace if required
# index 0 corresponds to tag or HLWM workspace 1
# index 1 corresponds to tag or HLWM workspace 2
# example 
#  firefox & herbstclient use_index 1

# Open Terminal
super + Return
	st -g=93x31+100+300

# VirtualBox
super + v
	virtualbox & herbstclient use_index 0
	
# rofi menu   (alt+left-mouse-click)
alt + @button1
	 rofi -modi drun,window,run -show drun -show-icons -sidebar-mode -location 0  -width 360
	
# Show Keybinding Index
super + F1
	zenity --text-info --width=640 --height=640  --html --filename=/home/mark/.local/share/help-files/app-keybindings.html --ok-label="Quit"

# mount dismount (Bashmount)
super + F2 
	st -g=93x31+100+300 -e ~/.local/bin/bashmount.sh

# system maintenance links
super + F3
	~/.local/share/scripts/system-links.sh
	
# BpyTop
super + F4
	~/.local/share/scripts/bpytop.sh

# Linux Links
super + F11 
	zenity --text-info --width=640 --height=640  --html --filename=/home/mark/.local/share/help-files/linux-links.html --ok-label="Quit"

# rofi Active Tasks 
super + F12
	rofi -modi window -show window -show-icons -sidebar-mode

# pamac-manager
alt + p
	/usr/bin/pamac-manager  & herbstclient use_index 0

# gsimplecal
alt + c
	gsimplecal
	
# mousepad
super + a
	mousepad

# calibre (books)
super + c
	calibre

# Music (DeadBeef)
super + d
	deadbeef
	
# file managers
super + f
	thunar & herbstclient use_index 2

# file manager (ROOT)
super + alt + f
	mx-pkexec pcmanfm 
		
# nnn- file manager
super + n
	st -g=93x31+100+300 -e nnn
	
# ranger- file manager
super + r
	st -g=93x31+100+300 -e ranger

# geany
super + g
	geany  & herbstclient use_index 7

# eMail
super + e
	thunderbird
	
# Office
super + o
	libreOffice

# dmenu
super + p
    dmenu_run

# System Quit Options
super + q
	/home/mark/.local/share/scripts/logout.sh

# skype
super + s
	skype
	
# topgrade
super + t
	st -e /home/mark/.local/bin/topgrade/topgrade.sh
	
# web browser        
super + w
	firefox

#Lock screen
super + x
	dm-tool lock

# zim wiki
super + z
	zim & herbstclient use_index 3

# Reboot
ctrl + alt + Delete
	 reboot

X-windows and OS infrastructure

The common autostart file I use, across all my active window managers, is contained in .xsessionrc (Debian) or .xprofile when using arch. My common autostart performs ‘a lot’ of functions. It does this for every window manager I run. No redundancy, I think that’s good. Here is a copy for you to review:

#!/bin/sh
#
#Shared window manager functions & applications on Debian
#	
#####################

# set network manager
nm-applet &

# set sound functions
volumeicon &
start-pulseaudio-11 &

# power related functions
xfce4-power-manager &
thermald &
tlp start &
powertop --auto-tune &
xautolock -time 8 -locker i3lock-fancy &

# Light shift
xflux -z 80116 &
#redshift &

# xsettings
xsettingsd &
xset fp+ ~/.local/share/fonts &
xset r rate 350 60
xsetroot -cursor_name left_ptr &
udiskie &

# keyboard settings
setxkbmap -option compose:ralt &
ksuperkey -e 'Super_L=Alt_L|F1' &
ksuperkey -e 'Super_R=Alt_L|F1' &
	
# gnome settings
gnome-keyring-daemon --start --components=pkcs11 &

# Polkit (I prefer lxpolkit for lightness.)
lxpolkit &
#/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &

# shared common keybindings (applications)
sxhkd -c ~/.config/sxhkd/base.conf &

# applications
# Dunst
dunst -conf  ~/.config/dunst/dunstrc &
# Dropbox
sleep 30 && dropbox start -i &
# Google Drive
#sleep 30 && vgrive &

# touchpad toggle
touchpad-indicator &

# wallpaper changer 
~/.local/share/scripts/wallpaper.sh &
#feh --randomize --bg-fill $HOME/.wallpapers/Desert/* && sleep 5m &

# Caffeine
caffeine &
/usr/bin/caffeine-indicator &

###  Turn on Compositing...
# task performed in primary window manager start/autostart function

# MXLinux apt-notifier
apt-notifier &

Any unique autostart functions, of which there are a few, are performed per specific window manager requirements. For example dwm and Fvwm both use their own Conky (in my setup); they are started uniquely.

As I mentioned earlier, I use .Xresources and .Xdefaults for my pretty window and terminal colors. Since both files are identical I’ll provide my .Xresources file for you to review and/or use. The color palette contained within is the Nord Palette.

Xft.autohint: 1
Xft.antialias: 1
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.dpi: 96
Xft.rgba: rgb
Xft.lcdfilter: lcddefault

! Copyright (c) 2016-present Arctic Ice Studio <development@arcticicestudio.com>
! Copyright (c) 2016-present Sven Greb <code@svengreb.de>

! Project:    Nord XResources
! Version:    0.1.0
! Repository: https://github.com/arcticicestudio/nord-xresources
! License:    MIT

#define nord0 #2E3440
#define nord1 #3B4252
#define nord2 #434C5E
#define nord3 #4C566A
#define nord4 #D8DEE9
#define nord5 #E5E9F0
#define nord6 #ECEFF4
#define nord7 #8FBCBB
#define nord8 #88C0D0
#define nord9 #81A1C1
#define nord10 #5E81AC
#define nord11 #BF616A
#define nord12 #D08770
#define nord13 #EBCB8B
#define nord14 #A3BE8C
#define nord15 #B48EAD

*.foreground:   nord4
*.background:   nord0
*.cursorColor:  nord4
*fading: 35
*fadeColor: nord3
*.shading: 30
*.tintColor: nord15
*.active: nord11
*.inactive: nord14

*.color0: nord1
*.color1: nord11
*.color2: nord14
*.color3: nord13
*.color4: nord9
*.color5: nord15
*.color6: nord8
*.color7: nord5
*.color8: nord3
*.color9: nord11
*.color10: nord14
*.color11: nord13
*.color12: nord9
*.color13: nord15
*.color14: nord7
*.color15: nord6

Cleanup

Once you have things running reasonably well, I recommend you go back and tweak your installed toolset. In my case, I ‘carefully’ removed those pieces of xfce4 I no longer wanted. I kept those items I like from xfce4 such as the power manager, screenshooter, thunar, and a few others. Your situation will obviously be driven by your preferences not mine.

If you are interested in discussing this more, I recommend you check out this thread on the MX Linux Forums.

Yes, Linux is all about choice and freedom.

My Hardware Setup

In the event you wish to check out more of the hardware, software details for my environment they follow below:

System:
  Host: <filter> Kernel: 5.8.0-3-amd64 x86_64 bits: 64 compiler: N/A 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.8.0-3-amd64 
  root=UUID=<filter> ro quiet hush 
  Desktop: dwm 6.2 dm: LightDM 1.26.0 
  Distro: MX-19.3_x64 patito feo November 11  2020 
  base: Debian GNU/Linux 10 (buster) 
Machine:
  Type: Laptop System: Dell product: Latitude E5470 v: N/A serial: <filter> 
  Chassis: type: 9 serial: <filter> 
  Mobo: Dell model: N/A serial: <filter> UEFI: Dell v: 1.21.6 
  date: 10/02/2019 
Battery:
  ID-1: BAT0 charge: 39.7 Wh condition: 39.7/62.0 Wh (64%) volts: 8.3/7.6 
  model: LGC-LGC4.20 DELL HK6DV type: Li-ion serial: <filter> status: Full 
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M510 
  serial: <filter> charge: 55% (should be ignored) rechargeable: yes 
  status: Discharging 
CPU:
  Topology: Dual Core model: Intel Core i5-6300U bits: 64 type: MT MCP 
  arch: Skylake family: 6 model-id: 4E (78) stepping: 3 microcode: D6 
  L2 cache: 3072 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 19999 
  Speed: 800 MHz min/max: 400/3000 MHz Core speeds (MHz): 1: 800 2: 800 
  3: 800 4: 800 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds status: Vulnerable: No microcode 
  Type: tsx_async_abort mitigation: Clear CPU buffers; SMT vulnerable 
Graphics:
  Device-1: Intel HD Graphics 520 vendor: Dell Skylake GT2 driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:1916 
  Display: x11 server: X.Org 1.20.9 driver: modesetting unloaded: fbdev,vesa 
  compositor: xcompmgr resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa Intel HD Graphics 520 (SKL GT2) v: 4.6 Mesa 20.1.8 
  direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Dell 
  driver: snd_hda_intel v: kernel bus ID: 00:1f.3 chip ID: 8086:9d70 
  Sound Server: ALSA v: k5.8.0-3-amd64 
Network:
  Device-1: Intel Ethernet I219-LM vendor: Dell driver: e1000e v: 3.2.6-k 
  port: f040 bus ID: 00:1f.6 chip ID: 8086:156f 
  IF: eth0 state: down mac: <filter> 
  Device-2: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter 
  vendor: Dell driver: ath10k_pci v: kernel port: f040 bus ID: 01:00.0 
  chip ID: 168c:003e 
  IF: wlan0 state: up mac: <filter> 
  Device-3: Qualcomm Atheros type: USB driver: btusb bus ID: 1-8:5 
  chip ID: 0cf3:e007 
Drives:
  Local Storage: total: 1.90 TiB used: 1.08 TiB (57.0%) 
  ID-1: /dev/mmcblk0 model: SD32G size: 30.09 GiB block size: 
  physical: 512 B logical: 512 B serial: <filter> scheme: MBR 
  ID-2: /dev/sda vendor: Crucial model: CT1050MX300SSD4 size: 978.09 GiB 
  block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s 
  serial: <filter> rev: R031 scheme: GPT 
  ID-3: /dev/sdb type: USB model: Kindle Internal Storage size: 6.22 GiB 
  block size: physical: 512 B logical: 512 B serial: <filter> rev: 0401 
  ID-4: /dev/sdc type: USB vendor: Western Digital 
  model: WD My Passport 07A8 size: 931.48 GiB block size: physical: 512 B 
  logical: 512 B serial: <filter> rev: 1033 scheme: MBR 
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci 
  v: 3.0 port: f060 bus ID: 00:17.0 chip ID: 8086.282a rev: 21 
Partition:
  ID-1: / raw size: 975.81 GiB size: 959.49 GiB (98.33%) 
  used: 558.48 GiB (58.2%) fs: ext4 dev: /dev/sda2 
  ID-2: swap-1 size: 2.00 GiB used: 1024 KiB (0.0%) fs: swap 
  swappiness: 15 (default 60) cache pressure: 100 (default) dev: /dev/sda3 
Sensors:
  System Temperatures: cpu: 41.5 C mobo: N/A 
  Fan Speeds (RPM): cpu: 0 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
  1: deb http://deb.debian.org/debian/ buster-updates main contrib non-free
  Active apt repos in: /etc/apt/sources.list.d/debian.list 
  1: deb http://deb.debian.org/debian/ buster main contrib non-free
  2: deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
  1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/mx.list 
  1: deb http://mxrepo.com/mx/repo/ buster ahs
  Active apt repos in: /etc/apt/sources.list.d/skype-stable.list 
  1: deb [arch=amd64] https://repo.skype.com/deb/ stable main
  No active apt repos in: /etc/apt/sources.list.d/various.list 
Info:
  Processes: 319 Uptime: 2d 2h 13m Memory: 23.39 GiB used: 4.38 GiB (18.7%) 
  Init: SysVinit v: 2.96 runlevel: 5 default: 5 Compilers: gcc: 8.3.0 alt: 8 
  Shell: quick-system-in running in: quick-system-in inxi: 3.0.36