Skip to content

Instantly share code, notes, and snippets.

@mgutz
Last active December 11, 2021 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgutz/ff44b1972f0b6e04a88b9334bfc16a60 to your computer and use it in GitHub Desktop.
Save mgutz/ff44b1972f0b6e04a88b9334bfc16a60 to your computer and use it in GitHub Desktop.
Shell functions to set XFCE's window manager to i3 or built-in xfwm.
#!/bin/bash
#. Use i3wm
use-i3wm() {
# NOTE: specifies an i3 configuration tailored for XFCE. ie do not to run
# some daemons and bar as needed by a standalone i3 setup.
xfconf-query --channel xfce4-session \
--property /sessions/Failsafe/Client0_Command \
--type string --set i3 \
--type string --set '-c' \
--type string --set "$HOME/.config/i3/xfce-de-config" \
--force-array
# xfce4-panel checks to see if xfwm is running and is slow to start with i3.
# `--disable-wm-check` helps but the real fix is to start a GUI app when i3
# first starts. I start neofetch as a welcome screen.
xfconf-query --channel xfce4-session \
--property /sessions/Failsafe/Client2_Command \
--type string --set 'xfce4-panel' \
--type string --set '--disable-wm-check' \
--force-array
# Cannot use xfdesktop :( Nitrogen sets the wallpaper.
xfconf-query --channel xfce4-session \
--property /sessions/Failsafe/Client4_Command \
--type string --set nitrogen \
--type string --set '--restore' \
--force-array
}
#. Use/restore xfwm
use-xfwm() {
xfconf-query --channel xfce4-session \
--property /sessions/Failsafe/Client0_Command \
--type string --set xfwm4 \
--force-array
xfconf-query --channel xfce4-session \
--property /sessions/Failsafe/Client2_Command \
--type string --set 'xfce4-panel' \
--force-array
xfconf-query --channel xfce4-session \
--property /sessions/Failsafe/Client4_Command \
--type string --set xfdesktop \
--force-array
}
#. Query wm values
query-wm() {
for i in 0 2 4; do
echo ""
echo Client${i}_Command
xfconf-query --channel xfce4-session \
--property /sessions/Failsafe/Client${i}_Command \
-v
done
}
query-wm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment