iso-profiles-settings/tromjaro/xfce/desktop-overlay/etc/skel/.local/bin/tromjaro-layout-toggle
2022-01-07 14:36:04 +01:00

36 lines
1.6 KiB
Bash
Executable File

#! /bin/bash
FILE1=/usr/lib/vala-panel/appmenu-registrar
FILE2=/usr/lib/vala-panel/appmenu-registrar.OFF
if [ -f "$FILE1" ]; then
choice=$(zenity --width=400 --height=275 --list --radiolist --title 'Tromjaro layout switcher' --text 'Select your preferred layout:' --column 'Select' --column 'Layout' FALSE 'Classic layout' TRUE 'Modern layout')
[ "$choice" = 'Classic layout' ] || exit
## Enable TROMjaro Classic
zensu mv "$FILE1" "$FILE2" || exit
killall appmenu-registrar &
xfconf-query -c xfwm4 -p /general/borderless_maximize -n -t bool -s false &
xfconf-query -c xfwm4 -p /general/button_layout -n -t string -s "|HMC" &
xfce4-panel-profiles load ~/.local/share/xfce4-panel-profiles/TROMjaroClassic.tar.bz2 &
## Reset panels and windows
xfce4-panel -r &
xfwm4 --replace &
xfce4-panel &
sleep 4 && notify-send 'TROMjaro Classic was enabled'
elif [ -f "$FILE2" ]; then
choice=$(zenity --width=400 --height=275 --list --radiolist --title 'Tromjaro layout switcher' --text 'Select your preferred layout:' --column 'Select' --column 'Layout' TRUE 'Classic layout' FALSE 'Modern layout')
[ "$choice" = 'Modern layout' ] || exit
## Enable TROMjaro Modern
zensu mv "$FILE2" "$FILE1" || exit
xfconf-query -c xfwm4 -p /general/borderless_maximize -n -t bool -s true &
xfconf-query -c xfwm4 -p /general/button_layout -n -t string -s "CMH|" &
xfce4-panel-profiles load ~/.local/share/xfce4-panel-profiles/TROMjaroModern.tar.bz2 &
## Reset panels and windows
xfce4-panel -r &
xfwm4 --replace &
xfce4-panel &
sleep 4 && notify-send 'TROMjaro Modern was enabled'
else
notify-send 'ERROR'
fi