diff options
| -rw-r--r-- | .config/zsh/.zshrc | 1 | ||||
| -rwxr-xr-x | .local/bin/statusbar/battery | 38 | ||||
| -rwxr-xr-x | .local/bin/statusbar/clock | 3 | ||||
| -rwxr-xr-x | .local/bin/statusbar/disk | 6 | ||||
| -rwxr-xr-x | .local/bin/statusbar/pacpackages | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/volume | 15 | ||||
| -rw-r--r-- | .profile | 6 |
7 files changed, 52 insertions, 19 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 9fa6d87..87f25b8 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -40,3 +40,4 @@ alias dotstat="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' sta alias dotdiff="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' diff" alias dotadd="/usr/bin/git --git-dir='$HOME/.dotfiles' --work-tree='$HOME' add -f" +[[ -z "$TMUX" ]] && exec tmux diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery index e125a6c..a70e49a 100755 --- a/.local/bin/statusbar/battery +++ b/.local/bin/statusbar/battery @@ -3,11 +3,39 @@ for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. capacity=$(cat "$battery"/capacity) || break - status=$(sed "s/[Dd]ischarging/đ/;s/[Nn]ot charging/đ/;s/[Cc]harging/đ/;s/[Uu]nknown/âģī¸/;s/[Ff]ull/âĄ/" "$battery"/status) + status=$(sed "s/[Dd]ischarging/discharging/;s/[Nn]ot charging/not_charging/;s/[Cc]harging/charging/;s/[Uu]nknown/unknown/;s/[Ff]ull/full/" "$battery"/status) - # If it is discharging and 25% or less, we will add a â as a warning. - [ "$capacity" -le 25 ] && [ "$status" = "đ" ] && warn="â" + if [ "$status" = "charging"]; then + if [ "$capacity" -le 20 ]; then + icon="ī
" + elif [ "$capacity" -le 40 ]; then + icon="ī" + elif [ "$capacity" -le 60 ]; then + icon="ī" + elif [ "$capacity" -le 80 ]; then + icon="ī" + elif [ "$capacity" -lt 95 ]; then + icon="ī" + elif [ "$capacity" -le 100 ]; then + icon="ī" + fi + elif [ "$status" = "discharging" ]; then + if [ "$capacity" -le 20 ]; then + icon="īē" + elif [ "$capacity" -le 40 ]; then + icon="īŧ" + elif [ "$capacity" -le 60 ]; then + icon="īž" + elif [ "$capacity" -le 80 ]; then + icon="ī" + elif [ "$capacity" -lt 95 ]; then + icon="ī" + elif [ "$capacity" -le 100 ]; then + icon="ī¸" + fi + elif [ "$status" = "full" ]; then + icon="ī¸" + fi - printf "%s%s%s%% " "$status" "$warn" "$capacity" - unset warn + printf "%s %s%% " "$icon" "$capacity" done | sed 's/ *$//' diff --git a/.local/bin/statusbar/clock b/.local/bin/statusbar/clock index 102929e..d5e3685 100755 --- a/.local/bin/statusbar/clock +++ b/.local/bin/statusbar/clock @@ -1,3 +1,4 @@ #!/bin/sh -date "+%d %b (%a) %k:%M" +d=$(date "+%d %b (%a) %k:%M") +printf "ī ${d}" diff --git a/.local/bin/statusbar/disk b/.local/bin/statusbar/disk index 67085e5..3e0f9ca 100755 --- a/.local/bin/statusbar/disk +++ b/.local/bin/statusbar/disk @@ -1,7 +1,7 @@ #!/bin/sh getDiskSpace () { - echo $(df -h | grep "$1$" | awk '{ print $4 }') + echo $(df -h | grep "$1$" | awk '{ print $3 "/" $2 }') } case $BLOCK_BUTTON in @@ -10,7 +10,7 @@ esac host=$(hostname -s) if [ "$host" = "laptop1" ]; then - echo "đŊ$(getDiskSpace "/")" + echo "ī /: $(getDiskSpace "/")" else - echo "đŊ$(getDiskSpace "/home")" + echo "ī /home: $(getDiskSpace "/home")" fi diff --git a/.local/bin/statusbar/pacpackages b/.local/bin/statusbar/pacpackages index 2fafe61..3d760e9 100755 --- a/.local/bin/statusbar/pacpackages +++ b/.local/bin/statusbar/pacpackages @@ -6,5 +6,5 @@ esac pacmancnt=$(pacman -Qu | grep -Fcv "[ignored]") aurcnt=$(yay -Qau | grep -Fcv "[ignored]") -echo "$pacmancnt/$aurcnt" | sed "s/^/đĻ/g" +echo "$pacmancnt+$aurcnt" | sed "s/^/ī /g" diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index ade5b98..ef9fe17 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -1,4 +1,4 @@ -#!/sbin/python3 +#!/usr/bin/python3 import subprocess import re import os @@ -79,14 +79,15 @@ for sink in sinks.values(): if vol is None or mute: - print("đ") + print("īĒ [ Mute ] 0%") quit(0) if vol > 70: - icon = "đ" -elif vol < 30: - icon = "đ" + icon = "īŠŊ " +elif vol > 30: + icon = "īŠŋ " else: - icon = "đ" + icon = "īŠž " -print(f"{icon}{vol}%") +v = vol // 10 +print(f"{icon}[{'*' * v}{' ' * (10 - v)}] {str(vol).rjust(3, ' ')}%") @@ -69,6 +69,8 @@ export GNUPGHOME="$XDG_DATA_HOME/gnupg" export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" # Autostarting window manager -if [ "$AUTOSTART" = "1" ] && [ -z "$DISPLAY" ] && [ ! -z "$DISPLAY_SESSION" ]; then - [ "$(tty)" = "/dev/tty1" ] && ! pidof Xorg >/dev/null 2>&1 && exec startx +if [ "$(tty)" = "/dev/tty1" ] && [ "$AUTOSTART" = "1" ] && [ -z "$DISPLAY" ] && [ ! -z "$DISPLAY_SESSION" ]; then + ! pidof Xorg >/dev/null 2>&1 && exec startx +elif [ -z "$TMUX" ]; then + exec tmux fi |