Remove special widget control for qtile

This commit is contained in:
SebastianStork 2024-04-16 22:18:23 +02:00
parent 4b650721b0
commit cbebff390c
3 changed files with 8 additions and 47 deletions

View file

@ -1,4 +1,4 @@
{lib, ...}: { {
imports = [ imports = [
./qtile.nix ./qtile.nix
./hyprland ./hyprland
@ -9,16 +9,4 @@
./waybar.nix ./waybar.nix
./hypridlelock.nix ./hypridlelock.nix
]; ];
options.myConfig.de = {
widget = {
backlight = {
enable = lib.mkEnableOption "";
device = lib.mkOption {
type = lib.types.str;
};
};
battery.enable = lib.mkEnableOption "";
};
};
} }

View file

@ -36,29 +36,7 @@ in {
services.dunst.enable = true; services.dunst.enable = true;
xdg.configFile."qtile/config.py".text = let xdg.configFile."qtile/config.py".text = ''
backlightKeys =
if cfg.widget.backlight.enable
then ''
Key([], "XF86MonBrightnessUp", lazy.spawn("brillo -q -s ${cfg.widget.backlight.device} -u 50000 -A 4"), desc="Raise brightness"),
Key([], "XF86MonBrightnessDown", lazy.spawn("brillo -q -s ${cfg.widget.backlight.device} -u 50000 -U 4"), desc="Lower brightness"),
''
else "";
backlightWidget =
if cfg.widget.backlight.enable
then ''
widget.Sep(),
widget.Backlight(fmt="󰃠 {}", backlight_name='${cfg.widget.backlight.device}'),
''
else "";
batteryWidget =
if cfg.widget.battery.enable
then ''
widget.Sep(),
widget.Battery(format="󰁹 {percent:2.0%}"),
''
else "";
in ''
import os import os
import subprocess import subprocess
@ -107,7 +85,8 @@ in {
Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), desc="Raise volume"), Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), desc="Raise volume"),
# Brightness controls # Brightness controls
${backlightKeys} Key([], "XF86MonBrightnessUp", lazy.spawn("brillo -q -u 50000 -A 4"), desc="Raise brightness"),
Key([], "XF86MonBrightnessDown", lazy.spawn("brillo -q -u 50000 -U 4"), desc="Lower brightness"),
# Move window focus # Move window focus
Key([mod], left, lazy.layout.left(), desc="Move focus to left"), Key([mod], left, lazy.layout.left(), desc="Move focus to left"),
@ -183,8 +162,10 @@ in {
]), ]),
widget.Sep(), widget.Sep(),
widget.PulseVolume(fmt="󰕾 {}"), widget.PulseVolume(fmt="󰕾 {}"),
${backlightWidget} widget.Sep(),
${batteryWidget} widget.Backlight(fmt="󰃠 {}", backlight_name='amdgpu_bl1'),
widget.Sep(),
widget.Battery(format="󰁹 {percent:2.0%}"),
], ],
26, 26,
), ),

View file

@ -2,14 +2,6 @@
imports = [./default.nix]; imports = [./default.nix];
home-manager.users.seb = { home-manager.users.seb = {
myConfig.de.widget = {
backlight = {
enable = true;
device = "amdgpu_bl1";
};
battery.enable = true;
};
wayland.windowManager.hyprland.settings.monitor = "eDP-1,1920x1080@60,0x0,1"; wayland.windowManager.hyprland.settings.monitor = "eDP-1,1920x1080@60,0x0,1";
services.hypridle = { services.hypridle = {