From c95c4a7d0cac4d9a5017f1dc5a0eaf77b8dfc7f0 Mon Sep 17 00:00:00 2001 From: Michael Kantor Date: Sun, 15 Feb 2026 20:47:06 -0500 Subject: Switched to pulse widget. Added exception for openrazer import. Updated mic script. --- cusmodules/wallpaper.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'cusmodules/wallpaper.py') 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)) -- cgit v1.2.1