From 485a457a8cfef2c17beaa8b12da5e33827e0c783 Mon Sep 17 00:00:00 2001 From: Valerie Date: Sun, 26 Sep 2021 01:52:03 -0400 Subject: [PATCH] added sysmenu configuration --- sysmenu/config | 95 +++++++++++++++++++++++++++++++ sysmenu/script/pingtest.sh | 0 sysmenu/script/redshift_period.sh | 8 +++ sysmenu/script/redshift_temp.sh | 7 +++ sysmenu/script/redshift_tog.sh | 8 +++ 5 files changed, 118 insertions(+) create mode 100644 sysmenu/config create mode 100644 sysmenu/script/pingtest.sh create mode 100755 sysmenu/script/redshift_period.sh create mode 100755 sysmenu/script/redshift_temp.sh create mode 100755 sysmenu/script/redshift_tog.sh diff --git a/sysmenu/config b/sysmenu/config new file mode 100644 index 0000000..2ed03c4 --- /dev/null +++ b/sysmenu/config @@ -0,0 +1,95 @@ +[global] +background = #2A2A2E +foreground = #FFFFFF +highlight = #3D4558 +padding_y = 8 +padding_x = 8 + +[font:fira] +family = Fira Code +size = 11 + +[menu:cal] +items = label:cal +x = 1732 +y = 24 + +[menu:lan] +items = label:ssid label:myip button:pingtest +x = 1616 +y = 24 + +[menu:player] +items = label:player +x = 1632 +y = 24 + +[menu:redshift] +items = button:redshift label:rs_period label:rs_temp +x = 1640 +y = 24 + +[menu:system] +items = label:user button:term button:logout button:reboot button:poweroff +x = 5 +y = 24 + +[button:logout] +text = Logout +command = i3-msg exit + +[button:pingtest] +text = Ping Test +command = ~/.script/inet/is-back +condition = $(if ! pidof ping; then echo true; fi) + +[button:poweroff] +text = Poweroff +command = poweroff + +[button:reboot] +text = Reboot +command = reboot + +[button:redshift] +text = Redshift +command = ~/.config/sysmenu/script/redshift_tog.sh + +[button:term] +text = Open Terminal +command = wezterm + +[label:cal] +font = fira +text = $(cal) +eval = true +strip = right + +[label:myip] +font = fira +text = $(ip addr | grep 192. | awk '{ print substr($2, 0, length($2) - 3 ) }') +eval = true + +[label:player] +text = $(playerctl metadata | head -n 1 | awk '{ print $1 }') +eval = true + +[label:rs_period]: +#text = $(redshift -p 2> /dev/null | grep "Period" | awk '{ print $2 }') +text = $(~/.config/sysmenu/script/redshift_period.sh) +eval = true + +[label:rs_temp] +#text = $(redshift -p 2> /dev/null | grep "temperature" | awk '{ print $3 }') +text = $(~/.config/sysmenu/script/redshift_temp.sh) +eval = true + +[label:ssid] +font = fira +text = $(iwctl station wlan0 show | grep Connected | awk '{ print $3 }') +eval = true + +[label:user] +font = fira +text = $(whoami)@$(hostname) +eval = true diff --git a/sysmenu/script/pingtest.sh b/sysmenu/script/pingtest.sh new file mode 100644 index 0000000..e69de29 diff --git a/sysmenu/script/redshift_period.sh b/sysmenu/script/redshift_period.sh new file mode 100755 index 0000000..1fd0804 --- /dev/null +++ b/sysmenu/script/redshift_period.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash + +if pidof redshift > /dev/null; then + echo $(redshift -p 2> /dev/null | grep "Period" | awk '{ print $2 }') +else + echo "Disabled" +fi + diff --git a/sysmenu/script/redshift_temp.sh b/sysmenu/script/redshift_temp.sh new file mode 100755 index 0000000..a54bd9d --- /dev/null +++ b/sysmenu/script/redshift_temp.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +if pidof redshift > /dev/null; then + echo $(redshift -p 2> /dev/null | grep "temperature" | awk '{ print $3 }') +else + echo "-" +fi diff --git a/sysmenu/script/redshift_tog.sh b/sysmenu/script/redshift_tog.sh new file mode 100755 index 0000000..0f9637e --- /dev/null +++ b/sysmenu/script/redshift_tog.sh @@ -0,0 +1,8 @@ +#!/usr/bin/bash + +if pidof redshift > /dev/null; then + killall redshift +else + redshift & +fi +