feat: add mako notifications
This commit is contained in:
@@ -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,
|
||||
@@ -145,6 +145,15 @@
|
||||
},
|
||||
"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} {}",
|
||||
"return-type": "json",
|
||||
|
12
configs/waybar/cpu_speed.sh
Executable file
12
configs/waybar/cpu_speed.sh
Executable 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"\"}"
|
@@ -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
|
||||
|
3
configs/waybar/powermode.sh
Normal file
3
configs/waybar/powermode.sh
Normal 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")
|
||||
|
Reference in New Issue
Block a user