iso-profiles-settings/tromjaro/xfce/desktop-overlay/etc/skel/.local/bin/layout-switch
2022-01-18 22:22:03 +01:00

56 lines
3.2 KiB
Bash
Executable File

#! /bin/bash
choice=$(zenity --width=400 --height=275 --list --radiolist --title 'Layout Switch' --text 'Changing to or from any layout that has global menus, will require your admin password' --column 'Select' --column 'Layout' FALSE 'Windows-Like' FALSE 'Unity-Like with Global Menus (default)' FALSE 'Unity-Like' FALSE 'Gnome-Like' FALSE 'ChromeOS-Like')
case "$choice" in
'Windows-Like')
! pacman -Qq vala-panel-appmenu-registrar ||
zensu SKIP_AUTOSNAP= pacman -R --noconfirm vala-panel-appmenu-registrar ||
{ notify-send 'Error' 'failed removing vala-panel-appmenu-registrar !'; exit; }
pacman -Qq vala-panel-appmenu-registrar && exit
killall appmenu-registrar &
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 "|HMC" &
xfce4-panel-profiles load ~/.local/share/tromjaro-layouts/Windows-Like.tar.bz2 & ;;
'Unity-Like with Global Menus (default)')
pacman -Qq vala-panel-appmenu-registrar ||
zensu SKIP_AUTOSNAP= pacman -S --noconfirm vala-panel-appmenu-registrar ||
{ notify-send 'Error' 'failed installing vala-panel-appmenu-registrar !\Enabling the internet connection might solve the issue'; exit; }
pacman -Qq vala-panel-appmenu-registrar || 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 "|HMC" &
xfce4-panel-profiles load ~/.local/share/tromjaro-layouts/Unity-Like-Menus.tar.bz2 & ;;
'Unity-Like')
! pacman -Qq vala-panel-appmenu-registrar ||
zensu SKIP_AUTOSNAP= pacman -R --noconfirm vala-panel-appmenu-registrar ||
{ notify-send 'Error' 'failed removing vala-panel-appmenu-registrar !'; exit; }
pacman -Qq vala-panel-appmenu-registrar && exit
killall appmenu-registrar &
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 "|HMC" &
xfce4-panel-profiles load ~/.local/share/tromjaro-layouts/Unity-Like.tar.bz2 & ;;
'Gnome-Like')
! pacman -Qq vala-panel-appmenu-registrar ||
zensu SKIP_AUTOSNAP= pacman -R --noconfirm vala-panel-appmenu-registrar ||
{ notify-send 'Error' 'failed removing vala-panel-appmenu-registrar !'; exit; }
pacman -Qq vala-panel-appmenu-registrar && exit
killall appmenu-registrar &
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 "|HMC" &
xfce4-panel-profiles load ~/.local/share/tromjaro-layouts/Gnome-Like.tar.bz2 & ;;
'ChromeOS-Like')
! pacman -Qq vala-panel-appmenu-registrar ||
zensu SKIP_AUTOSNAP= pacman -R --noconfirm vala-panel-appmenu-registrar ||
{ notify-send 'Error' 'failed removing vala-panel-appmenu-registrar !'; exit; }
pacman -Qq vala-panel-appmenu-registrar && exit
killall appmenu-registrar &
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 "|HMC" &
xfce4-panel-profiles load ~/.local/share/tromjaro-layouts/ChromeOS-Like.tar.bz2 & ;;
*) exit ;;
esac
## Reset panels and windows
xfce4-panel -r >/dev/null 2>&1
xfwm4 --replace &
xfce4-panel &
sleep 5 && notify-send "$choice was enabled"