diff --git a/etc/i3blocks.conf b/etc/i3blocks.conf index 95a6c0e..809456d 100644 --- a/etc/i3blocks.conf +++ b/etc/i3blocks.conf @@ -7,6 +7,11 @@ color=#00b894 command=echo "[$USER@$HOSTNAME ~]" interval=once +[homelab] +command=/home/agres/.config/i3/scripts/lab.sh +interval=60 +label=LAB: + [batteries_mouse] command=/home/agres/.config/i3/scripts/mouse_battery.sh interval=60 @@ -16,7 +21,7 @@ command=/home/agres/.config/i3/scripts/keyboard_battery.sh interval=60 [cpu] -command=sh -c 'usage=$(mpstat 1 1 | awk "/Average/ {print 100 - \$NF}"); temp=$(sensors | awk "/^Tctl:/ {gsub(/[+°]C/, \"\", \$2); print \$2; exit}"); temp=${temp#+}; printf "%s%% %s°C\n" "$usage" "$temp"' +command=/home/agres/.config/i3/scripts/cpu_usage.sh interval=5 label=CPU: @@ -26,7 +31,7 @@ interval=5 label=GPU: [mem] -command=free -h | awk '/^Mem/ {print $3 "/" $2}' +command=/home/agres/.config/i3/scripts/mem_usage.sh interval=10 label=MEM: diff --git a/home/.git-templates/hooks/post-checkout b/git-hooks/.git-templates/hooks/post-checkout similarity index 100% rename from home/.git-templates/hooks/post-checkout rename to git-hooks/.git-templates/hooks/post-checkout diff --git a/i3/config b/i3/config index bcbf7d2..db5f335 100644 --- a/i3/config +++ b/i3/config @@ -77,7 +77,7 @@ bindsym $mod+space focus mode_toggle set $ws1 "1:Code" set $ws2 "2:Term" set $ws3 "3" -set $ws4 "4" +set $ws4 "4:VM" set $ws5 "5:Web" set $ws6 "6:Mail" set $ws7 "7:Music" @@ -203,6 +203,9 @@ exec --no-startup-id feh --bg-scale /home/agres/.config/i3/wallpaper/wallpaper.j # Disable screen from going black after 10 mins to 3 hours exec --no-startup-id xset s 7200 7200 exec --no-startup-id xset dpms 7200 7200 7200 +# Slight Transparency +exec --no-startup-id picom + # Window overlay theme client.focused #00b894 #00675a #ffffff #00b894 #00675a diff --git a/i3/scripts/cpu_usage.sh b/i3/scripts/cpu_usage.sh new file mode 100755 index 0000000..9a740f4 --- /dev/null +++ b/i3/scripts/cpu_usage.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +usage=$(mpstat 1 1 | awk '/Average/ {print 100 - $NF}') + +temp=$(sensors | awk '/^Tctl:/ {gsub(/[+°]C/, "", $2); print $2; exit}') +temp=${temp#+} + +text="${usage}% ${temp}°C" + +echo "$text" +echo "$text" + +if [ "$(printf "%.0f" "$usage")" -ge 90 ]; then + echo "#ffcc66" +else + echo "#ffffff" +fi diff --git a/i3/scripts/gpu_usage.sh b/i3/scripts/gpu_usage.sh index 2a81f93..1acca33 100755 --- a/i3/scripts/gpu_usage.sh +++ b/i3/scripts/gpu_usage.sh @@ -5,8 +5,18 @@ if command -v rocm-smi &>/dev/null; then output=$(rocm-smi --showtemp --showuse) temp=$(echo "$output" | awk -F': ' '/Sensor edge/ {print $3; exit}') usage=$(echo "$output" | awk -F': ' '/GPU use/ {print $3; exit}') - echo "${usage}% ${temp}°C" + + echo "${usage}% ${temp}°C" + echo "${usage}% ${temp}°C" + + if [ "$usage" -ge 90 ]; then + echo "#ffcc66" + else + echo "#ffffff" + fi else echo "N/A" + echo "N/A" + echo "#ffffff" fi diff --git a/i3/scripts/keyboard_battery.sh b/i3/scripts/keyboard_battery.sh index e8f5666..1bb642e 100755 --- a/i3/scripts/keyboard_battery.sh +++ b/i3/scripts/keyboard_battery.sh @@ -4,7 +4,18 @@ KBD_PATH="/org/freedesktop/UPower/devices/keyboard_dev_D7_E8_29_FA_0F_D0" if upower -i "$KBD_PATH" 2>/dev/null | grep -q "present:.*yes"; then perc=$(upower -i "$KBD_PATH" | awk '/percentage:/ {print $2}') + echo "KBD:$perc" + echo "KBD:$perc" + + raw=${perc%\%} + + if [ "$raw" -ge 15 ]; then + echo "#ffffff" + else + echo "#ffcc66" + fi + else echo "" fi diff --git a/i3/scripts/lab.sh b/i3/scripts/lab.sh new file mode 100755 index 0000000..86fb21e --- /dev/null +++ b/i3/scripts/lab.sh @@ -0,0 +1,13 @@ +#!/bin/sh +HOST=192.168.0.200 + +if ping -c1 -W1 "$HOST" >/dev/null 2>&1; then + echo "UP" + echo "UP" + echo "#00b894" +else + echo "DOWN" + echo "DOWN" + echo "#ff0000" +fi + diff --git a/i3/scripts/mem_usage.sh b/i3/scripts/mem_usage.sh new file mode 100755 index 0000000..742dbc9 --- /dev/null +++ b/i3/scripts/mem_usage.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +used=$(free -h --si | awk '/^Mem/ {print $3}') +total=$(free -h --si | awk '/^Mem/ {print $2}') + +text="${used}/${total}" + +echo "$text" +echo "$text" + +u=$(free --si | awk '/^Mem/ {print $3}') +t=$(free --si | awk '/^Mem/ {print $2}') + +u_num=${u%[A-Za-z]*} +t_num=${t%[A-Za-z]*} + +pct=$(awk -v u="$u_num" -v t="$t_num" 'BEGIN {printf "%.0f", (u/t)*100}') + +if [ "$pct" -ge 90 ]; then + echo "#ffcc66" +else + echo "#ffffff" +fi diff --git a/i3/scripts/mouse_battery.sh b/i3/scripts/mouse_battery.sh index 6e61983..a334863 100755 --- a/i3/scripts/mouse_battery.sh +++ b/i3/scripts/mouse_battery.sh @@ -4,7 +4,17 @@ MOUSE_PATH=$(upower -e | grep -E 'hidpp_battery_[0-9]+$' | head -n 1) if [[ -n "$MOUSE_PATH" ]] && upower -i "$MOUSE_PATH" 2>/dev/null | grep -q "present:.*yes"; then perc=$(upower -i "$MOUSE_PATH" | awk '/percentage:/ {print $2}') + echo "MOUSE:$perc" + echo "MOUSE:$perc" + + raw=${perc%\%} + + if [ "$raw" -ge 15 ]; then + echo "#ffffff" + else + echo "#ffcc66" + fi else echo "" fi diff --git a/i3/wallpaper/wallpaper.jpg b/i3/wallpaper/wallpaper.jpg index e769275..f47ea02 100755 Binary files a/i3/wallpaper/wallpaper.jpg and b/i3/wallpaper/wallpaper.jpg differ diff --git a/i3/wallpaper/wallpaper_city.jpg b/i3/wallpaper/wallpaper_city.jpg new file mode 100644 index 0000000..b35039a Binary files /dev/null and b/i3/wallpaper/wallpaper_city.jpg differ diff --git a/i3/wallpaper/wallpaper_wave.jpg b/i3/wallpaper/wallpaper_wave.jpg new file mode 100644 index 0000000..e769275 Binary files /dev/null and b/i3/wallpaper/wallpaper_wave.jpg differ diff --git a/zsh/.zshrc b/zsh/.zshrc index 91dfef0..f5d6540 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -12,6 +12,9 @@ case "$HOST" in fedora-mac) source ~/.zshrc_fedora ;; esac +source /usr/share/fzf/key-bindings.zsh +source /usr/share/fzf/completion.zsh + # Preferred editor for local and remote sessions if [[ -n $SSH_CONNECTION ]]; then export EDITOR='nvim' @@ -41,8 +44,14 @@ alias airpods='echo -e "info 80:95:3A:DC:8E:41" | bluetoothctl | grep "Connected alias nano=nvim # Alias quick mount network smdb drive -alias md0='sudo mount --mkdir -t cifs //192.168.0.200/MD0 /mnt/md0 -o username=agres' +alias md0='sudo mount --mkdir -t cifs //192.168.0.200/MD0 /mnt/md0 -o username=agres,uid=$(id -u),gid=$(id -g)' # Load ssh keys in terminal alias loadssh='eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_ed25519' +# Tmux aliases +alias ta='tmux attach -t' +alias tn='tmux new -s' +alias tl='tmux ls' +alias tk='tmux kill-session -t' +