From b8afc4076958910803ef2be7e6ece4ae84343738 Mon Sep 17 00:00:00 2001 From: Kabbone Date: Sun, 22 Jan 2023 15:38:44 +0100 Subject: [PATCH] desktop: some sway/waybar/kanshi output/autostart work --- modules/desktop/sway/home.nix | 42 +++++++++++++++++++++++------------ modules/programs/waybar.nix | 2 +- modules/services/kanshi.nix | 12 +++++----- 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/modules/desktop/sway/home.nix b/modules/desktop/sway/home.nix index 969361d..0fac8d9 100644 --- a/modules/desktop/sway/home.nix +++ b/modules/desktop/sway/home.nix @@ -26,6 +26,7 @@ right = "i"; modifier = "Mod4"; floating.modifier = "Mod4"; + floating.titlebar = true; input = { "type:keyboard" = { @@ -63,7 +64,7 @@ # scale = "1.3"; #}; }; - + terminal = "${pkgs.alacritty}/bin/alacritty"; fonts = { @@ -86,28 +87,33 @@ { command = "gsettings set org.gnome.desktop.interface icon-theme ePapirus"; } { command = "gsettings set org.gnome.desktop.interface cursor-theme Adwaita"; } #{ command = "exec ${pkgs.networkmanagerapplet}/bin/nm-applet --indicator"; } - #{ command = "${pkgs.thunderbird}/bin/thunderbird"; } - #{ command = "${pkgs.firefox}/bin/firefox"; } - #{ command = "${pkgs.element}/bin/element-desktop"; } + { command = "${pkgs.thunderbird}/bin/thunderbird"; } + { command = "${pkgs.firefox}/bin/firefox"; } + { command = "${pkgs.element}/bin/element-desktop"; } ]; workspaceAutoBackAndForth = true; gaps.inner = 8; gaps.outer = 4; + gaps.smartGaps = true; + gaps.smartBorders = "on"; - #assigns = { - # "3: web" = [{ class = "$Firefox$"; }]; - # "2: mail" = [{ class = "$Thunderbird$"; }]; - # "4: im" = [{ class = "^Element$"; }]; - #}; + assigns = { + "workspace number 1" = [{ app_id = "thunderbird"; }]; + "workspace number 2" = [{ app_id = "firefox"; }]; + "workspace number 3" = [{ class = "Element"; }]; + }; window.commands = [ - { command = "floating enable"; criteria = { class = "Pavucontrol"; }; } - { command = "floating enable"; criteria = { class = "Galculator"; }; } - { command = "floating enable"; criteria = { class = "Nitrokey App"; }; } - { command = "floating enable"; criteria = { class = "Yubico Authenticator"; }; } - { command = "floating enable"; criteria = { window_role = "pop-up"; }; } + { command = "floating enable"; criteria = { app_id = ".yubioath-flutter-wrapped"; }; } + { command = "floating enable"; criteria = { app_id = "pavucontrol"; }; } + { command = "floating enable"; criteria = { app_id = "galculator"; }; } + { command = "floating enable"; criteria = { app_id = "com.nitrokey."; }; } + { command = "floating enable"; criteria = { app_id = "org.keepassxc.KeePassXC."; }; } + { command = "floating enable"; criteria = { app_id = "virt-manager"; }; } + { command = "floating enable"; criteria = { class = "lxqt-openssh-askpass"; }; } + { command = "floating enable"; criteria = { class = "pop-up"; }; } ]; bars = [ @@ -237,6 +243,14 @@ #export WLR_NO_HARDWARE_CURSORS="1"; # For cursor in VM ''; + extraConfig = '' + set $output-primary HDMI-A-1 + set $output-secondary DP-1 + + workspace 1 output $output-secondary + workspace 2 output $output-primary + workspace 3 output $output-secondary + ''; }; programs.swaylock.settings = { diff --git a/modules/programs/waybar.nix b/modules/programs/waybar.nix index 000dca1..825f8b9 100644 --- a/modules/programs/waybar.nix +++ b/modules/programs/waybar.nix @@ -221,7 +221,7 @@ "thermal-zone" = 2; "hwmon-path" = "/sys/class/hwmon/hwmon3/temp1_input"; "format" = "{temperatureC}°C {icon}"; - "format-icons" = ["" "" "" "" ""]; + "format-icons" = ["❄" "❄" "" "" ""]; }; backlight = { "format" = "{percent}% {icon}"; diff --git a/modules/services/kanshi.nix b/modules/services/kanshi.nix index 483a42a..7f67e85 100644 --- a/modules/services/kanshi.nix +++ b/modules/services/kanshi.nix @@ -10,20 +10,20 @@ profiles = { undocked = { outputs = [ - { criteria = "eDP-1"; status = "enable"; } + { criteria = "eDP-1"; status = "enable"; mode = "1920x1080"; position = "0,0"; } ]; }; docked_c = { outputs = [ - { criteria = "eDP-1"; status = "enable"; } - { criteria = "DP-1"; status = "enable"; } + { criteria = "eDP-1"; status = "enable"; mode = "1920x1080"; position = "2560,0"; } + { criteria = "HDMI-A-1"; status = "enable"; mode = "2560x1080"; position = "0,0"; } ]; }; docked_triple = { outputs = [ - { criteria = "eDP-1"; status = "enable"; } - { criteria = "DP-1"; status = "enable"; } - { criteria = "HDMI-A-1"; status = "enable"; } + { criteria = "eDP-1"; status = "disable"; mode = "1920x1080"; position = "4480,0"; } + { criteria = "DP-1"; status = "enable"; mode = "1920x1080"; position = "0,0"; } + { criteria = "HDMI-A-1"; status = "enable"; mode = "2560x1080"; position = "1920,0"; } ]; }; };