From 3ba0df7b7c61bef5ffdb646ec87a62e63ab7d905 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 6 Jun 2024 00:57:18 -0400 Subject: [PATCH] update: more cleanup --- .install/cleanup.sh | 18 ------ .install/packages/general-packages.sh | 1 + .settings/browser.sh | 2 +- .settings/editor.sh | 2 +- .settings/networkmanager.sh | 1 - .settings/software.sh | 1 - hypr/conf/keybindings/default.conf | 1 - scripts/filemanager.sh | 1 - scripts/installtimeshift.sh | 42 ------------- scripts/installupdates.sh | 66 --------------------- scripts/onedrive.sh | 12 ---- scripts/snapshot.sh | 61 ------------------- waybar/modules.json | 3 +- waybar/themes/ml4w-blur-custom/modules.json | 1 - 14 files changed, 4 insertions(+), 208 deletions(-) delete mode 100755 scripts/filemanager.sh delete mode 100755 scripts/installtimeshift.sh delete mode 100755 scripts/installupdates.sh delete mode 100755 scripts/onedrive.sh delete mode 100755 scripts/snapshot.sh diff --git a/.install/cleanup.sh b/.install/cleanup.sh index ca1ddc5..d06f0f6 100644 --- a/.install/cleanup.sh +++ b/.install/cleanup.sh @@ -13,24 +13,6 @@ if [[ $(_isInstalledPacman "ttf-ms-fonts") == 0 ]]; then fi fi -# Check for running NetworkManager.service -if [[ $(systemctl list-units --all -t service --full --no-legend "NetworkManager.service" | sed 's/^\s*//g' | cut -f1 -d' ') == "NetworkManager.service" ]];then - echo ":: NetworkManager.service already running." -else - sudo systemctl enable NetworkManager.service - sudo systemctl start NetworkManager.service - echo ":: NetworkManager.service activated successfully." -fi - -# Check for running bluetooth.service -if [[ $(systemctl list-units --all -t service --full --no-legend "bluetooth.service" | sed 's/^\s*//g' | cut -f1 -d' ') == "bluetooth.service" ]];then - echo ":: bluetooth.service already running." -else - sudo systemctl enable bluetooth.service - sudo systemctl start bluetooth.service - echo ":: bluetooth.service activated successfully." -fi - if [ -d ~/dotfiles/hypr/settings/ ] ;then rm -rf ~/dotfiles/hypr/settings echo ":: ~/dotfiles/hypr/settings removed." diff --git a/.install/packages/general-packages.sh b/.install/packages/general-packages.sh index 9cae4c0..9f7d3c9 100644 --- a/.install/packages/general-packages.sh +++ b/.install/packages/general-packages.sh @@ -50,5 +50,6 @@ packagesPacman=( ); packagesYay=( + "trizen" "google-chrome" ); diff --git a/.settings/browser.sh b/.settings/browser.sh index e090179..988464c 100755 --- a/.settings/browser.sh +++ b/.settings/browser.sh @@ -1 +1 @@ -chromium +google-chrome-stable diff --git a/.settings/editor.sh b/.settings/editor.sh index 4401e48..58c11b4 100755 --- a/.settings/editor.sh +++ b/.settings/editor.sh @@ -1 +1 @@ -mousepad \ No newline at end of file +~/dotfiles/.settings/terminal.sh -e vim \ No newline at end of file diff --git a/.settings/networkmanager.sh b/.settings/networkmanager.sh index f3d8804..e69de29 100755 --- a/.settings/networkmanager.sh +++ b/.settings/networkmanager.sh @@ -1 +0,0 @@ -nm-connection-editor \ No newline at end of file diff --git a/.settings/software.sh b/.settings/software.sh index 61bd6e1..e69de29 100755 --- a/.settings/software.sh +++ b/.settings/software.sh @@ -1 +0,0 @@ -alacritty -e pacseek \ No newline at end of file diff --git a/hypr/conf/keybindings/default.conf b/hypr/conf/keybindings/default.conf index d9dc297..bc88632 100644 --- a/hypr/conf/keybindings/default.conf +++ b/hypr/conf/keybindings/default.conf @@ -40,7 +40,6 @@ bind = $mainMod CTRL, H, exec, ~/dotfiles/hypr/scripts/keybindings.sh bind = $mainMod SHIFT, B, exec, ~/dotfiles/waybar/launch.sh bind = $mainMod CTRL, B, exec, ~/dotfiles/waybar/toggle.sh bind = $mainMod SHIFT, R, exec, ~/dotfiles/hypr/scripts/loadconfig.sh -bind = $mainMod CTRL, F, exec, ~/dotfiles/scripts/filemanager.sh bind = $mainMod CTRL, C, exec, ~/dotfiles/scripts/cliphist.sh bind = $mainMod, V, exec, ~/dotfiles/scripts/cliphist.sh bind = $mainMod CTRL, T, exec, ~/dotfiles/waybar/themeswitcher.sh diff --git a/scripts/filemanager.sh b/scripts/filemanager.sh deleted file mode 100755 index af8fd0e..0000000 --- a/scripts/filemanager.sh +++ /dev/null @@ -1 +0,0 @@ -thunar \ No newline at end of file diff --git a/scripts/installtimeshift.sh b/scripts/installtimeshift.sh deleted file mode 100755 index 44c4859..0000000 --- a/scripts/installtimeshift.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# _____ _ _ _ __ _ -# |_ _(_)_ __ ___ ___ ___| |__ (_)/ _| |_ -# | | | | '_ ` _ \ / _ \/ __| '_ \| | |_| __| -# | | | | | | | | | __/\__ \ | | | | _| |_ -# |_| |_|_| |_| |_|\___||___/_| |_|_|_| \__| -# - -sleep 1 -clear -figlet "Timeshift" - -_isInstalledYay() { - package="$1"; - check="$(yay -Qs --color always "${package}" | grep "local" | grep "${package} ")"; - if [ -n "${check}" ] ; then - echo 0; #'0' means 'true' in Bash - return; #true - fi; - echo 1; #'1' means 'false' in Bash - return; #false -} - -timeshift_installed=$(_isInstalledYay "timeshift") -grubbtrfs_installed=$(_isInstalledYay "grub-btrfs") - -if [[ $timeshift_installed == "0" ]] ;then - echo ":: Timeshift is already installed" -else - if gum confirm "DO YOU WANT TO INSTALL Timeshift now?" ;then - yay -S timeshift - fi -fi -if [[ -d /boot/grub ]] && [[ $grubbtrfs_installed == "0" ]] ;then - echo ":: grub-btrfs is already installed" -else - echo ":: grub-btrfs is required to select a snapshot on grub bootloader." - if gum confirm "DO YOU WANT TO INSTALL grub-btrfs now?" ;then - yay -S grub-btrfs - fi -fi -sleep 3 diff --git a/scripts/installupdates.sh b/scripts/installupdates.sh deleted file mode 100755 index 2a2ad73..0000000 --- a/scripts/installupdates.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# ___ _ _ _ _ _ _ _ -# |_ _|_ __ ___| |_ __ _| | | | | | |_ __ __| | __ _| |_ ___ ___ -# | || '_ \/ __| __/ _` | | | | | | | '_ \ / _` |/ _` | __/ _ \/ __| -# | || | | \__ \ || (_| | | | | |_| | |_) | (_| | (_| | || __/\__ \ -# |___|_| |_|___/\__\__,_|_|_| \___/| .__/ \__,_|\__,_|\__\___||___/ -# |_| -# by Stephan Raabe (2024) -# ----------------------------------------------------- -# Required: yay trizen timeshift btrfs-grub -# ----------------------------------------------------- - -sleep 1 -clear -figlet "Updates" -echo -_isInstalledYay() { - package="$1"; - check="$(yay -Qs --color always "${package}" | grep "local" | grep "${package} ")"; - if [ -n "${check}" ] ; then - echo 0; #'0' means 'true' in Bash - return; #true - fi; - echo 1; #'1' means 'false' in Bash - return; #false -} - -# ------------------------------------------------------ -# Confirm Start -# ------------------------------------------------------ - -if gum confirm "DO YOU WANT TO START THE UPDATE NOW?" ;then - echo - echo ":: Update started." -elif [ $? -eq 130 ]; then - exit 130 -else - echo - echo ":: Update canceled." - exit; -fi - -if [[ $(_isInstalledYay "timeshift") == "0" ]] ;then - if gum confirm "DO YOU WANT TO CREATE A SNAPSHOT?" ;then - echo - c=$(gum input --placeholder "Enter a comment for the snapshot...") - sudo timeshift --create --comments "$c" - sudo timeshift --list - sudo grub-mkconfig -o /boot/grub/grub.cfg - echo ":: DONE. Snapshot $c created!" - echo - elif [ $? -eq 130 ]; then - echo ":: Snapshot canceled." - exit 130 - else - echo ":: Snapshot canceled." - fi - echo -fi - -yay - -notify-send "Update complete" -echo -echo ":: Update complete" -sleep 2 diff --git a/scripts/onedrive.sh b/scripts/onedrive.sh deleted file mode 100755 index ce2e28c..0000000 --- a/scripts/onedrive.sh +++ /dev/null @@ -1,12 +0,0 @@ -# ___ ____ _ -# / _ \ _ __ ___| _ \ _ __(_)_ _____ -# | | | | '_ \ / _ \ | | | '__| \ \ / / _ \ -# | |_| | | | | __/ |_| | | | |\ V / __/ -# \___/|_| |_|\___|____/|_| |_| \_/ \___| -# -# -# by Stephan Raabe (2023) -# ----------------------------------------------------- - -rclone --vfs-cache-mode writes mount OneDrive: ~/OneDrive & -notify-send "OneDrive connected" "Microsoft OneDrive successfully mounted." diff --git a/scripts/snapshot.sh b/scripts/snapshot.sh deleted file mode 100755 index 51c5d3e..0000000 --- a/scripts/snapshot.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# ____ _ _ -# / ___| _ __ __ _ _ __ ___| |__ ___ | |_ -# \___ \| '_ \ / _` | '_ \/ __| '_ \ / _ \| __| -# ___) | | | | (_| | |_) \__ \ | | | (_) | |_ -# |____/|_| |_|\__,_| .__/|___/_| |_|\___/ \__| -# |_| -# -# by Stephan Raabe (2024) -# ----------------------------------------------------- - -sleep 1 -clear -figlet "Snapshot" - -_isInstalledYay() { - package="$1"; - check="$(yay -Qs --color always "${package}" | grep "local" | grep "${package} ")"; - if [ -n "${check}" ] ; then - echo 0; #'0' means 'true' in Bash - return; #true - fi; - echo 1; #'1' means 'false' in Bash - return; #false -} - -timeshift_installed=$(_isInstalledYay "timeshift") -grubbtrfs_installed=$(_isInstalledYay "grub-btrfs") - -if [[ $timeshift_installed == "0" ]] ;then - c=$(gum input --placeholder "Enter a comment for the snapshot...") - sudo timeshift --create --comments "$c" - sudo timeshift --list - if [[ -d /boot/grub ]] ;then - if [[ -d /boot/grub ]] && [[ $grubbtrfs_installed == "1" ]] ;then - if gum confirm "DO YOU WANT TO INSTALL grub-btrfs now?" ;then - yay -S grub-btrfs - - else - exit - fi - fi - sudo grub-mkconfig -o /boot/grub/grub.cfg - fi - echo "DONE. Snapshot $c created!" -else - echo "ERROR: Timeshift is not installed." - if gum confirm "DO YOU WANT TO INSTALL Timeshift now?" ;then - yay -S timeshift - echo - echo ":: Timeshift has been installed. Please restart this script." - if [[ -d /boot/grub ]] && [[ $grubbtrfs_installed == "1" ]] ;then - echo ":: grub-btrfs is required to select a snapshot on grub bootloader." - if gum confirm "DO YOU WANT TO INSTALL grub-btrfs now?" ;then - yay -S grub-btrfs - else - exit - fi - fi - fi -fi \ No newline at end of file diff --git a/waybar/modules.json b/waybar/modules.json index 754ad89..64b2096 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -102,8 +102,7 @@ "return-type": "json", "exec": "~/dotfiles/scripts/updates.sh", "restart-interval": 60, - "on-click": "alacritty --class dotfiles-floating -e ~/dotfiles/scripts/installupdates.sh", - "on-click-right": "~/dotfiles/.settings/software.sh" + "on-click": "alacritty --class dotfiles-floating -e ~/dotfiles/scripts/installupdates.sh" }, // Wallpaper diff --git a/waybar/themes/ml4w-blur-custom/modules.json b/waybar/themes/ml4w-blur-custom/modules.json index 677ff08..453f2eb 100644 --- a/waybar/themes/ml4w-blur-custom/modules.json +++ b/waybar/themes/ml4w-blur-custom/modules.json @@ -100,7 +100,6 @@ "exec": "~/dotfiles/scripts/updates.sh", "restart-interval": 60, "on-click": "alacritty --class dotfiles-floating -e ~/dotfiles/scripts/installupdates.sh", - "on-click-right": "~/dotfiles/.settings/software.sh", "tooltip": false },