Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/gtk/gtk-3.0/settings.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions config/i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

9 changes: 4 additions & 5 deletions config/kitty/kitty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-


Fonts {{{

# Fonts

font_family MesloLGS NF
bold_font auto
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/polybar/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

Expand Down
31 changes: 31 additions & 0 deletions config/polybar/modules.ini
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,37 @@ ramp-signal-font = 2

;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

[module/pulseaudio]
type = internal/pulseaudio

use-ui-max = true

interval = 5

format-volume = <ramp-volume> <label-volume>
format-volume-background = ${color.shade4}
format-volume-padding = 1

format-muted = <label-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

Expand Down
92 changes: 77 additions & 15 deletions config/scripts/backup.sh
Original file line number Diff line number Diff line change
@@ -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
67 changes: 52 additions & 15 deletions config/scripts/rbackup.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion config/scripts/reset-screens.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ case $1 in
autorandr portable-vertical
;;
"")
autorandr --change
autorandr --change --skip-options crtc
;;
*)
autorandr $1
Expand Down
9 changes: 6 additions & 3 deletions config/scripts/update-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
kitty sh -c "$COMMANDS"
2 changes: 1 addition & 1 deletion config/scripts/updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/zsh/.zshenv
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down