aboutsummaryrefslogtreecommitdiff
path: root/cusmodules
diff options
context:
space:
mode:
authorMichael Kantor <michael@mikekantor.xyz>2025-09-01 15:33:24 -0400
committerMichael Kantor <michael@mikekantor.xyz>2025-09-01 15:33:24 -0400
commitac3aa3740a831f7bdeda342c6c4704568f01070c (patch)
treed8c2b3e0464c2561b274067df89d9c44d1a212a5 /cusmodules
parentd0ac4b9667108cd1eeb57b88072cf428cb953854 (diff)
Updated README. Added autostart.sh example. Removed function to defloat mpv window. Adjusted font and formatting of GroupBox widget because a qtile update raised the numbers too high. Added OpenRazer support to colors.py and wallpaper.py; the lights of a Razer keyboard will change to the sixth color from pywal. Fixed logging in ticker_gecko.py. Migrated to new qtile entry point in relevant files.HEADmaster
Diffstat (limited to 'cusmodules')
-rwxr-xr-xcusmodules/colors.py9
-rwxr-xr-xcusmodules/cuswidgets/ticker_gecko.py2
-rwxr-xr-xcusmodules/wallpaper.py12
3 files changed, 18 insertions, 5 deletions
diff --git a/cusmodules/colors.py b/cusmodules/colors.py
index f25c3c7..c9a3cbc 100755
--- a/cusmodules/colors.py
+++ b/cusmodules/colors.py
@@ -22,6 +22,7 @@ import wallpaper
from pathlib import Path
from random import randint
from subprocess import run
+import openrazer.client
def random(colors):
colorcount = len(colors) - 1
@@ -51,9 +52,15 @@ def setColor(home, color_dir, choice, **kwargs):
#run(['qtile', 'shell', '-c', 'restart()'])
#run(['kill', '-SIGUSR1', os.popen('pidof qtile').read().strip('\n')])
- run([f'{home}/git/qtile/bin/qtile', 'shell', '-c', 'reload_config()'])
+ run([f'{home}/git/qtile/.venv/bin/qtile', 'shell', '-c', 'reload_config()'])
run([f'{home}/.local/bin/pywalfox', 'update'])
+ rgb = tuple(int(bottom_color.lstrip('#')[i:i+2], 16) for i in (0, 2, 4))
+ devman = openrazer.client.DeviceManager()
+
+ for device in devman.devices:
+ device.fx.static(rgb[0], rgb[1], rgb[2])
+
return 0
def main(argc, argv):
diff --git a/cusmodules/cuswidgets/ticker_gecko.py b/cusmodules/cuswidgets/ticker_gecko.py
index d58e458..94fd1c6 100755
--- a/cusmodules/cuswidgets/ticker_gecko.py
+++ b/cusmodules/cuswidgets/ticker_gecko.py
@@ -111,7 +111,7 @@ def main():
return crprices[:15]
except Exception as e:
- with open(f'{home}/.local/share/ticker_gecko/ticker_gecko.log', 'w') as f:
+ with open(f'{home}/.local/share/ticker_gecko/ticker_gecko.log', 'w+') as f:
f.write(e)
return f'ERROR! Check "{home}/.local/share/ticker_gecko/ticker_gecko.log".'
diff --git a/cusmodules/wallpaper.py b/cusmodules/wallpaper.py
index 226fe52..711c507 100755
--- a/cusmodules/wallpaper.py
+++ b/cusmodules/wallpaper.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python
-
#Copyright (C) 2024 Michael Kantor
#This program is free software: you can redistribute it and/or modify
@@ -20,6 +19,7 @@ import sys
import json
import toml
import signal
+import openrazer.client
from PIL import Image
from pathlib import Path
from random import randint
@@ -176,7 +176,7 @@ if __name__ == '__main__':
#subprocess.check_call(['qtile', 'shell', '-c', 'restart()'])
#run(['kill', '-SIGUSR1', os.popen('pidof qtile').read().strip('\n')])
#run(['qtile', 'shell', '-c', 'restart()'])
- run([f'{home}/git/qtile/bin/qtile', 'shell', '-c', 'reload_config()'])
+ run([f'{home}/git/qtile/.venv/bin/qtile', 'shell', '-c', 'reload_config()'])
except:
os.system('killall dwm')
@@ -277,7 +277,13 @@ if __name__ == '__main__':
#subprocess.check_call(['qtile', 'shell', '-c', 'restart()'])
#run(['qtile', 'shell', '-c', 'restart()'])
#run(['kill', '-SIGUSR1', os.popen('pidof qtile').read().strip('\n')])
- run([f'{home}/git/qtile/bin/qtile', 'shell', '-c', 'reload_config()'])
+ run([f'{home}/git/qtile/.venv/bin/qtile', 'shell', '-c', 'reload_config()'])
+
+ rgb = tuple(int(bottom_color.lstrip('#')[i:i+2], 16) for i in (0, 2, 4))
+ devman = openrazer.client.DeviceManager()
+
+ for device in devman.devices:
+ device.fx.static(rgb[0], rgb[1], rgb[2])
#os.system('qtile shell -c "restart()"')
except: