dotfiles/slackware/home/lemonbar/.config/lemonbar/lemonbar.fish

23 lines
527 B
Fish
Executable file

#!/usr/bin/fish
while true
set batt_str (acpi | cut -d ':' -f2 | cut -d ',' -f1 | tr -d ' ')
set batt_emoji = ""
switch $batt_str
case "Full*"
set batt_emoji "✔️"
case 'Discharging*'
set batt_emoji "🔋"
case 'Not*'
set batt_emoji "X"
case 'Charging*'
set batt_emoji "⚡"
end
set batt (acpi | cut -d ':' -f2 | cut -d ',' -f2 | tr -d ' ')
echo -e "%{c}$(now) %{r}$(sugar --lb) $batt_emoji $batt "
sleep 1
end