From 322ef70db43ceb6bdf8de7b67a6c74ff96a8745b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sun, 2 Jul 2023 16:50:25 +0100 Subject: [PATCH] Misc xfce, bspwm and sxhkd update to use them again --- flake.nix | 83 ++++++++++++++++------------ home/desktop/bspwm.nix | 11 +++- home/desktop/config/bspwm/startup.sh | 1 - home/desktop/scripts/powermenu | 4 +- home/desktop/sxhkd.nix | 11 +--- home/desktop/xfce.nix | 11 +--- 6 files changed, 65 insertions(+), 56 deletions(-) diff --git a/flake.nix b/flake.nix index 546e922d..8f9a89c6 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,47 @@ }; }; }; + xfce-config = {pkgs, ...}: { + }; + xfce-bspwm-config = {pkgs, ...}: { + environment.systemPackages = with pkgs; [ + nitrogen + power-profiles-daemon + xfce.thunar + flameshot + polybar + ranger + ]; + services.xserver = { + enable = true; + layout = "gb"; + xkbVariant = ""; + desktopManager = { + xterm.enable = false; + xfce = { + enable = true; + enableXfwm = false; + noDesktop = true; + }; + }; + windowManager.bspwm.enable = true; + displayManager = { + sddm = { + enable = true; + # theme = "catppuccin-macchiato"; + settings = {General = {InputMethod = "";};}; + }; + defaultSession = "xfce+bspwm"; + sessionCommands = '' + ${pkgs.nitrogen}/bin/nitrogen --set-auto ${wallpapers.outputs.default} + ''; + }; + }; + programs.i3lock = { + enable = true; + package = pkgs.i3lock-fancy; + }; + }; hyprland-config = {pkgs, ...}: { imports = [hyprland.nixosModules.default]; environment.systemPackages = with pkgs; [ @@ -171,52 +212,26 @@ pkgs = import nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; - overlays = [waybar-experimental-overlay neovim-nightly-overlay.overlay]; + overlays = [neovim-nightly-overlay.overlay]; }; modules = [ home-config - hyprland-config + xfce-bspwm-config ./hosts/Ronin ./services/syncthing/Ronin.nix - ({pkgs, ...}: let - laptop-state = pkgs.writeShellScriptBin "check-laptop-lid-state" '' - grep closed /proc/acpi/button/lid/LID0/state &&\ - hyprctl dispatch dpms off eDP-1 ||\ - hyprctl dispatch dpms on - ''; - in { + ({pkgs, ...}: { home-manager.users.elitherl = { - imports = [hyprland-home-config ./home/work.nix]; + imports = [ + ./home/work.nix + ./home/desktop/bspwm.nix + ./home/gui + ]; home = { username = "elitherl"; homeDirectory = "/home/elitherl"; stateVersion = "22.11"; - packages = [laptop-state]; }; programs.neovim.package = pkgs.neovim-nightly; - wayland.windowManager.hyprland.extraConfig = '' - source=./common.conf - monitor = eDP-1,1920x1080,0,1.0 - monitor = DP-3,1920x1200,1920x0,1.0 - monitor = DP-4,1920x1080,3840x0,1.0,transform,1 - - windowrule = workspace name:chat, teams-for-linux - windowrule = workspace name:remote, Nxplayer.* - bind = ALT, R, moveworkspacetomonitor, name:remote current - bind = ALT, R, workspace, name:remote - bind = ALT SHIFT, R, moveworkspacetomonitor, name:remote current - bind = ALT SHIFT, R, movetoworkspace, name:remote - bindl=,switch:Lid Switch,exec,check-laptop-lid-state - ''; - programs.waybar.settings = { - main = { - "output" = "!DP-4"; - "wlr/workspaces" = { - "format-icons"."remote" = "󰢹"; - "persistent_workspaces"."remote" = []; - }; - }; - }; }; }) ]; diff --git a/home/desktop/bspwm.nix b/home/desktop/bspwm.nix index 0ea97fa1..e3e00e7a 100644 --- a/home/desktop/bspwm.nix +++ b/home/desktop/bspwm.nix @@ -1,4 +1,8 @@ {pkgs, ...}: { + imports = [ + ./xfce.nix + ./sxhkd.nix + ]; home.packages = with pkgs; [ nitrogen polybar @@ -36,6 +40,11 @@ "Bitwarden".desktop = "^7"; "Nxplayer.bin".desktop = "^8"; }; - extraConfig = builtins.readFile ./config/bspwm/startup.sh; + extraConfig = '' + polybar-msg cmd quit + echo "---" | tee -a /tmp/polybar.log + polybar 2>&1 | tee -a /tmp/polybar.log & disown + echo "Bars launched..." + ''; }; } diff --git a/home/desktop/config/bspwm/startup.sh b/home/desktop/config/bspwm/startup.sh index f73e0146..42e9b94f 100755 --- a/home/desktop/config/bspwm/startup.sh +++ b/home/desktop/config/bspwm/startup.sh @@ -1,4 +1,3 @@ -nitrogen --restore polybar-msg cmd quit echo "---" | tee -a /tmp/polybar.log polybar 2>&1 | tee -a /tmp/polybar.log & disown diff --git a/home/desktop/scripts/powermenu b/home/desktop/scripts/powermenu index 4720dfc0..325b0ad7 100644 --- a/home/desktop/scripts/powermenu +++ b/home/desktop/scripts/powermenu @@ -117,8 +117,8 @@ menu=( [ Reboot]="systemctl reboot" [ Suspend]="systemctl suspend" [ Hibernate]="systemctl hibernate" -[ Lock]="hyprctl dispatch exec swaylock" -[ Logout]="hyprctl dispatch exit" +[ Lock]="xfce4-screensaver-command --lock" +[ Logout]="" [ Cancel]="" ) diff --git a/home/desktop/sxhkd.nix b/home/desktop/sxhkd.nix index 86a8bac4..d9ceee98 100644 --- a/home/desktop/sxhkd.nix +++ b/home/desktop/sxhkd.nix @@ -3,7 +3,7 @@ enable = true; keybindings = { # Terminal emulators - "super + Return" = "kitty"; + "super + Return" = "wezterm"; "super + shift + Return" = "xfce4-terminal --drop-down"; # Launcher @@ -16,10 +16,6 @@ "super + m" = "bspc desktop -l next"; "super + g" = "bspc node -s biggest"; - # Custom scripts - "super + p" = "powermenu"; - "super + e" = "power-profiles"; - # State/Flags "super + {t,shift + t,s,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}"; @@ -44,9 +40,8 @@ # Shortcuts "super + w" = "firefox"; - "super + shift + f" = "thunar"; - "super + f" = "kitty -e ranger"; - "super + n" = "thunar"; + "super + e" = "thunar"; + "super + p" = "i3lock"; # Volume control keys "XF86AudioMute" = "pamixer -t"; diff --git a/home/desktop/xfce.nix b/home/desktop/xfce.nix index 2c165700..0b13f72b 100644 --- a/home/desktop/xfce.nix +++ b/home/desktop/xfce.nix @@ -1,19 +1,10 @@ -{pkgs, ...}: { +{...}: { imports = [ ./gtk.nix - ./bspwm.nix - ./sxhkd.nix ./picom.nix ./rofi.nix ./polybar.nix ]; - home.packages = with pkgs; [ - xfce.thunar - ranger - flameshot - power-profiles-daemon - i3lock-fancy - ]; xfconf.settings = { xfce4-session = { "general/LockCommand" = "i3lock-fancy";