From 5cac4da126fb41f6bdfe37d697e5375f03d85233 Mon Sep 17 00:00:00 2001 From: Stefan Ellmauthaler Date: Tue, 16 Aug 2022 17:54:29 +0200 Subject: [PATCH] Fix tray, fix sound, add kanshi waybar feels buggy, TODO: check the config again --- modules/sway.nix | 7 ++++--- users/ellmau/default.nix | 2 ++ users/ellmau/kanshi.nix | 27 +++++++++++++++++++++++++++ users/ellmau/mako.nix | 2 ++ users/ellmau/sway.nix | 21 ++++++++++++++++++++- users/ellmau/waybar.nix | 36 +++++++++++++++++------------------- 6 files changed, 72 insertions(+), 23 deletions(-) create mode 100644 users/ellmau/kanshi.nix diff --git a/modules/sway.nix b/modules/sway.nix index 3f63b34..84f8f6c 100644 --- a/modules/sway.nix +++ b/modules/sway.nix @@ -55,7 +55,7 @@ with lib; { package = pkgs.greetd.tuigreet; settings = { default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway"; + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway; swaymsg exit"; }; }; }; @@ -68,8 +68,9 @@ with lib; { environment.systemPackages = with pkgs; [ gnome3.adwaita-icon-theme wl-clipboard + networkmanagerapplet + pavucontrol + pamixer ]; - - }; } diff --git a/users/ellmau/default.nix b/users/ellmau/default.nix index cc5b6b3..abe540a 100644 --- a/users/ellmau/default.nix +++ b/users/ellmau/default.nix @@ -6,6 +6,7 @@ ./git.nix ./gpg.nix ./i3.nix + ./kanshi.nix ./mako.nix ./nextcloud.nix # ./polybar.nix @@ -39,6 +40,7 @@ home.packages = with pkgs; [ # comma did not compile on 15.07.2022 comma + kanshi ]; programs = { diff --git a/users/ellmau/kanshi.nix b/users/ellmau/kanshi.nix new file mode 100644 index 0000000..8441fa3 --- /dev/null +++ b/users/ellmau/kanshi.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ...}: +{ + services.kanshi = { + enable = true; + profiles = { + work = { + outputs = [ + { + criteria = "Dell Inc. DELL U2720Q 1DNY123"; + position = "1920,0"; + } + { + criteria = "eDP-1"; + position = "5760,0"; + } + ]; + }; + unplugged = { + outputs = [ + { + criteria = "eDP-1"; + } + ]; + }; + }; + }; +} diff --git a/users/ellmau/mako.nix b/users/ellmau/mako.nix index a3d1c00..30d1a58 100644 --- a/users/ellmau/mako.nix +++ b/users/ellmau/mako.nix @@ -1,9 +1,11 @@ + { config, pkgs, ...}: { programs.mako = { enable = true; iconPath = "${pkgs.numix-icon-theme}"; font = "Hasklug Nerd Font 10"; + defaultTimeout = 50003; }; home.packages = [ pkgs.numix-icon-theme ]; diff --git a/users/ellmau/sway.nix b/users/ellmau/sway.nix index 44ca09c..c328939 100644 --- a/users/ellmau/sway.nix +++ b/users/ellmau/sway.nix @@ -2,6 +2,18 @@ { services = { blueman-applet.enable = true; + swayidle = { + enable = true; + events = [ + + { event = "before-sleep"; command = "swaylock -KfeFi ~/.background-image"; } + { event = "lock"; command = "swaylock -KfeFi ~/.background-image"; } + + ]; + timeouts = [ + { timeout = 60; command = "swaylock -KfeFi ~/.background-image"; } + ]; + }; }; home.file.".background-image".source = ../../common/wallpaper/nix-wallpaper-nineish-dark-gray.png; @@ -9,8 +21,9 @@ home.packages = [ pkgs.gnome-icon-theme + pkgs.swaylock ]; - + wayland.windowManager.sway = { enable = true; config = { @@ -62,7 +75,13 @@ bars = [ ]; }; extraConfig = '' + input "type:keyboard" { + xkb_layout us,de + xkb_variant euro,nodeadkeys + xkb_options grp:win_space_toggle + } set $mode_system System (l) lock, (CTRL+e) logout, (CTRL+r) reboot, (CTRL+s) shutdown + set $i3lockwall swaylock -KfeFi ~/.background-image mode "$mode_system" { bindsym l exec --no-startup-id $i3lockwall, mode "default" bindsym Ctrl+e exec --no-startup-id swaymsg exit, mode "default" diff --git a/users/ellmau/waybar.nix b/users/ellmau/waybar.nix index cb507cc..0f26ef8 100644 --- a/users/ellmau/waybar.nix +++ b/users/ellmau/waybar.nix @@ -7,7 +7,7 @@ mainBar = { modules-left = [ "sway/workspaces" "sway/mode" ]; modules-center = [ "sway/window" ]; - modules-right = [ "idle_inhibitor" "sway/language" "battery" "network#wg" "network" "clock" "tray" ]; + modules-right = [ "idle_inhibitor" "sway/language" "battery" "pulseaudio" "clock" "tray" ]; idle_inhibitor = { format = "{icon}"; @@ -27,24 +27,22 @@ format-alt = "{time} {icon}"; format-icons = [ "" "" "" "" "" ]; }; - network = { - format-wifi = "{essid} ({signalStrength}%) "; - format-ethernet = "{ipaddr}/{cidr} "; - tooltip-format = "{ifname} via {gwaddr} "; - format-linked = "{ifname} (No IP) "; - format-disconnected = "Disconnected ⚠"; - format-alt = "{ifname}: {ipaddr}/{cidr}"; - }; - - "network#wg" = { - interface = "wg-stelnet"; - format-wifi = "{essid} ({signalStrength}%) "; - format-ethernet = "{ipaddr}/{cidr} "; - tooltip-format = "{ifname} via {gwaddr} "; - format-linked = "{ifname} (No IP) "; - format-disconnected = "Disconnected ⚠"; - format-alt = "{ifname}: {ipaddr}/{cidr}"; - }; + + pulseaudio = { + format = "{icon} {volume:2}%"; + format-bluetooth = "{icon} {volume}%"; + format-muted = "MUTE"; + format-icons = { + headphones = ""; + default = [ + "" + "" + ]; + }; + scroll-step = 5; + on-click = "${pkgs.pamixer}/bin/pamixer -t"; + on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol &"; + }; }; }; };