first commit, added xmobar as an example

This commit is contained in:
Tyler Starr 2020-12-12 20:23:47 -08:00
commit 8baeba4ca9
5 changed files with 55 additions and 0 deletions

4
.config/xmobar/cpu Executable file
View 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"

10
.config/xmobar/gamemode Executable file
View 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>"

13
.config/xmobar/volume Executable file
View File

@ -0,0 +1,13 @@
#! /bin/bash
volume=$(pactl list sinks | grep -A 7 'Name: alsa_output.usb-AudioQuest_inc._AudioQuest_DragonFly-00.analog-stereo' | tail -n 1 -c5 | sed 's/ //g')
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
mpcvolume=$(mpc volume)
echo "<fc=$color>${mpcvolume:7:10}</fc> <fc=#ebdbb2>-</fc> <fc=$color>$volume</fc>"

18
.config/xmobar/xmobarrc Executable file
View File

@ -0,0 +1,18 @@
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"
, commands = [ Run Cpu ["-t", " <fc=#fb4934><total></fc>%","-H", "2"] 10
, Run Memory ["-t", "<fc=#fb4934><usedratio></fc>%"] 10
, Run Network "enp4s0" [ "-t", "<fc=#fb4934><tx></fc>kb/<fc=#fb4934><rx></fc>kb" ] 10
, Run Com "/home/tstarr/.config/xmobar/volume" [] "volume" 10
, Run Com "/home/tstarr/.config/xmobar/gamemode" [] "gamemode" 10
, Run Date " %a %d/%m/%y  %H:%M:%S" "date" 10
, Run MPD ["-M","15","-t", "<artist> (<fc=#fb4934><lapsed></fc>/<length>)"] 10
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = " <fc=#fb4934>%StdinReader%</fc>}%date%{%enp4s0% | %mpd% | %volume% | 閭%cpu% |  %memory% |%gamemode% "
}

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
# Ignore all files
/*
!/.config
/.config/*
!/.config/xmobar
# But not these files...
!.gitignore