summaryrefslogtreecommitdiff
path: root/awesome/util
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2024-09-17 19:17:49 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2024-09-17 19:17:49 -0500
commit36b45cb895303f4b8bdd99a737259740129e1fb9 (patch)
treec463be93caa340eb389a7b85ba155d2855b1e244 /awesome/util
parent3d98a08123c0c79641dd27516ef776747710ad4a (diff)
downloaddotconfig-36b45cb895303f4b8bdd99a737259740129e1fb9.tar.xz
dotconfig-36b45cb895303f4b8bdd99a737259740129e1fb9.zip
add current awesome configs
Diffstat (limited to 'awesome/util')
-rw-r--r--awesome/util/osname.lua5
-rw-r--r--awesome/util/seasonalwallpaper.lua9
-rw-r--r--awesome/util/widgets.lua19
3 files changed, 33 insertions, 0 deletions
diff --git a/awesome/util/osname.lua b/awesome/util/osname.lua
new file mode 100644
index 0000000..9501581
--- /dev/null
+++ b/awesome/util/osname.lua
@@ -0,0 +1,5 @@
+local handle = io.popen("uname")
+local result = handle:read("*a")
+handle:close()
+
+return result:match("^%s*(.-)%s*$") or "Unknown OS"
diff --git a/awesome/util/seasonalwallpaper.lua b/awesome/util/seasonalwallpaper.lua
new file mode 100644
index 0000000..230986a
--- /dev/null
+++ b/awesome/util/seasonalwallpaper.lua
@@ -0,0 +1,9 @@
+local gears = require("gears")
+
+local wallpapers_directory = gears.get_xdg_data_home() .. "wallpaper"
+local spring = wallpapers_directory .. "/spring"
+local summer = wallpapers_directory .. "/summer"
+local fall = wallpapers_directory .. "/fall"
+local winter = wallpapers_directory .. "/winter"
+
+
diff --git a/awesome/util/widgets.lua b/awesome/util/widgets.lua
new file mode 100644
index 0000000..301f25b
--- /dev/null
+++ b/awesome/util/widgets.lua
@@ -0,0 +1,19 @@
+local wibox = require("wibox")
+local gears = require("gears")
+
+local widgets = {}
+
+function widgets.watchfn(callback, timeout, base_widget)
+ local widget = (base_widget or wibox.widget.textbox)()
+ gears.timer({
+ timeout = timeout or 5,
+ call_now = true,
+ autostart = true,
+ callback = function()
+ callback(widget)
+ end
+ })
+ return widget
+end
+
+return widgets