Fix qtile config: consolidate terminal variable and remove unused imports

This commit is contained in:
2026-08-12 15:46:19 +02:00
parent a569683ea0
commit c9424ffd09

View File

@@ -1,15 +1,12 @@
from libqtile import bar, extension, hook, layout, qtile, widget from libqtile import bar, hook, layout, qtile, widget
from libqtile.config import Click, Drag, Group, Key, KeyChord, Match, Screen from libqtile.config import Click, Drag, Group, Key, Match, Screen
from libqtile.lazy import lazy from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
import os import os
import subprocess import subprocess
mod = "mod4" mod = "mod4"
terminal = guess_terminal() terminal = "alacritty"
myTerm = "alacritty"
keys = [ keys = [
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
@@ -221,14 +218,14 @@ def make_top_bar(primary=False):
widget.CPU( widget.CPU(
foreground = colors[4], foreground = colors[4],
padding = 8, padding = 8,
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e btop')}, mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(terminal + ' -e btop')},
format="CPU: {load_percent}%", format="CPU: {load_percent}%",
), ),
make_sep(), make_sep(),
widget.Memory( widget.Memory(
foreground = colors[8], foreground = colors[8],
padding = 8, padding = 8,
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e btop')}, mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(terminal + ' -e btop')},
format = 'Mem: {MemUsed:.0f}{mm}', format = 'Mem: {MemUsed:.0f}{mm}',
), ),
make_sep(), make_sep(),