diff --git a/users/profiles/sway/default.nix b/users/profiles/sway/default.nix index 2470275..3b3e228 100644 --- a/users/profiles/sway/default.nix +++ b/users/profiles/sway/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { home.packages = with pkgs; [ wl-clipboard ]; wayland = { @@ -6,75 +6,53 @@ let modifier = "Mod4"; in - { - enable = true; - wrapperFeatures.gtk = true; - config = { - modifier = modifier; - menu = "${pkgs.bemenu}/bin/bemenu-run -b -m 1 -p 'λ'"; - output = { - HDMI-A-2 = { - #bg = "~/dotfiles/dotfiles/xorg/wallpaper.jpg fill"; - }; - }; - #fonts = [ "Font Awesome" "Fira Code" ]; - terminal = "${pkgs.foot}/bin/footclient"; - bars = [ - { - command = "${pkgs.waybar}/bin/waybar"; - } - ]; - - startup = let - gsettings = "${pkgs.glib}/bin/gsettings"; - gsettingsscript = pkgs.writeShellScript "gsettings-auto.sh" '' - expression="" - for pair in "$@"; do - IFS=:; set -- $pair - expressions="$expressions -e 's:^$2=(.*)$:${gsettings} set org.gnome.desktop.interface $1 \1:e'" - done - IFS= - echo "" >/tmp/gsettings.log - echo exec sed -E $expressions "''${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini &>>/tmp/gsettings.log - eval exec sed -E $expressions "''${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini &>>/tmp/gsettings.log - ''; - gsettingscmd = ''${gsettingsscript} \ - gtk-theme:gtk-theme-name \ - icon-theme:gtk-icon-theme-name \ - font-name:gtk-font-name \ - cursor-theme:gtk-cursor-theme-name''; - in - [ - { - command = "foot --server"; - always = true; - } - - #{ always = true; command = "${gsettingscmd}"; } - ]; - window.commands = [ - { criteria = { app_id = "mpv"; }; command = "sticky enable"; } - { criteria = { app_id = "mpv"; }; command = "floating enable"; } - { criteria = { title = "MetaMask Notification.*"; }; command = "floating enable"; } - ]; - input = { - "*" = { - xkb_layout = "us"; - xkb_variant = "intl"; - }; - }; - keybindings = { - "${modifier}+f" = "exec firefox"; - "${modifier}+e" = "exec emacs"; + { + enable = true; + wrapperFeatures.gtk = true; + config = { + modifier = modifier; + menu = "${pkgs.bemenu}/bin/bemenu-run -b -m 1 -p 'λ'"; + output = { + HDMI-A-2 = { + bg = "${./wallpaper.jpg} fill"; }; }; - extraConfig = '' - bindsym ${modifier}+p move workspace to output right - #seat seat0 xcursor_theme "Adwaita" - ''; - xwayland = true; - systemdIntegration = true; + #fonts = [ "Font Awesome" "Fira Code" ]; + terminal = "${pkgs.foot}/bin/footclient"; + bars = [ + { + command = "${pkgs.waybar}/bin/waybar"; + } + ]; + + startup = [ + { + command = "foot --server"; + always = true; + } + ]; + floating.criteria = [ + { title = "MetaMask Notification.*"; } + { title = "Volume Control"; } # pavucontrol + ]; + input = { + "*" = { + xkb_layout = "us"; + xkb_variant = "intl"; + }; + }; + keybindings = lib.mkOptionDefault { + "${modifier}+x" = "exec ${pkgs.customEmacs}/bin/emacs"; + "${modifier}+b" = "exec ${pkgs.firefox}/bin/firefox"; + }; }; + extraConfig = '' + bindsym ${modifier}+p move workspace to output right + #seat seat0 xcursor_theme "Adwaita" + ''; + xwayland = true; + systemdIntegration = true; + }; }; programs.waybar = { @@ -84,13 +62,13 @@ { layer = "top"; position = "top"; - #output = [ "HDMI-A-2" ]; + height = 30; modules-left = [ "sway/mode" "sway/workspaces" ]; - modules-center = []; + modules-center = [ "sway/window" ]; modules-right = [ "idle_inhibitor" "tray" @@ -111,13 +89,7 @@ "sway/mode" = { tooltip = false; }; - idle_inhibitor = { - format = "{icon}"; - format-icons = { - activated = "unlocked"; - deactivated = "locking"; - }; - }; + "sway/window" = { max_length = 50; }; pulseaudio = { format = "vol {volume}%"; diff --git a/users/profiles/sway/wallpaper.jpg b/users/profiles/sway/wallpaper.jpg new file mode 100644 index 0000000..d18810f Binary files /dev/null and b/users/profiles/sway/wallpaper.jpg differ