Various wayland fixes, ghostty, updates etcetera.

This commit is contained in:
Kevin Alberts 2025-07-25 12:36:49 +02:00
parent 5501824875
commit 737800806d
5 changed files with 25 additions and 14 deletions

View file

@ -25,7 +25,7 @@
# SOFTWARE.
from libqtile.config import Key, Screen, Group, Drag, Click
from libqtile.command import lazy
from libqtile.lazy import lazy
from libqtile import layout, bar, widget

View file

@ -1,5 +1,5 @@
from libqtile import layout as libqtile_layout, layout, bar, widget
from libqtile.command import lazy
from libqtile.lazy import lazy
from libqtile.config import Key, Group, Screen, Drag, Click, Match
# Initialize logging

View file

@ -19,8 +19,7 @@ class Config(BaseConfig):
cmd_brightness_down = "sudo /usr/bin/xbacklight -dec 10"
cmd_screenshot = "/home/kevin/bin/screenshot.sh"
cmd_alt_screenshot = "/home/kevin/bin/screenshot.sh"
app_terminal = "terminator"
app_terminal = "ghostty"
web_browser = "firefox"
file_manager = "thunar"
app_launcher = "wofi --show drun,run"
@ -30,7 +29,7 @@ class Config(BaseConfig):
# Autostart applications
apps_autostart_group = [
{'group': "", 'command': ["firefox"]},
{'group': "", 'command': ["terminator"]},
{'group': "", 'command': ["ghostty", "--gtk-single-instance=true", "--quit-after-last-window-close=false", "--initial-window=true"]},
{'group': "", 'command': ["/usr/bin/rambox"]},
{'group': "", 'command': ["thunar"]},
{'group': "", 'command': ["thunderbird"]},

View file

@ -15,7 +15,7 @@ from libqtile.log_utils import logger
logger.warning("Importing qtile theme requirements...")
from libqtile.config import Key, Screen, Group, Drag, Click, Match
from libqtile.command import lazy
from libqtile.lazy import lazy
from libqtile import layout, bar, widget, qtile
from qtile_extras import widget as extra_widget
@ -214,7 +214,7 @@ class Kuro(BaseTheme):
##
# Debug keyboard shortcuts
##
Key([self.mod, "control"], "w", lazy.function(display_wm_class)),
Key([self.mod, "shift", "control"], "w", lazy.function(display_wm_class)),
# Show extensive window info
Key([self.mod, "shift", "control"], "i", lazy.function(self.show_window_info)),
@ -594,7 +594,7 @@ class Kuro(BaseTheme):
logger.warning("Restoring wallpaper...")
if 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
@ -622,6 +622,9 @@ class Kuro(BaseTheme):
# Update color scheme
self.update_colorscheme()
# Setup XDG Desktop Portal
self.setup_xdg_desktop_portal()
# After first startup is complete, autostart configured apps
logger.warning("Autostarting apps...")
for app in Config.get("apps_autostart", []):
@ -745,7 +748,7 @@ class Kuro(BaseTheme):
def update_colorscheme(self, *args, **kwargs):
if self.current_wallpaper:
logger.warning(f"Updating wal colors for wallpaper {self.current_wallpaper}")
p = utils.execute(["wal", "-n", "-i", "{}".format(self.current_wallpaper)])
p = utils.execute_once(["wallust", "run", "{}".format(self.current_wallpaper)])
p.wait()
colors = None
@ -843,3 +846,12 @@ class Kuro(BaseTheme):
utils.notify(qtile,
"Updated colorscheme!",
f"active: {colors['color15']}, inactive: {colors['color1']}")
def setup_xdg_desktop_portal(self):
# XDG Desktop portal is used for screensharing, screenshots and filepickers in wayland.
# To work correctly, it needs to have two env variables set in the systemd user session
logger.warning(f"Setting XDG_CURRENT_DESKTOP env and updating XDG Desktop Portal configuration...")
os.environ["XDG_CURRENT_DESKTOP"] = "qtile"
subprocess.Popen(["systemctl", "--user", "import-environment", "WAYLAND_DISPLAY", "XDG_CURRENT_DESKTOP"])
subprocess.Popen(["dbus-update-activation-environment", "--systemd", "WAYLAND_DISPLAY", "XDG_CURRENT_DESKTOP=qtile"])
subprocess.Popen(["systemctl", "--user", "restart", "xdg-desktop-portal"])

View file

@ -201,18 +201,18 @@ class DualPaneTextboxBase(base._Widget):
self.changed = False
@expose_command()
def set_font(self, font=base.UNSPECIFIED, fontsize_left=base.UNSPECIFIED, fontsize_right=base.UNSPECIFIED, fontshadow=base.UNSPECIFIED):
def set_font(self, font=None, fontsize_left=0, fontsize_right=0, fontshadow=""):
"""
Change the font used by this widget. If font is None, the current
font is used.
"""
if font is not base.UNSPECIFIED:
if font is not None:
self.font = font
if fontsize_left is not base.UNSPECIFIED:
if fontsize_left != 0:
self.fontsize_left = fontsize_left
if fontsize_right is not base.UNSPECIFIED:
if fontsize_right != 0:
self.fontsize_right = fontsize_right
if fontshadow is not base.UNSPECIFIED:
if fontshadow != "":
self.fontshadow = fontshadow
self.bar.draw()