1
0
Fork 0

fix icons for statusbar/neovim

This commit is contained in:
Luca Bilke 2024-01-15 22:25:14 +01:00
commit 53d5bf18df
9 changed files with 108 additions and 109 deletions

View file

@ -1,55 +1,55 @@
return { return {
kind = { kind = {
Array = "", Array = "",
Boolean = "", Boolean = "",
Class = "", Class = "",
Color = "", Color = "",
Constant = "", Constant = "",
Constructor = "", Constructor = "",
Enum = "", Enum = "",
EnumMember = "", EnumMember = "",
Event = "", Event = "",
Field = "", Field = "",
File = "", File = "",
Folder = "", Folder = "󰉋",
Function = "", Function = "",
Interface = "", Interface = "",
Key = "", Key = "",
Keyword = "", Keyword = "",
Method = "", Method = "",
Module = "", Module = "",
Namespace = "", Namespace = "",
Null = "", Null = "󰟢",
Number = "", Number = "",
Object = "", Object = "",
Operator = "", Operator = "",
Package = "", Package = "",
Property = "", Property = "",
Reference = "", Reference = "",
Snippet = "", Snippet = "",
String = "", String = "",
Struct = "", Struct = "",
Text = "", Text = "",
TypeParameter = "", TypeParameter = "",
Unit = "", Unit = "",
Value = "", Value = "",
Variable = "", Variable = "",
}, },
git = { git = {
LineAdded = "", LineAdded = "",
LineModified = "", LineModified = "",
LineRemoved = "", LineRemoved = "",
FileDeleted = "", FileDeleted = "",
FileIgnored = "", FileIgnored = "",
FileRenamed = "", FileRenamed = "",
FileStaged = "S", FileStaged = "S",
FileUnmerged = "", FileUnmerged = "",
FileUnstaged = "", FileUnstaged = "",
FileUntracked = "U", FileUntracked = "U",
Diff = "", Diff = "",
Repo = "", Repo = "",
Octoface = "", Octoface = "",
Branch = "", Branch = "",
}, },
ui = { ui = {
ArrowCircleDown = "", ArrowCircleDown = "",
@ -69,7 +69,7 @@ return {
Bug = "", Bug = "",
Stacks = "", Stacks = "",
Scopes = "", Scopes = "",
Watches = "", Watches = "󰂥",
DebugConsole = "", DebugConsole = "",
Calendar = "", Calendar = "",
Check = "", Check = "",
@ -79,82 +79,82 @@ return {
ChevronShortRight = "", ChevronShortRight = "",
ChevronShortUp = "", ChevronShortUp = "",
Circle = "", Circle = "",
Close = "", Close = "󰅖",
CloudDownload = "", CloudDownload = "",
CMD = "", CMD = "",
Code = "", Code = "",
Comment = "", Comment = "",
Dashboard = "", Dashboard = "",
DividerLeft = "", DividerLeft = "",
DividerRight = "", DividerRight = "",
DoubleChevronRight = "", DoubleChevronRight = "󰄾",
DoubleChevronLeft = "", DoubleChevronLeft = "󰄽",
Ellipsis = "", Ellipsis = "",
EmptyFolder = "", EmptyFolder = "",
EmptyFolderOpen = "", EmptyFolderOpen = "",
File = "", File = "",
FileSymlink = "", FileSymlink = "",
Files = "", Files = "",
FindFile = "", FindFile = "󰈞",
FindText = "", FindText = "󰊄",
Fire = "", Fire = "",
Folder = "", Folder = "󰉋",
FolderOpen = "", FolderOpen = "",
FolderSymlink = "", FolderSymlink = "",
Forward = "", Forward = "",
Gear = "", Gear = "",
History = "", History = "",
Import = "", Import = "",
Keyboard = "", Keyboard = "",
Lightbulb = "", Lightbulb = "",
LineLeft = "", LineLeft = "",
LineMiddle = "", LineMiddle = "",
List = "", List = "",
Lock = "", Lock = "",
MinusCircle = "", MinusCircle = "",
NewFile = "", NewFile = "",
Note = "", Note = "",
Package = "", Package = "",
Pencil = "", Pencil = "󰏫",
Plus = "", Plus = "",
Project = "", Project = "",
Search = "", Search = "",
SignIn = "", SignIn = "",
SignOut = "", SignOut = "",
Sleep = "󰒲", Sleep = "󰒲",
Tab = "", Tab = "󰌒",
Table = "", Table = "",
Target = "", Target = "",
Telescope = "", Telescope = "",
Text = "", Text = "",
Tree = "", Tree = "",
Triangle = "", Triangle = "󰐊",
TriangleShortArrowDown = "", triangleshortarrowdown = "",
TriangleShortArrowLeft = "", triangleshortarrowleft = "",
TriangleShortArrowRight = "", triangleshortarrowright = "",
TriangleShortArrowUp = "", triangleshortarrowup = "",
}, },
diagnostics = { diagnostics = {
BoldError = "", BoldError = "",
Error = "", Error = "",
BoldWarning = "", BoldWarning = "",
Warning = "", Warning = "",
BoldInformation = "", BoldInformation = "",
Information = "", Information = "",
BoldQuestion = "", BoldQuestion = "",
Question = "", Question = "",
BoldHint = "", BoldHint = "",
Hint = "", Hint = "󰌶",
Debug = "", Debug = "",
Trace = "", Trace = "",
}, },
progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" }, progress = { "", "", "", "", "", "", "", "", "", "", "", "", "" },
misc = { misc = {
Robot = "", Robot = "󰚩",
Squirrel = "", Squirrel = "",
Tag = "", Tag = "",
Watch = "", Watch = "",
Smiley = "", Smiley = "",
Package = "", Package = "",
CircuitBoard = "", CircuitBoard = "",
Vim = "", Vim = "",

View file

@ -11,57 +11,56 @@ for battery in /sys/class/power_supply/BAT?*; do
capacity="$(cat "$battery/capacity" 2>&1)" capacity="$(cat "$battery/capacity" 2>&1)"
case "$(cat "$battery/status" 2>&1)" in case "$(cat "$battery/status" 2>&1)" in
"Full") "Full")
icon="" icon="󰁹"
color="$green" color="$green"
;; ;;
"Charging")
icon=""
color="$cyan"
;;
"Not charging") "Not charging")
icon="" icon="󰁹"
color="$white" color="$white"
;; ;;
"Unknown") "Unknown")
icon="" icon="󰂑"
color="$orange" color="$orange"
;; ;;
"Charging")
icon="󰂄"
color="$cyan"
;;
"Discharging") "Discharging")
if [ "$capacity" -le 10 ]; then if [ "$capacity" -le 10 ]; then
icon="" icon="󰂎"
color="$red" color="$red"
elif [ "$capacity" -le 20 ]; then elif [ "$capacity" -le 20 ]; then
icon="" icon="󰁺"
color="$red" color="$red"
elif [ "$capacity" -le 30 ]; then elif [ "$capacity" -le 30 ]; then
icon="" icon="󰁻"
color="$white" color="$white"
elif [ "$capacity" -le 40 ]; then elif [ "$capacity" -le 40 ]; then
icon="" icon="󰁼"
color="$white" color="$white"
elif [ "$capacity" -le 50 ]; then elif [ "$capacity" -le 50 ]; then
icon="" icon="󰁽"
color="$white" color="$white"
elif [ "$capacity" -le 60 ]; then elif [ "$capacity" -le 60 ]; then
icon="" icon="󰁾"
color="$white" color="$white"
elif [ "$capacity" -le 70 ]; then elif [ "$capacity" -le 70 ]; then
icon="" icon="󰁿"
color="$white" color="$white"
elif [ "$capacity" -le 80 ]; then elif [ "$capacity" -le 80 ]; then
icon="" icon="󰂀"
color="$white" color="$white"
elif [ "$capacity" -le 90 ]; then elif [ "$capacity" -le 90 ]; then
icon="" icon="󰂁"
color="$white" color="$white"
elif [ "$capacity" -le 95 ]; then elif [ "$capacity" -le 100 ]; then
icon="" icon="󰂂"
color="$white" color="$white"
else else
icon="" icon="󰁹"
color="$white" color="$white"
fi fi
;; ;;
*) exit 1 ;; *) exit 1 ;;
esac esac

