mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-18 18:57:32 -08:00
update xmobar
This commit is contained in:
parent
da715f6e73
commit
0cc40b22c9
@ -1 +0,0 @@
|
||||
../../.dotfiles/.config/xmobar/cpu
|
4
.config/xmobar/cpu
Executable file
4
.config/xmobar/cpu
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
CPU_USAGE=$(top -b -n2 -p 1 | fgrep "Cpu(s)" | tail -1 | awk -F'id,' -v prefix="$prefix" '{ split($1, vs, ","); v=vs[length(vs)]; sub("%", "", v); printf "%s%.1f%%\n", prefix, 100 - v }')
|
||||
echo "$CPU_USAGE"
|
@ -1 +0,0 @@
|
||||
../../.dotfiles/.config/xmobar/gamemode
|
10
.config/xmobar/gamemode
Executable file
10
.config/xmobar/gamemode
Executable file
@ -0,0 +1,10 @@
|
||||
#! /bin/bash
|
||||
|
||||
status=$(gamemoded -s)
|
||||
if [ "$status" == "gamemode is inactive" ]; then
|
||||
color="#b8bb26"
|
||||
else
|
||||
color="#fb4934"
|
||||
fi
|
||||
|
||||
echo "<fc=$color> </fc>"
|
@ -1 +0,0 @@
|
||||
../../.dotfiles/.config/xmobar/mouse_battery
|
17
.config/xmobar/mouse_battery
Executable file
17
.config/xmobar/mouse_battery
Executable file
@ -0,0 +1,17 @@
|
||||
status=$(cat /sys/class/power_supply/hidpp_battery_*/uevent | grep POWER_SUPPLY_VOLTAGE)
|
||||
voltage=$(echo $status | cut -c26-29)
|
||||
if [ "$voltage" -ge 3700 ]; then
|
||||
color="#b8bb26"
|
||||
else
|
||||
color="#fb4934"
|
||||
fi
|
||||
|
||||
status1=$(cat /sys/class/power_supply/hidpp_battery_*/uevent | grep POWER_SUPPLY_STATUS | tail -n1)
|
||||
charge=$(echo $status1 | cut -c21-)
|
||||
if [ "$charge" = "Discharging" ]; then
|
||||
color1="#fb4934"
|
||||
else
|
||||
color1="#b8bb26"
|
||||
fi
|
||||
|
||||
echo "<fc=$color1> </fc><fc=$color>${voltage}mV</fc>"
|
@ -1 +0,0 @@
|
||||
../../.dotfiles/.config/xmobar/volume
|
11
.config/xmobar/volume
Executable file
11
.config/xmobar/volume
Executable file
@ -0,0 +1,11 @@
|
||||
#! /bin/bash
|
||||
|
||||
volume=$(pactl list sinks | grep -A 7 'Name: alsa_output.usb-AudioQuest_inc._AudioQuest_DragonFly-00.analog-stereo' | tail -n 1 | sed 's/%.*//' | tail -c3)
|
||||
mute=$(pactl list sinks | grep -A 6 'Name: alsa_output.usb-AudioQuest_inc._AudioQuest_DragonFly-00.analog-stereo' | tail -n 1 -c4 | sed 's/ //g')
|
||||
if [ "$mute" == "yes" ]; then
|
||||
color="#fb4934"
|
||||
else
|
||||
color="#b8bb26"
|
||||
fi
|
||||
|
||||
echo "<fc=$color> $volume%</fc>"
|
@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
## HLWM Xmobar Tag Status ######
|
||||
# Version 0.1 by Scott Garrett #
|
||||
# Wintervenom [(at)] gmail.com #
|
||||
################################
|
||||
|
||||
hc () {
|
||||
herbstclient "$@"
|
||||
}
|
||||
|
||||
tags () {
|
||||
printf '[%s] ' $(hc tag_status)
|
||||
echo
|
||||
}
|
||||
|
||||
set -f
|
||||
IFS=$'\t'
|
||||
tags
|
||||
hc -i tag_changed |
|
||||
while read hook tag mon; do
|
||||
tags
|
||||
done
|
||||
|
@ -1 +0,0 @@
|
||||
../../.dotfiles/.config/xmobar/xmobarrc
|
20
.config/xmobar/xmobarrc
Executable file
20
.config/xmobar/xmobarrc
Executable file
@ -0,0 +1,20 @@
|
||||
Config { font = "xft:Mononoki Nerd Font:pixelsize=12:antialias=true:hinting=true"
|
||||
, bgColor = "#282828"
|
||||
, fgColor = "#ebdbb2"
|
||||
, position = Static {xpos = 0, ypos = 0, width = 2560, height = 20}
|
||||
, iconRoot = "X"
|
||||
, allDesktops = True
|
||||
, commands = [ Run Cpu ["-t", " <fc=#fb4934><total></fc>%","-H", "2"] 10
|
||||
, Run Memory ["-t", "<fc=#fb4934><usedratio></fc>%"] 10
|
||||
, Run Network "enp3s0" [ "-t", "<fc=#fb4934><tx></fc>kb/<fc=#fb4934><rx></fc>kb" ] 10
|
||||
, Run Com "/home/tstarr/.config/xmobar/wireguard" [] "wireguard" 10
|
||||
, Run Com "/home/tstarr/.config/xmobar/volume" [] "volume" 10
|
||||
, Run Com "/home/tstarr/.config/xmobar/gamemode" [] "gamemode" 10
|
||||
, Run Com "/home/tstarr/.config/xmobar/mouse_battery" [] "mouse_battery" 30
|
||||
, Run Date " %a %d/%m/%y %H:%M:%S" "date" 10
|
||||
, Run StdinReader
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = " <fc=#fb4934>%StdinReader%</fc>}%date%{%enp3s0% | %mouse_battery% | %volume% | 閭%cpu% | %memory% | %gamemode% %wireguard%"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user