Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # function to install packages with apt
- install_apt() {
- sudo apt update && \
- sudo apt install -y yaru-theme-gtk
- sudo apt install -y fonts-noto
- sudo apt install -y elementary-xfce-icon-theme
- sudo apt install -y xfce4-whiskermenu-plugin
- sudo apt install -y xfce4-panel-profiles
- sudo apt install -y python3-psutil
- if [ $? -ne 0 ]; then
- echo "Failed to install prerequisites with apt"
- exit 1
- fi
- }
- # function to install packages with dnf
- install_dnf() {
- sudo dnf update -y && \
- sudo dnf install -y yaru-gtk3-theme yaru-gtk2-theme elementary-xfce-icon-theme xfce4-whiskermenu-plugin
- sudo dnf install -y yaru-gtk2-theme
- sudo dnf install -y elementary-xfce-icon-theme
- sudo dnf install -y xfce4-whiskermenu-plugin
- sudo dnf install -y xfce4-panel-profiles
- sudo dnf install -y python3-psutil
- if [ $? -ne 0 ]; then
- echo "Failed to install prerequisites with dnf"
- exit 1
- fi
- }
- # detect the package manager and call the appropriate function
- if command -v apt >/dev/null 2>&1; then
- install_apt
- elif command -v dnf >/dev/null 2>&1; then
- install_dnf
- else
- echo "Neither apt nor dnf found. Cannot install prerequisites."
- exit 1
- fi
- # create a backup directory
- mkdir -p ~/.xfconf-backup
- # backup current xfconf settings for xsettings
- xfconf-query -c xsettings -p /Net/IconThemeName -v > ~/.xfconf-backup/Net_IconThemeName.bak
- xfconf-query -c xsettings -p /Net/ThemeName -v > ~/.xfconf-backup/Net_ThemeName.bak
- xfconf-query -c xsettings -p /Gtk/FontName -v > ~/.xfconf-backup/Gtk_FontName.bak
- xfconf-query -c xsettings -p /Xfce/LastCustomDPI -v > ~/.xfconf-backup/Xfce_LastCustomDPI.bak
- # backup current xfconf settings for xfwm4
- xfconf-query -c xfwm4 -p /general/theme -v > ~/.xfconf-backup/xfwm4_theme.bak
- xfconf-query -c xfwm4 -p /general/title_alignment -v > ~/.xfconf-backup/xfwm4_title_alignment.bak
- xfconf-query -c xfwm4 -p /general/title_font -v > ~/.xfconf-backup/xfwm4_title_font.bak
- # backup current xfconf settings for whiskermenu
- xfconf-query -c xfce4-panel -p /plugins/plugin-1 -v > ~/.xfconf-backup/whiskermenu.bak
- xfconf-query -c xfce4-panel -p /plugins/plugin-1/hover-switch-category -v > ~/.xfconf-backup/hover_switch_category.bak
- xfconf-query -c xfce4-panel -p /plugins/plugin-1/position-commands-alternate -v > ~/.xfconf-backup/position_commands_alternate.bak
- # applying new settings
- xfconf-query -c xsettings -p /Net/IconThemeName -s "elementary-xfce" || { echo 'Failed to set IconThemeName'; exit 1; }
- xfconf-query -c xsettings -p /Net/ThemeName -s "Yaru-blue" || { echo 'Failed to set ThemeName'; exit 1; }
- xfconf-query -c xsettings -p /Gtk/FontName -s "Noto Sans 9" || { echo 'Failed to set FontName'; exit 1; }
- xfconf-query -c xsettings -p /Xfce/LastCustomDPI -s 96 || { echo 'Failed to set LastCustomDPI'; exit 1; }
- # xfconf entries for xfwm4
- xfconf-query -c xfwm4 -p /general/theme -s "Yaru" || { echo 'Failed to set xfwm4 theme'; exit 1; }
- xfconf-query -c xfwm4 -p /general/title_alignment -s "center" || { echo 'Failed to set title_alignment'; exit 1; }
- xfconf-query -c xfwm4 -p /general/title_font -s "Noto Sans Bold 9" || { echo 'Failed to set title_font'; exit 1; }
- # xfconf entries for whiskermenu
- xfconf-query -c xfce4-panel -p /plugins/plugin-1 -s "whiskermenu" || { echo 'Failed to set whiskermenu'; exit 1; }
- xfconf-query -c xfce4-panel -p /plugins/plugin-1/hover-switch-category -s true || { echo 'Failed to set hover-switch-category'; exit 1; }
- xfconf-query -c xfce4-panel -p /plugins/plugin-1/position-commands-alternate -s true || { echo 'Failed to set position-commands-alternate'; exit 1; }
- # simple customizations for whiskermenu
- mkdir -p ~/.config/gtk-3.0
- touch ~/.config/gtk-3.0/gtk.css
- echo "#whiskermenu-window treeview {
- padding: 3px;
- }" >> ~/.config/gtk-3.0/gtk.css
- # setup panel configurations
- wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1Vnjt7ZhTRAzqOFbaVYSFz_e089ON1-Ea' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1Vnjt7ZhTRAzqOFbaVYSFz_e089ON1-Ea" -O Shine.tar.bz2 && rm -rf /tmp/cookies.txt || { echo 'Failed to fetch panel profile'; exit 1; }
- xfce4-panel-profiles save Backup || { echo 'Failed to save panel profile'; exit 1; }
- xfce4-panel-profiles load Shine.tar.bz2 || { echo 'Failed to set Shine panel profile'; exit 1; }
- # finishing touches
- rm -rf Shine.tar.bz2
- xfce4-session-logout --logout --fast
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement