From 34e70c4b634cf8ca629e8620a4ac613232f8972e Mon Sep 17 00:00:00 2001 From: misumisumi Date: Thu, 26 Sep 2024 12:13:01 +0900 Subject: [PATCH] fix(qtile): fix bug of wallpaper and window rule --- apps/user/full/services/picom.nix | 3 ++- apps/user/full/wm/qtile/conf/my_modules/bar.py | 8 +++++--- apps/user/full/wm/qtile/conf/my_modules/keymap.py | 2 +- apps/user/full/wm/qtile/conf/my_modules/startup.py | 1 + apps/user/full/wm/qtile/conf/my_modules/variables.py | 1 + apps/user/full/wm/qtile/conf/my_modules/wallpaper.py | 6 ++++-- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/user/full/services/picom.nix b/apps/user/full/services/picom.nix index da70d067..24685aa9 100644 --- a/apps/user/full/services/picom.nix +++ b/apps/user/full/services/picom.nix @@ -19,13 +19,14 @@ inactiveOpacity = 0.75; opacityRules = [ "100:QTILE_BAR:32c = 1" + "100:class_g = 'Alacritty'" "100:class_g = 'Blender'" "100:class_g = 'Looking Glass (client)'" "100:class_g = 'PenTablet'" "100:class_g = 'Picture in picture'" "100:class_g = 'Unity'" - "100:class_g = 'Alacritty'" "100:class_g = 'kitty'" + "100:class_g = 'Zathura'" "100:class_g = 'org.wezfurlong.wezterm'" "100:class_g = 'pentablet'" "100:name = 'VRChat'" diff --git a/apps/user/full/wm/qtile/conf/my_modules/bar.py b/apps/user/full/wm/qtile/conf/my_modules/bar.py index 9636fcbf..65d24aed 100644 --- a/apps/user/full/wm/qtile/conf/my_modules/bar.py +++ b/apps/user/full/wm/qtile/conf/my_modules/bar.py @@ -215,13 +215,15 @@ def make_bar(under_fhd: bool = False, is_tray: bool = False, pentablet: bool = F top_widgets += spacer(length=20) top_widgets += lifeinfo() top_widgets += spacer() - top_widgets += spacer(length=5) - top_widgets += chord() - if not under_fhd: + if under_fhd: + top_widgets += spacer() top_widgets += spacer(length=10) + else: top_widgets += sysinfo() top_widgets += spacer(length=20) + top_widgets += chord() + top_widgets += spacer(length=10) top_widgets += sysctrl(is_tray) top_bar = bar.Bar( diff --git a/apps/user/full/wm/qtile/conf/my_modules/keymap.py b/apps/user/full/wm/qtile/conf/my_modules/keymap.py index afb75d73..b85205e5 100644 --- a/apps/user/full/wm/qtile/conf/my_modules/keymap.py +++ b/apps/user/full/wm/qtile/conf/my_modules/keymap.py @@ -107,7 +107,7 @@ def set_keys(): Key([GlobalConf.mod, "control", "shift"], "f", lazy.window.toggle_fullscreen()), # Exit and Reload Key([GlobalConf.mod, "control"], "r", lazy.reload_config(), desc="Reload the config"), - Key([GlobalConf.mod, "control"], "e", lazy.shutdown(), desc="Shutdown Qtile"), + Key([GlobalConf.mod, "control", "shift"], "q", lazy.shutdown(), desc="Shutdown Qtile"), # Launch rofi Key( [GlobalConf.mod], diff --git a/apps/user/full/wm/qtile/conf/my_modules/startup.py b/apps/user/full/wm/qtile/conf/my_modules/startup.py index 8f152dbc..59d8d670 100644 --- a/apps/user/full/wm/qtile/conf/my_modules/startup.py +++ b/apps/user/full/wm/qtile/conf/my_modules/startup.py @@ -34,3 +34,4 @@ def autostart(): @hook.subscribe.startup_complete def afterstart(): subprocess.run("systemctl --user restart blueman-applet.service", shell=True) + subprocess.run("systemctl --user restart flameshot.service", shell=True) diff --git a/apps/user/full/wm/qtile/conf/my_modules/variables.py b/apps/user/full/wm/qtile/conf/my_modules/variables.py index 0ef20d6f..eb92d58a 100644 --- a/apps/user/full/wm/qtile/conf/my_modules/variables.py +++ b/apps/user/full/wm/qtile/conf/my_modules/variables.py @@ -93,6 +93,7 @@ def __post_init__(self): def update_monitors(self): self.monitors = utils.get_n_monitors(self.has_pentablet) + self.monitors_w_pentablet = utils.get_n_monitors(False) PinPConf = PinPConfig() diff --git a/apps/user/full/wm/qtile/conf/my_modules/wallpaper.py b/apps/user/full/wm/qtile/conf/my_modules/wallpaper.py index c2d0c6e1..11adcaf3 100644 --- a/apps/user/full/wm/qtile/conf/my_modules/wallpaper.py +++ b/apps/user/full/wm/qtile/conf/my_modules/wallpaper.py @@ -10,7 +10,7 @@ MONITORS = {} cmd = "feh" -for i in range(GlobalConf.monitors): +for i in range(GlobalConf.monitors_w_pentablet): MONITORS[f"MONITOR{i}"] = 0 cmd += r" --bg-fill {}" @@ -29,6 +29,8 @@ def change_wallpaper(): gidx -= n_groups * idx MONITORS[f"MONITOR{idx}"] = gidx subprocess.run( - cmd.format(*[GlobalConf.wallpapers[MONITORS[f"MONITOR{i}"]] for i in range(GlobalConf.monitors)]), + cmd.format( + *[GlobalConf.wallpapers[MONITORS[f"MONITOR{i}"]] for i in range(GlobalConf.monitors_w_pentablet)] + ), shell=True, )