diff --git a/config/gtk/gtk-3.0/settings.ini b/config/gtk/gtk-3.0/settings.ini index 70e06e9..6a03659 100644 --- a/config/gtk/gtk-3.0/settings.ini +++ b/config/gtk/gtk-3.0/settings.ini @@ -1,7 +1,7 @@ [Settings] gtk-icon-theme-name=Adwaita gtk-theme-name=Adwaita-dark -gtk-application-prefer-dark-theme=true +gtk-application-prefer-dark-theme=1 gtk-font-name=Cantarell 11 gtk-cursor-theme-name=Adwaita gtk-cursor-theme-size=0 diff --git a/config/i3/config b/config/i3/config index eaa4889..3a64123 100644 --- a/config/i3/config +++ b/config/i3/config @@ -160,7 +160,6 @@ client.unfocused #333333 #222222 #888888 #292d2e #222222 client.urgent #90CAF9 #42A5F5 #ffffff #42A5F5 #90CAF9 # Key bindings for Media control keys - bindsym XF86AudioPlay exec playerctl play-pause bindsym XF86AudioStop exec playerctl stop bindsym XF86AudioNext exec playerctl next @@ -216,4 +215,3 @@ for_window [title="^AWTTerminalFrame$"] floating enable # IntelliJ and Lant for_window [title="^Volume Control$"] floating enable # pavucontrol for_window [title="^Network Connections$"] floating enable # nm-connection-editor for_window [title="^Parse Tree Inspector$"] floating enable # ANTLR - diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 0857610..f5cb384 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -11,7 +11,8 @@ # _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- -Fonts {{{ + +# Fonts font_family MesloLGS NF bold_font auto @@ -20,13 +21,11 @@ bold_italic_font auto font_size 14.0 -}}} -Color scheme {{{ -background_opacity 0.60 +# Color scheme -}} +background_opacity 0.60 # BEGIN_KITTY_THEME # Nord diff --git a/config/polybar/config.ini b/config/polybar/config.ini index 416e5ad..4b8cd70 100644 --- a/config/polybar/config.ini +++ b/config/polybar/config.ini @@ -80,7 +80,7 @@ font-3 = "JetBrainsMono Nerd Font Mono:pixelsize=30;7" modules-left = right-l launcher left-l sep right1 i3 left1 sep modules-center = right1 title left1 -modules-right = right7 updates right6 memory right5 alsa right4 battery right3 network right2 date left2 sep right-sm sysmenu left-sm +modules-right = right7 updates right6 memory right5 pulseaudio right4 battery right3 network right2 date left2 sep right-sm sysmenu left-sm ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ diff --git a/config/polybar/modules.ini b/config/polybar/modules.ini index c3968fe..3488156 100644 --- a/config/polybar/modules.ini +++ b/config/polybar/modules.ini @@ -224,6 +224,37 @@ ramp-signal-font = 2 ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ +[module/pulseaudio] +type = internal/pulseaudio + +use-ui-max = true + +interval = 5 + +format-volume = +format-volume-background = ${color.shade4} +format-volume-padding = 1 + +format-muted = +format-muted-prefix =  +format-muted-prefix-font = 2 +format-muted-background = ${color.shade4} +format-muted-padding = 1 + +label-volume = "%percentage%% " + +label-muted = " Muted " +label-muted-foreground = ${color.foreground} + +ramp-volume-0 =  +ramp-volume-1 =  +ramp-volume-2 =  +ramp-volume-font = 2 + +click-right = "pavucontrol -t 3" + +;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ + [module/title] type = internal/xwindow diff --git a/config/scripts/backup.sh b/config/scripts/backup.sh index 0796f62..150df2e 100755 --- a/config/scripts/backup.sh +++ b/config/scripts/backup.sh @@ -1,28 +1,90 @@ -#!/bin/sh +#!/bin/bash -# This script requires a server with SSH support and passwordless login. - -# Place the server (remoteuser@remotehost), destination folder -# (/location/of/backup) and port in dest.txt. -declare -a DEST -DEST=( $(cat $HOME/.config/backup/dest.txt) ) -SERVER=${DEST[0]} -SERVER_FOLDER=${DEST[1]} -PORT=${DEST[2]:-22} +# This script requires servers with SSH support and passwordless login. +# Each line in dest.txt should contain: server destination_folder [port] +# Example: +# user@host1.com /backup/location 22 +# user@host2.com /backup/location 2222 # Inside folders.txt should be the list of folders to backup, as paths relative # to the home directory. declare -a FOLDERS FOLDERS=( $(cat $HOME/.config/backup/folders.txt) ) -if ! $(ssh -i ~/.ssh/id_ed25519_2 -p $PORT $SERVER 'exit' 2> /dev/null); then - exit 1; +# Read all server configurations +declare -a SERVERS +while IFS= read -r line; do + [[ -z "$line" || "$line" =~ ^[[:space:]]*# ]] && continue + SERVERS+=("$line") +done < "$HOME/.config/backup/dest.txt" + +if [ ${#SERVERS[@]} -eq 0 ]; then + echo 'Error: No servers configured in dest.txt' + exit 1 fi +backup_to_server() { + local server_line="$1" + read -r server folder port <<< "$server_line" + port=${port:-22} + + # Check if server is reachable + if ! ssh -i ~/.ssh/id_ed25519_2 -p "$port" "$server" 'exit' 2> /dev/null; then + echo "Server $server is unreachable" + return 1 + fi + + echo "Backing up to $server..." + for folder_path in "${FOLDERS[@]}"; do + rsync -a --delete --quiet -e "ssh -i ~/.ssh/id_ed25519_2 -p $port" "$HOME/$folder_path" "$server:$folder" || return 1 + done + + echo "Backup to $server completed successfully" + return 0 +} + notify-send "Backup started!" -i $HOME/.config/icons/backup.png -for folder in "${FOLDERS[@]}"; do - rsync -a --delete --quiet -e "ssh -i ~/.ssh/id_ed25519_2 -p $PORT" "$HOME/$folder" "$SERVER:$SERVER_FOLDER" +# Track PIDs and results +declare -A pids +declare -a results_files +successful=0 + +# Start backup jobs in parallel +for server_config in "${SERVERS[@]}"; do + result_file=$(mktemp) + results_files+=("$result_file") + + ( + if backup_to_server "$server_config"; then + echo "success" > "$result_file" + else + echo "failure" > "$result_file" + fi + ) & + + pids["$!"]="$result_file" +done + +# Wait for all background jobs +for pid in "${!pids[@]}"; do + wait "$pid" done -notify-send "Backup finished!" -i $HOME/.config/icons/backup.png +# Check results +for result_file in "${results_files[@]}"; do + if [ -f "$result_file" ]; then + result=$(cat "$result_file") + [ "$result" == "success" ] && ((successful++)) + rm -f "$result_file" + fi +done + +# Check if at least one server was successful +if [ $successful -eq 0 ]; then + notify-send "Backup failed!" "All servers are unreachable" -i $HOME/.config/icons/backup.png -u critical + echo 'Error: All servers are unreachable' + exit 1 +fi + +notify-send "Backup finished!" "Successfully backed up to $successful/${#SERVERS[@]} server(s)" -i $HOME/.config/icons/backup.png diff --git a/config/scripts/rbackup.sh b/config/scripts/rbackup.sh index d90b964..7b19f2b 100755 --- a/config/scripts/rbackup.sh +++ b/config/scripts/rbackup.sh @@ -1,28 +1,65 @@ -#!/bin/sh +#!/bin/bash -# This script requires a server with SSH support and passwordless login. - -# Place the server (remoteuser@remotehost), destination folder -# (/location/of/backup) and port in dest.txt. -declare -a DEST -DEST=( $(cat $HOME/.config/backup/dest.txt) ) -SERVER=${DEST[0]} -SERVER_FOLDER=${DEST[1]} -PORT=${DEST[2]:-22} +# This script requires servers with SSH support and passwordless login. +# Each line in dest.txt should contain: server destination_folder [port] +# Example: +# user@host1.com /backup/location 22 +# user@host2.com /backup/location 2222 # Inside folders.txt should be the list of folders to backup, as paths relative # to the home directory. declare -a FOLDERS FOLDERS=( $(cat $HOME/.config/backup/folders.txt) ) -if ! $(ssh -i ~/.ssh/id_ed25519_2 -p $PORT $SERVER 'exit' 2> /dev/null); then - exit 1; +# Read all server configurations +declare -a SERVERS +while IFS= read -r line; do + [[ -z "$line" || "$line" =~ ^[[:space:]]*# ]] && continue + SERVERS+=("$line") +done < "$HOME/.config/backup/dest.txt" + +if [ ${#SERVERS[@]} -eq 0 ]; then + echo 'Error: No servers configured in dest.txt' + exit 1 fi +backup_from_server() { + local server_line="$1" + read -r server folder port <<< "$server_line" + port=${port:-22} + + # Check if server is reachable + if ! ssh -i ~/.ssh/id_ed25519_2 -p "$port" "$server" 'exit' 2> /dev/null; then + echo "Server $server is unreachable" + return 1 + fi + + echo "Backing up from $server..." + for folder_path in "${FOLDERS[@]}"; do + rsync -a --delete --quiet -e "ssh -i ~/.ssh/id_ed25519_2 -p $port" "$server:$folder/$folder_path" "$HOME/$folder_path" || return 1 + done + + echo "Backup from $server completed successfully" + return 0 +} + notify-send "Backup started!" -i $HOME/.config/icons/backup.png -for folder in "${FOLDERS[@]}"; do - rsync -a --delete --quiet -e "ssh -i ~/.ssh/id_ed25519_2 -p $PORT" "$SERVER:$SERVER_FOLDER" "$HOME/$folder" +# Try each server sequentially until one succeeds +successful=0 + +for server_config in "${SERVERS[@]}"; do + if backup_from_server "$server_config"; then + successful=1 + break + fi done -notify-send "Backup finished!" -i $HOME/.config/icons/backup.png +# Check if at least one server was successful +if [ $successful -eq 0 ]; then + notify-send "Backup failed!" "All servers are unreachable" -i $HOME/.config/icons/backup.png -u critical + echo 'Error: All servers are unreachable' + exit 1 +fi + +notify-send "Backup finished!" "Successfully backed up from server" -i $HOME/.config/icons/backup.png diff --git a/config/scripts/reset-screens.sh b/config/scripts/reset-screens.sh index 2112ea1..ab958cc 100755 --- a/config/scripts/reset-screens.sh +++ b/config/scripts/reset-screens.sh @@ -8,7 +8,7 @@ case $1 in autorandr portable-vertical ;; "") - autorandr --change + autorandr --change --skip-options crtc ;; *) autorandr $1 diff --git a/config/scripts/update-system.sh b/config/scripts/update-system.sh index 7a4d106..a683058 100755 --- a/config/scripts/update-system.sh +++ b/config/scripts/update-system.sh @@ -2,10 +2,13 @@ COMMANDS=$(cat << EOF fastfetch -yay -notify-send "System updated!" -i $HOME/.config/icons/update.png +if yay --sudoloop; then + notify-send "System updated!" -i $HOME/.config/icons/update.png +else + notify-send 'System failed to update. Please try again.' +fi read -p 'Press ENTER to continue...' EOF ) -kitty sh -c "$COMMANDS" \ No newline at end of file +kitty sh -c "$COMMANDS" diff --git a/config/scripts/updates.sh b/config/scripts/updates.sh index bf11dfd..b68b910 100755 --- a/config/scripts/updates.sh +++ b/config/scripts/updates.sh @@ -4,7 +4,7 @@ NOTIFY_ICON=/usr/share/icons/Papirus/32x32/apps/system-software-update.svg -get_total_updates() { UPDATES=$(checkupdates-with-aur 2>/dev/null | wc -l); } +get_total_updates() { UPDATES=$(aur-check-updates --repos extra --raw 2>/dev/null | wc -l); } while true; do get_total_updates diff --git a/config/zsh/.zshenv b/config/zsh/.zshenv index 7066df8..a7d6131 100644 --- a/config/zsh/.zshenv +++ b/config/zsh/.zshenv @@ -1,5 +1,6 @@ # Path variables export PATH="$HOME/.config/emacs/bin:$PATH" +export PATH="$HOME/go:$PATH" # Flutter/Android variables export PATH="$HOME/development/flutter/bin:$PATH" diff --git a/setup.sh b/setup.sh index 22e1b5f..9946a4b 100755 --- a/setup.sh +++ b/setup.sh @@ -83,7 +83,7 @@ official_packages=("base-devel" ) aur_packages=("visual-studio-code-bin" "cmatrix-git" "i3lock-color" "peaclock" - "adwaita-qt5-git" "adwaita-qt6-git" "checkupdates-with-aur") + "adwaita-qt5-git" "adwaita-qt6-git" "aur-check-updates-bin") log "Configuring pacman..." sudo_place $ROOT/config/pacman/pacman.conf /etc/pacman.conf @@ -227,6 +227,7 @@ EOF config_backups $SERVER_HOST $SERVER_PORT $SERVER_FOLDER log "Later, you can specify the folders to backup in '~/.config/backup/folders.txt'." + log "You can also specify more backup servers in '~/.config/backup/dest.txt'." log "To restore the backups, use the 'rbackup' command." wait_for_enter fi