feat: add mako notifications

This commit is contained in:
max_richter 2022-01-17 14:48:30 +01:00
parent 47c9f5702b
commit 3d32043a89
6 changed files with 57 additions and 5 deletions

27
configs/mako/config Normal file
View File

@ -0,0 +1,27 @@
sort=-time
layer=overlay
background-color=#ffffff
width=300
height=110
border-color=#000000
border-radius=0
icons=0
max-icon-size=64
default-timeout=5000
ignore-timeout=1
font=monospace 14
text-color=#000000
[urgency=low]
border-color=#000000
[urgency=normal]
border-color=#d08770
[urgency=high]
border-color=#ff0000
default-timeout=0
[category=mpd]
default-timeout=2000
group-by=category

View File

@ -257,6 +257,7 @@ mode "resize" {
bindsym $mod+r mode "resize"
exec_always nm-applet --indicator
exec_always mako
#
# Status Bar:

View File

@ -2,8 +2,8 @@
"height": 20,
"spacing": 4,
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["custom/media"],
"modules-right": ["pulseaudio", "network", "cpu", "memory", "battery", "custom/clock" ],
"modules-center": ["custom/media", "custom/clock"],
"modules-right": ["pulseaudio", "network", "custom/cpu_speed", "memory", "battery", "custom/clock" ],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
@ -144,6 +144,15 @@
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/cpu_speed": {
"interval": 10,
"return-type": "json",
"exec": "~/.config/waybar/cpu_speed.sh",
"format": "<span font='Font Awesome 5 Free 11'>{icon}</span> {}",
"format-icons": [""],
"escape": true,
"on-click": "terminator -e htop"
},
"custom/media": {
"format": "{icon} {}",

12
configs/waybar/cpu_speed.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
class=cpu_speed
speed_mhz=$(lscpu | grep "CPU MHz" | sed --expression "s/CPU MHz:[[:space:]]*//g" | xargs printf "%.*f\n" 0)
# speed_ghz=`echo $(($speed_mhz / 1000))`
speed_ghz=`bc -l <<< "$speed_mhz / 1000"`
info=$(echo $speed_ghz | xargs printf "%.*f\n" 2)
echo -e "{\"text\":\""$info GHz"\", \"class\":\""$class"\"}"

View File

@ -93,9 +93,9 @@ def main():
arguments = parse_arguments()
# Initialize logging
LOG=expanduser("~")+"/.dotfiles/configs/waybar/media.log"
logging.basicConfig(level=logging.DEBUG, filename=LOG,
format='%(name)s %(levelname)s %(message)s')
# LOG=expanduser("~")+"/.dotfiles/configs/waybar/media.log"
# logging.basicConfig(level=logging.DEBUG, filename=LOG,
# format='%(name)s %(levelname)s %(message)s')
# Logging is set by default to WARN and higher.
# With every occurrence of -v it's lowered by one

View File

@ -0,0 +1,3 @@
MAX_FREQ=$(lscpu | grep "CPU max MHz" | sed --expression "s/CPU max MHz:[[:space:]]*//g" | xargs printf "%.*f\n" 0)
CURRENT_MAX_FREG=$(cpufreq-info | grep "c")