1
0
Fork 0

fix icons for statusbar/neovim

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

View file

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

View file

@ -11,57 +11,56 @@ for battery in /sys/class/power_supply/BAT?*; do
capacity="$(cat "$battery/capacity" 2>&1)"
case "$(cat "$battery/status" 2>&1)" in
"Full")
icon=""
icon="󰁹"
color="$green"
;;
"Charging")
icon=""
color="$cyan"
;;
"Not charging")
icon=""
icon="󰁹"
color="$white"
;;
"Unknown")
icon=""
icon="󰂑"
color="$orange"
;;
"Charging")
icon="󰂄"
color="$cyan"
;;
"Discharging")
if [ "$capacity" -le 10 ]; then
icon=""
icon="󰂎"
color="$red"
elif [ "$capacity" -le 20 ]; then
icon=""
icon="󰁺"
color="$red"
elif [ "$capacity" -le 30 ]; then
icon=""
icon="󰁻"
color="$white"
elif [ "$capacity" -le 40 ]; then
icon=""
icon="󰁼"
color="$white"
elif [ "$capacity" -le 50 ]; then
icon=""
icon="󰁽"
color="$white"
elif [ "$capacity" -le 60 ]; then
icon=""
icon="󰁾"
color="$white"
elif [ "$capacity" -le 70 ]; then
icon=""
icon="󰁿"
color="$white"
elif [ "$capacity" -le 80 ]; then
icon=""
icon="󰂀"
color="$white"
elif [ "$capacity" -le 90 ]; then
icon=""
icon="󰂁"
color="$white"
elif [ "$capacity" -le 95 ]; then
icon=""
elif [ "$capacity" -le 100 ]; then
icon="󰂂"
color="$white"
else
icon=""
icon="󰁹"
color="$white"
fi
;;
*) exit 1 ;;
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)
[ ! -f $cache ] && echo "$stats" >"$cache"
old=$(cat "$cache")
printf "%b" "$big$normal $temp "
printf "%b" "$big$normal $temp"
echo "$stats" | while read -r row; do
id=${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
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:]")"
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"
shift=" "
done
@ -15,14 +15,14 @@ fi
if ls /sys/class/net/e*/operstate 1>/dev/null 2>&1; then
for e in /sys/class/net/e*/operstate; do
[ "$(cat "$e")" = "up" ] && printf "%b" "$shift"
[ "$(cat "$e")" = "up" ] && printf "%b" "$shift󰈁"
shift=" "
done
fi
if ls /sys/class/net/tun*/operstate 1>/dev/null 2>&1; then
for _ in /sys/class/net/tun*/operstate; do
printf "%b" "$shift$big$reset"
printf "%b" "$shift$big󰖂$reset"
shift=" "
done
fi

View file

@ -1,3 +1,3 @@
#!/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))}'

View file

@ -3,10 +3,10 @@ filter() {
if mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 3 ]; then
song=$(mpc current -f "%artist% - %title%" | xargs -0)
[ ${#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"
elif mpc 1>/dev/null 2>&1 && [ "$(mpc | wc -l)" -eq 1 ]; then
echo ""
echo "󰓛"
else
exit 1
fi

View file

@ -17,4 +17,4 @@ update() {
rx=$(update /sys/class/net/[ew]*/statistics/rx_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"
reset="\033[0m"
icon=""
icon=""
if command -v pacman 1>/dev/null 2>&1; then
num="$(pacman -Qu | grep -Fcv "[ignored]")"

View file

@ -4,10 +4,10 @@ big="\033[11m"
reset="\033[0m"
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:title) - $(playerctl metadata xesam:artist)"
[ ${#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"