General updates and fixes, ghostty terminal emulator, wallust colors, different wallpaper set at night

This commit is contained in:
Kevin Alberts 2025-07-21 00:54:30 +02:00
parent 1e65025045
commit 12238c2b6c
5 changed files with 46 additions and 23 deletions

View file

@ -1,6 +1,7 @@
import json
import os
import random
import datetime
# Initialize logging
from libqtile.log_utils import logger
@ -8,7 +9,8 @@ from libqtile.log_utils import logger
logger.error("Importing qtile theme requirements...")
from libqtile.config import Key, Screen, Group, Drag, Click, Match
from libqtile.command import lazy
from libqtile.command.base import expose_command
from libqtile.lazy import lazy
from libqtile import layout, bar, widget, qtile
logger.error("Importing theme util functions...")
@ -248,7 +250,7 @@ class Kuro(BaseTheme):
# http://fontawesome.io/cheatsheet
groups.append(Group("", spawn=Config.get('web_browser', "true")))
groups.append(Group("", spawn=Config.get('app_terminal', "true")))
groups.append(Group("", spawn=Config.get('app_terminal_init', "true")))
groups.append(Group(""))
groups.append(Group("", spawn=Config.get('app_chat', "true")))
groups.append(Group("", spawn=Config.get('app_irc', "true")))
@ -612,7 +614,8 @@ class Kuro(BaseTheme):
qtile.theme_instance = self
if self.current_wallpaper:
p = utils.execute_once(["wal", "-n", "-i", "{}".format(self.current_wallpaper)])
#p = utils.execute_once(["wal", "-n", "-i", "{}".format(self.current_wallpaper)])
p = utils.execute_once(["wallust", "run", "{}".format(self.current_wallpaper)])
p.wait()
else:
wallpaper = None
@ -640,8 +643,8 @@ class Kuro(BaseTheme):
self.log_info("Starting xiccd color profile manager...")
utils.execute_once("xiccd")
self.log_info("Starting KDE connect daemon...")
utils.execute_once("/usr/lib/kdeconnectd")
#self.log_info("Starting KDE connect daemon...")
#utils.execute_once("/usr/lib/kdeconnectd")
self.log_info("Starting KDE connect indicator...")
utils.execute_once("/usr/bin/kdeconnect-indicator")
@ -784,16 +787,26 @@ class Kuro(BaseTheme):
def update_wallpaper(qtile):
wallpapers = []
wallpaper_dir = Config.get("desktop_bg_folder", "")
# Use a wallpaper from the night folder after 9PM and before 6AM
wallpaper_night_dir = Config.get("desktop_bg_night_folder", "")
if wallpaper_night_dir and os.path.isdir(wallpaper_night_dir):
cur_time = datetime.datetime.now()
if cur_time.hour > 21 or cur_time.hour < 6:
wallpaper_dir = wallpaper_night_dir
try:
wallpapers = [x for x in os.listdir(wallpaper_dir) if ".vertical." not in x]
except os.error as e:
logger.warning("Could not load wallpapers from directory: {}".format(e))
if wallpapers:
if Config.get("desktop_bg_override", False):
qtile.theme_instance.current_wallpaper = Config.get("desktop_bg_override", "")
else:
qtile.theme_instance.current_wallpaper = os.path.join(wallpaper_dir, random.choice(wallpapers))
logger.warning("Selected new wallpaper: {}".format(qtile.theme_instance.current_wallpaper))
Kuro.set_wallpaper(qtile, qtile.theme_instance.current_wallpaper)
else:
utils.execute_once("nitrogen --restore")
@ -838,7 +851,8 @@ class Kuro(BaseTheme):
:type qtile: libqtile.manager.Qtile
"""
if qtile.theme_instance.current_wallpaper:
p = utils.execute(["wal", "-n", "-i", "{}".format(qtile.theme_instance.current_wallpaper)])
#p = utils.execute(["wal", "-n", "-i", "{}".format(qtile.theme_instance.current_wallpaper)])
p = utils.execute(["wallust", "run", "{}".format(qtile.theme_instance.current_wallpaper)])
p.wait()
colors = None