Adding cpu to awesome

This commit is contained in:
Chris Cochrun 2021-02-03 09:50:49 -06:00
parent 2c45b82785
commit 7b173db93d
6 changed files with 18 additions and 15 deletions

View file

@ -20,7 +20,7 @@
;; my splits
(local rules (require "rules"))
(local keybindings (require "keybindings"))
;; (local notifications (require "notifications"))
;; (local notifications (require "notifications")) ||#
;; Error handling
;; Check if awesome encountered an error during startup and fell back to
@ -306,7 +306,7 @@
3 s.batteryspace
:layout wibox.layout.fixed.horizontal}))
(set s.cputext (awful.widget.watch "cat /proc/loadavg | awk '{print $1}'" 10))
(set s.cputext (awful.widget.watch "cpu" 10))
(set s.cpuicon (wibox.widget.textbox " "))
(set s.cpuspace (wibox.widget.textbox " "))

View file

@ -38,10 +38,10 @@ shadow = true;
# The blur radius for shadows, in pixels. (defaults to 12)
# shadow-radius = 12
shadow-radius = 9;
shadow-radius = 13;
# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
shadow-opacity = .75
shadow-opacity = .65
# The left offset for shadows, in pixels. (defaults to -15)
# shadow-offset-x = -15
@ -91,14 +91,14 @@ shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
# "class_g = 'firefox'",
"class_g = 'Alacritty'",
# "class_g = 'Alacritty'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'",
"class_g = 'qutebrowser'",
# "class_g = 'qutebrowser'",
"class_g = 'slop'",
"class_g = 'qutebrowser'",
"class_g = 'mpv'",
"class_g = 'microsoft teams - insiders'",
# "class_g = 'qutebrowser'",
# "class_g = 'mpv'",
# "class_g = 'microsoft teams - insiders'",
# "class_g = 'Polybar'",
# "class_g = 'Rofi'",
"_GTK_FRAME_EXTENTS@:c"

View file

@ -7,4 +7,4 @@
config_version: 2
settings:
content.notifications:
https://www.facebook.com: false
https://jelly.cochrun.xyz: true

View file

@ -13,7 +13,7 @@ import glob
## This is here so configs done via the GUI are still loaded.
## Remove it to not load settings done via the GUI.
# config.load_autoconfig()
config.load_autoconfig()
## Aliases for commands. The keys of the given dictionary are the
## aliases, while the values are the commands they map to.
@ -1038,7 +1038,7 @@ c.content.headers.do_not_track = True
## Enable host blocking.
## Type: Bool
c.content.host_blocking.enabled = False
# c.content.host_blocking.enabled = true
## List of URLs of lists which contain hosts to block. The file can be
## in one of the following formats: - An `/etc/hosts`-like file - One
@ -1813,7 +1813,7 @@ c.statusbar.padding = {"top": 1, "bottom": 1, "left": 0, "right": 2}
## - always: Always show the statusbar.
## - never: Always hide the statusbar.
## - in-mode: Show the statusbar when in modes other than normal mode.
c.statusbar.show = "in-mode"
c.statusbar.show = "always"
## List of widgets displayed in the statusbar.
## Type: List of String

View file

@ -1,6 +1,6 @@
[FileDialog]
history=file:///home/chris/Videos, file:///home/chris, file:///home/chris/Downloads, file:///home/chris/Downloads/Takeout/Contacts/All Contacts, file:///home/chris/Pictures/Newsletter, file:///home/chris/org
lastVisited=file:///home/chris/org
history=file:///home/chris, file:///home/chris/Downloads, file:///home/chris/Downloads/Takeout/Contacts/All Contacts, file:///home/chris/Pictures/Newsletter, file:///home/chris/org, file:///home/chris/storage/digikam/Photos/Camera/Camera
lastVisited=file:///home/chris/storage/digikam/Photos/Camera/Camera
qtVersion=5.15.2
shortcuts=file:, file:///home/chris
sidebarWidth=116

3
scripts/cpu Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' \
<(rg 'cpu ' /proc/stat) <(sleep 1;rg 'cpu ' /proc/stat)