summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2020-08-26 04:59:24 +0400
committerAndrew <saintruler@gmail.com>2020-08-26 04:59:24 +0400
commit70825f19ff5c8bd78780265ece1fc2c00a026f84 (patch)
treeca06eb21b52147f7ba6751e106c8c3648232a3c0
parent75d736925fac9ab42c6015f2930a82c2eeee3235 (diff)
Changed icons in status bar scripts and added tmux to autostart in tty/terminal
-rw-r--r--.config/zsh/.zshrc1
-rwxr-xr-x.local/bin/statusbar/battery38
-rwxr-xr-x.local/bin/statusbar/clock3
-rwxr-xr-x.local/bin/statusbar/disk6
-rwxr-xr-x.local/bin/statusbar/pacpackages2
-rwxr-xr-x.local/bin/statusbar/volume15
-rw-r--r--.profile6
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, ' ')}%")
diff --git a/.profile b/.profile
index 3defda2..2860b35 100644
--- a/.profile
+++ b/.profile
@@ -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