View file

@ -12,7 +12,7 @@ temp=$(sensors | awk '/CPU/ {printf ("%.f°C", $2)}' | tr -d "+")
stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat) stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat)
[ ! -f $cache ] && echo "$stats" >"$cache" [ ! -f $cache ] && echo "$stats" >"$cache"
old=$(cat "$cache") old=$(cat "$cache")
printf "%b" "$big$normal $temp " printf "%b" "$big$normal $temp"
echo "$stats" | while read -r row; do echo "$stats" | while read -r row; do
id=${row%% *} id=${row%% *}
rest=${row#* } rest=${row#* }

View file

@ -7,7 +7,7 @@ big="\033[11m"
if ls /sys/class/net/w*/operstate 1>/dev/null 2>&1; then if ls /sys/class/net/w*/operstate 1>/dev/null 2>&1; then
for w in /sys/class/net/w*/; do for w in /sys/class/net/w*/; do
percent="$(cat /proc/net/wireless | grep "$(basename "$(dirname $w/operstate)")" | tr -s ' ' | cut -d ' ' -f3 | tr -dc "[:digit:]")" percent="$(cat /proc/net/wireless | grep "$(basename "$(dirname $w/operstate)")" | tr -s ' ' | cut -d ' ' -f3 | tr -dc "[:digit:]")"
grep -vxq '0x1003' "$w/flags" && wifi_icon="" || wifi_icon="$(sed "s/up/直/;s/down/睊/;s/dormant/睊/" $w/operstate | tr -d "[:space:]")" grep -vxq '0x1003' "$w/flags" && wifi_icon="" || wifi_icon="$(sed "s/up/󰖩/;s/down/󰖪/;s/dormant/󰤯/" $w/operstate | tr -d "[:space:]")"
printf "%b" "$shift$big$wifi_icon$reset $percent" printf "%b" "$shift$big$wifi_icon$reset $percent"
shift=" " shift=" "
done done
@ -15,14 +15,14 @@ fi
if ls /sys/class/net/e*/operstate 1>/dev/null 2>&1; then if ls /sys/class/net/e*/operstate 1>/dev/null 2>&1; then
for e in /sys/class/net/e*/operstate; do for e in /sys/class/net/e*/operstate; do
[ "$(cat "$e")" = "up" ] && printf "%b" "$shift" [ "$(cat "$e")" = "up" ] && printf "%b" "$shift󰈁"
shift=" " shift=" "
done done
fi fi
if ls /sys/class/net/tun*/operstate 1>/dev/null 2>&1; then if ls /sys/class/net/tun*/operstate 1>/dev/null 2>&1; then
for _ in /sys/class/net/tun*/operstate; do for _ in /sys/class/net/tun*/operstate; do
printf "%b" "$shift$big$reset" printf "%b" "$shift$big󰖂$reset"
shift=" " shift=" "
done done
fi fi

View file

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
printf "%b" "\033[11m\033[10m " printf "%b" "\033[11m󰍛\033[10m "
free --mega | sed -n '2{p;q}' | awk '{printf ("%2.2fG/%2.2fG\n", ($3 / 1000), ($2 / 1000))}' free --mega | sed -n '2{p;q}' | awk '{printf ("%2.2fG/%2.2fG\n", ($3 / 1000), ($2 / 1000))}'

View file

@ -3,10 +3,10 @@ filter() {
if mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 3 ]; then if mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 3 ]; then
song=$(mpc current -f "%artist% - %title%" | xargs -0) song=$(mpc current -f "%artist% - %title%" | xargs -0)
[ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…" [ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…"
mpc | awk 'NR==2' | grep -q playing && icon="" || icon="" mpc | awk 'NR==2' | grep -q playing && icon="󰏤" || icon="󰐊"
echo "$icon $song" echo "$icon $song"
elif mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 1 ]; then elif mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 1 ]; then
echo "" echo "󰓛"
else else
exit 1 exit 1
fi fi

