From e9240076e21a27cab8deeafc964a933da3f07ede Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sun, 21 Apr 2024 21:53:06 +0200 Subject: [PATCH] Remove the qtile module --- modules/home/de/default.nix | 1 - modules/home/de/qtile.nix | 205 ------------------------------------ modules/system/de.nix | 83 ++++----------- users/seb/home.nix | 1 - 4 files changed, 20 insertions(+), 270 deletions(-) delete mode 100644 modules/home/de/qtile.nix diff --git a/modules/home/de/default.nix b/modules/home/de/default.nix index e6de3c3..6cb713e 100644 --- a/modules/home/de/default.nix +++ b/modules/home/de/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./qtile.nix ./hyprland ./theming.nix ./rofi diff --git a/modules/home/de/qtile.nix b/modules/home/de/qtile.nix deleted file mode 100644 index 983b029..0000000 --- a/modules/home/de/qtile.nix +++ /dev/null @@ -1,205 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - cfg = config.myConfig.de; -in { - options.myConfig.de.qtile.enable = lib.mkEnableOption ""; - - config = lib.mkIf cfg.qtile.enable { - home.packages = [ - # Widget dependencies - pkgs.python311Packages.iwlib - pkgs.python311Packages.psutil - pkgs.lm_sensors - - # Hotkey dependencies - pkgs.playerctl - ]; - - home.file.".background-image".source = cfg.wallpaper; - - xsession.enable = true; - - myConfig.de.rofi.enable = true; - services.clipmenu = { - enable = true; - launcher = "rofi"; - }; - - services.picom = { - enable = true; - vSync = true; - }; - - services.dunst.enable = true; - - xdg.configFile."qtile/config.py".text = '' - import os - import subprocess - - from libqtile import bar, layout, widget - from libqtile.config import Click, Drag, Group, Key, Match, Screen - from libqtile.lazy import lazy - from libqtile import hook - - # Constants - mod = "mod4" - terminal = "kitty" - browser = "brave" - editor = "notepadqq --new-window" - fileManager = "nemo" - - lightBlue = "#739BD0" - lightGrey = "#bcbcbc" - - left = "Left" - right = "Right" - down = "Down" - up = "Up" - - ### SHORTCUTS ### - keys = [ - # Essentials - Key([mod, "shift"], "c", lazy.window.kill(), desc="Kill focused window"), - Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"), - Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), - - # Launch programs - Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), - Key([mod], "r", lazy.spawn("rofi -show drun"), desc="Spawn a command using a prompt widget"), - Key([mod, "shift"], "r", lazy.spawn("rofi -show run"), desc="Spawn a command using a prompt widget"), - Key([mod], "b", lazy.spawn(browser), desc="launch browser"), - Key([mod], "n", lazy.spawn(editor), desc="launch notepadqq"), - Key([mod], "f", lazy.spawn(fileManager), desc="launch file manager"), - Key([mod], "c", lazy.spawn("codium"), desc="launch vscodium"), - Key([mod], "s", lazy.spawn("spotify"), desc="launch spotify"), - Key([mod], "v", lazy.spawn("clipmenu"), desc="launch clipmenu"), - - # Media controls - Key([], "XF86AudioPlay", lazy.spawn("playerctl --player=ncspot,spotify play-pause "), desc="Play and pause spotify"), - Key([], "XF86AudioMute", lazy.spawn("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), desc="Mute and unmute"), - Key([], "XF86AudioLowerVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), desc="Lower volume"), - Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), desc="Raise volume"), - - # Brightness controls - 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 - Key([mod], left, lazy.layout.left(), desc="Move focus to left"), - Key([mod], right, lazy.layout.right(), desc="Move focus to right"), - Key([mod], down, lazy.layout.down(), desc="Move focus down"), - Key([mod], up, lazy.layout.up(), desc="Move focus up"), - Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"), - - # Move windows - Key([mod, "shift"], left, lazy.layout.shuffle_left(), desc="Move window to the left"), - Key([mod, "shift"], right, lazy.layout.shuffle_right(), desc="Move window to the right"), - Key([mod, "shift"], down, lazy.layout.shuffle_down(), desc="Move window down"), - Key([mod, "shift"], up, lazy.layout.shuffle_up(), desc="Move window up"), - - # Size windows - Key([mod, "shift"], "n", lazy.layout.normalize(), desc="Reset all window sizes"), - Key([mod], "plus", lazy.layout.grow().when(layout=["monadtall", "monadwide"]), desc="Grow window"), - Key([mod], "minus", lazy.layout.shrink().when(layout=["monadtall", "monadwide"]), desc="Shrink window"), - - # Manage layouts - Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), - Key([mod, "shift"], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen on the focused window"), - Key([mod, "shift"], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"), - Key([mod, "shift"], "b", lazy.hide_show_bar(), desc="Toggle bar visibility"), - ] - - ### LAYOUTS ### - groups = [Group(i) for i in "123456789"] - - # Switching between layouts - for i in groups: - keys.extend( - [ - Key([mod], i.name, lazy.group[i.name].toscreen(), desc="Switch to group {}".format(i.name)), - Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=False), desc="Switch to & move focused window to group {}".format(i.name)), - ] - ) - - # Available layouts - layouts = [ - layout.MonadTall(border_focus=lightBlue, border_normal=lightGrey, border_width=2, margin=8, single_margin=0, single_border_width=0), - layout.Floating(), - ] - - # Drag floating layouts. - mouse = [ - Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), - Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), - Click([mod], "Button1", lazy.window.bring_to_front()), - ] - - ### WIDGETS ### - widget_defaults = dict( - font="sans, Symbols Nerd Font Mono", - fontsize=15, - padding=3, - ) - extension_defaults = widget_defaults.copy() - - # Display widgets on the bar - screens = [ - Screen( - top=bar.Bar( - [ - widget.Clock(format=" %H:%M"), - widget.Sep(), - widget.Clock(format="󰃮 %a. %d.%m.%y"), - widget.Spacer(), - widget.GroupBox(highlight_method="line", this_current_screen_border=lightBlue), - widget.Spacer(), - widget.WidgetBox(text_closed="", text_open="" , widgets=[ - widget.Systray() - ]), - widget.Sep(), - widget.PulseVolume(fmt="󰕾 {}"), - widget.Sep(), - widget.Backlight(fmt="󰃠 {}", backlight_name='amdgpu_bl1'), - widget.Sep(), - widget.Battery(format="󰁹 {percent:2.0%}"), - ], - 26, - ), - ), - ] - - ### RULES ### - dgroups_key_binder = None - dgroups_app_rules = [] # type: list - follow_mouse_focus = True - bring_front_click = False - floats_kept_above = True - cursor_warp = False - floating_layout = layout.Floating( - float_rules=[ - # Run the utility of `xprop` to see the wm class and name of an X client. - *layout.Floating.default_float_rules, - Match(wm_class="confirmreset"), # gitk - Match(wm_class="makebranch"), # gitk - Match(wm_class="maketag"), # gitk - Match(wm_class="ssh-askpass"), # ssh-askpass - Match(title="branchdialog"), # gitk - Match(title="pinentry"), # GPG key password entry - ] - ) - auto_fullscreen = True - focus_on_window_activation = "smart" - reconfigure_screens = True - - auto_minimize = True - - wl_input_rules = None - - wmname = "LG3D" - ''; - }; -} diff --git a/modules/system/de.nix b/modules/system/de.nix index 30c47d0..ae10158 100644 --- a/modules/system/de.nix +++ b/modules/system/de.nix @@ -4,68 +4,25 @@ pkgs, lib, ... -}: let - cfg = config.myConfig.de; -in { - options.myConfig.de = { - qtile.enable = lib.mkEnableOption ""; - hyprland.enable = lib.mkEnableOption ""; +}: { + options.myConfig.de.hyprland.enable = lib.mkEnableOption ""; + + config = lib.mkIf config.myConfig.de.hyprland.enable { + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + }; + + environment.sessionVariables = { + WLR_NO_HARDWARE_CURSORS = "1"; + NIXOS_OZONE_WL = "1"; + }; + + xdg.portal = { + enable = true; + extraPortals = [pkgs.xdg-desktop-portal-gtk]; + }; + + services.gvfs.enable = true; }; - - config = lib.mkMerge [ - (lib.mkIf cfg.qtile.enable { - services.xserver = { - enable = true; - - windowManager.qtile.enable = true; - desktopManager.wallpaper.mode = "fill"; - - xkb = { - layout = "de"; - variant = "nodeadkeys"; - }; - - libinput = { - enable = true; - - touchpad = { - accelProfile = "adaptive"; - naturalScrolling = true; - disableWhileTyping = true; - }; - - mouse = { - accelProfile = "flat"; - middleEmulation = false; - }; - }; - }; - - xdg.portal = { - enable = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - }; - - services.gvfs.enable = true; - }) - - (lib.mkIf cfg.hyprland.enable { - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.system}.hyprland; - }; - - environment.sessionVariables = { - WLR_NO_HARDWARE_CURSORS = "1"; - NIXOS_OZONE_WL = "1"; - }; - - xdg.portal = { - enable = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - }; - - services.gvfs.enable = true; - }) - ]; } diff --git a/users/seb/home.nix b/users/seb/home.nix index bb86792..f32b3d8 100644 --- a/users/seb/home.nix +++ b/users/seb/home.nix @@ -6,7 +6,6 @@ }: { myConfig = { de = { - qtile.enable = osConfig.myConfig.de.qtile.enable; hyprland.enable = osConfig.myConfig.de.hyprland.enable; wallpaper = ./wallpaper;