From 70825f19ff5c8bd78780265ece1fc2c00a026f84 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 26 Aug 2020 04:59:24 +0400 Subject: Changed icons in status bar scripts and added tmux to autostart in tty/terminal --- .local/bin/statusbar/battery | 38 +++++++++++++++++++++++++++++++++----- .local/bin/statusbar/clock | 3 ++- .local/bin/statusbar/disk | 6 +++--- .local/bin/statusbar/pacpackages | 2 +- .local/bin/statusbar/volume | 15 ++++++++------- 5 files changed, 47 insertions(+), 17 deletions(-) (limited to '.local') 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, ' ')}%") -- cgit v1.2.3