View file

@ -17,4 +17,4 @@ update() {
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
printf "%b%5sB %b%5sB%b" "$big$reset" "$(numfmt --to=iec "$rx")" "$big$reset" "$(numfmt --to=iec "$tx")" "\n" printf "%b%5sB %b%5sB%b" "$big$reset" "$(numfmt --to=iec "$rx")" "$big$reset" "$(numfmt --to=iec "$tx")" "\n"

View file

@ -2,7 +2,7 @@
big="\033[11m" big="\033[11m"
reset="\033[0m" reset="\033[0m"
icon="" icon=""
if command -v pacman 1>/dev/null 2>&1; then if command -v pacman 1>/dev/null 2>&1; then
num="$(pacman -Qu | grep -Fcv "[ignored]")" num="$(pacman -Qu | grep -Fcv "[ignored]")"

View file

@ -4,10 +4,10 @@ big="\033[11m"
reset="\033[0m" reset="\033[0m"
pidof -x sbd-playerctl >/dev/null 2>&1 || sbd-playerctl >/dev/null 2>&1 & pidof -x sbd-playerctl >/dev/null 2>&1 || sbd-playerctl >/dev/null 2>&1 &
[ "$(playerctl status 2>&1)" = "No players found" ] && printf "%b%b" "$big" "$reset" && exit 1 [ "$(playerctl status 2>&1)" = "No players found" ] && printf "%b%b" "$big" "$reset" && exit 1
# song="$(playerctl metadata xesam:artist) - $(playerctl metadata xesam:title)" # song="$(playerctl metadata xesam:artist) - $(playerctl metadata xesam:title)"
song="$(playerctl metadata xesam:title) - $(playerctl metadata xesam:artist)" song="$(playerctl metadata xesam:title) - $(playerctl metadata xesam:artist)"
[ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…" [ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…"
icon="$(playerctl status | sed "s/Playing//;s/Paused//;s/Stopped//;")" icon="$(playerctl status | sed "s/Playing//;s/Paused//;s/Stopped/󰓛/;")"
printf "%b" "$big$icon$reset $song" printf "%b" "$big$icon$reset $song"