diff options
| author | Michael Kantor <michael@mikekantor.xyz> | 2026-02-15 20:47:06 -0500 |
|---|---|---|
| committer | Michael Kantor <michael@mikekantor.xyz> | 2026-02-15 20:47:06 -0500 |
| commit | c95c4a7d0cac4d9a5017f1dc5a0eaf77b8dfc7f0 (patch) | |
| tree | 59da25a117b69154de41382cf211749efcac61a8 /cusmodules | |
| parent | ac3aa3740a831f7bdeda342c6c4704568f01070c (diff) | |
Diffstat (limited to 'cusmodules')
| -rwxr-xr-x | cusmodules/colors.py | 7 | ||||
| -rwxr-xr-x | cusmodules/wallpaper.py | 30 |
2 files changed, 30 insertions, 7 deletions
diff --git a/cusmodules/colors.py b/cusmodules/colors.py index c9a3cbc..1297361 100755 --- a/cusmodules/colors.py +++ b/cusmodules/colors.py @@ -22,7 +22,11 @@ import wallpaper from pathlib import Path from random import randint from subprocess import run -import openrazer.client + +try: + import openrazer.client +except: + print("Openrazer not installed") def random(colors): colorcount = len(colors) - 1 @@ -52,6 +56,7 @@ 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/.venv/bin/qtile', 'shell', '-c', 'hide_show_bar()']) run([f'{home}/git/qtile/.venv/bin/qtile', 'shell', '-c', 'reload_config()']) run([f'{home}/.local/bin/pywalfox', 'update']) diff --git a/cusmodules/wallpaper.py b/cusmodules/wallpaper.py index 711c507..77e1ff4 100755 --- a/cusmodules/wallpaper.py +++ b/cusmodules/wallpaper.py @@ -17,9 +17,13 @@ import os import sys import json -import toml import signal -import openrazer.client + +try: + import openrazer.client +except: + print("Openrazer not installed") + from PIL import Image from pathlib import Path from random import randint @@ -64,7 +68,8 @@ def pywal(wall, loc): global home if wall == 'archstylized.png': - nitro(wall, loc) + #nitro(wall, loc) + feh(wall, loc) os.system(f'wal --theme {home}/.config/qtile/colors/defaultcolors.json') @@ -80,6 +85,10 @@ def nitro(wall, loc): global home os.system(f'nitrogen --set-scaled {loc}/{wall}') +def feh(wall, loc): + global home + run(['feh', '--bg-fill', f'{loc}/{wall}']) + def random(walls): wallcount = len(walls) - 1 ranint = randint(0, wallcount) @@ -123,7 +132,8 @@ if __name__ == '__main__': walls = random(wallpapers) - nitro(walls, curr_dir) + #nitro(walls, curr_dir) + feh(walls, curr_dir) colors.setColor(home, f'{home}/.config/qtile/colors', 'halloweencolors.json', norestart = True) @@ -138,7 +148,7 @@ if __name__ == '__main__': walls = random(wallpapers) - nitro(walls, curr_dir) + feh(walls, curr_dir) colors.setColor(home, f'{home}/.config/qtile/colors', 'xmascolors.json', norestart = True) @@ -176,6 +186,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/.venv/bin/qtile', 'shell', '-c', 'hide_show_bar()']) run([f'{home}/git/qtile/.venv/bin/qtile', 'shell', '-c', 'reload_config()']) except: @@ -185,7 +196,8 @@ if __name__ == '__main__': curr_dir = sys.argv[1] + 'wallpapers' wallpapers = os.popen(f'ls {home}/Pictures/Wallpapers/{curr_dir}').read().strip('\n').split('\n') - nitro(random(wallpapers), curr_dir) + #nitro(random(wallpapers), curr_dir) + feh(random(wallpapers), curr_dir) sys.exit(0) @@ -253,6 +265,11 @@ if __name__ == '__main__': nitro(wallargs[0], curr_dir) sys.exit(0) + elif ':feh' in wallargs: + #nitro(wallargs[0], curr_dir) + feh(wallargs[0], curr_dir) + sys.exit(0) + elif preset(wallargs[0], 'find') and ':auto' not in wallargs: os.system(f'wal --theme {home}/Pictures/Wallpapers/presets/{preset(wallargs[0], "set")}') @@ -277,6 +294,7 @@ 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/.venv/bin/qtile', 'shell', '-c', 'hide_show_bar()']) 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)) |
