commit 8baeba4ca96d55ea9212f600bb99ec53d6d5d0bc Author: starr-dusT Date: Sat Dec 12 20:23:47 2020 -0800 first commit, added xmobar as an example diff --git a/.config/xmobar/cpu b/.config/xmobar/cpu new file mode 100755 index 00000000..e53ad7fd --- /dev/null +++ b/.config/xmobar/cpu @@ -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" diff --git a/.config/xmobar/gamemode b/.config/xmobar/gamemode new file mode 100755 index 00000000..a619ea43 --- /dev/null +++ b/.config/xmobar/gamemode @@ -0,0 +1,10 @@ +#! /bin/bash + +status=$(gamemoded -s) +if [ "$status" == "gamemode is inactive" ]; then + color="#b8bb26" +else + color="#fb4934" +fi + +echo "  " diff --git a/.config/xmobar/volume b/.config/xmobar/volume new file mode 100755 index 00000000..488e20b2 --- /dev/null +++ b/.config/xmobar/volume @@ -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 "${mpcvolume:7:10} - $volume" diff --git a/.config/xmobar/xmobarrc b/.config/xmobar/xmobarrc new file mode 100755 index 00000000..e6bf5fb1 --- /dev/null +++ b/.config/xmobar/xmobarrc @@ -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", " %","-H", "2"] 10 + , Run Memory ["-t", "%"] 10 + , Run Network "enp4s0" [ "-t", "kb/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", " (/)"] 10 + , Run StdinReader + ] + , sepChar = "%" + , alignSep = "}{" + , template = " %StdinReader%}%date%{%enp4s0% | %mpd% | %volume% | 閭%cpu% |  %memory% |%gamemode% " + } diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5b19ac88 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Ignore all files +/* +!/.config +/.config/* +!/.config/xmobar + +# But not these files... +!.gitignore + +