diff --git a/home/default.nix b/home/default.nix index 3984002..86c6b26 100644 --- a/home/default.nix +++ b/home/default.nix @@ -30,7 +30,6 @@ user: ./pasystray.nix ./photography.nix ./picom.nix - ./polybar.nix ./programs.nix ./qt.nix ./redshift.nix @@ -39,10 +38,12 @@ user: ./rofi.nix ./rust.nix ./signal.nix + ./sway.nix ./telegram.nix ./thunderbird.nix ./tmux.nix ./tor.nix + ./waybar.nix ./xdg.nix ./zathura.nix ./zoom.nix diff --git a/home/gammastep.nix b/home/gammastep.nix new file mode 100644 index 0000000..61270b3 --- /dev/null +++ b/home/gammastep.nix @@ -0,0 +1,7 @@ +{ ... }: { + services.gammastep = { + enable = true; + longitude = "49.01315"; + latitude = "12.1119"; + }; +} diff --git a/home/i3.nix b/home/i3.nix index 92db656..95c92ca 100644 --- a/home/i3.nix +++ b/home/i3.nix @@ -27,6 +27,9 @@ let mode_system = "System: L :  | S :  | P :  | R :  | E : "; in { + imports = [ + ./polybar.nix + ]; home.packages = with pkgs; [ # i3lock dmenu diff --git a/home/sway.nix b/home/sway.nix new file mode 100644 index 0000000..c6fe1df --- /dev/null +++ b/home/sway.nix @@ -0,0 +1,153 @@ +{ lib, pkgs, ... }: +let + mod = "Mod4"; + ws1 = "1: www"; + ws2 = "2: >_"; + ws3 = "3: "; + ws4 = "4: IM"; + ws5 = "5: ./"; + ws6 = "6: doc"; + ws7 = "7: mail"; + ws8 = "8"; + ws9 = "9"; + ws10 = "10: media"; + + mode_system = "System: L :  | S :  | P :  | R :  | E : "; +in { + imports = [ + ./gammastep.nix + ]; + + home.packages = with pkgs; [ + slurp # screenshot selection + grim # screenshots + wl-clipboard # copy/paste + swaybg # background images + ]; + + # similar to i3-lock-fancy + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + settings = { + screenshots = true; + effect-blur = "7x5"; + clock = true; + indicator = true; + indicator-thickness = 7; + }; + }; + + wayland.windowManager.sway = { + enable = true; + swaynag.enable = true; + config = { + modifier = mod; + + workspaceAutoBackAndForth = true; + + fonts = { + names = [ "NotoSans-Regular" "FontAwesome" ]; + style = "Monospace"; + size = 12.0; + }; + +/* TODO: background + output = { + "*" = { + bg = "/home/me/media/Pictures/wallpapers/gargantua-black-3840x2160-11475.jpg fill"; + }; + }; + */ + + assigns = { + "${ws1}" = [ { app_id = "firefox"; } ]; + "${ws5}" = [ { app_id="thunar"; } ]; + "${ws7}" = [ { class="Thunderbird"; } ]; + }; + + floating = { + criteria = [ + { window_role = "pop-up"; } + { window_role = "task_dialog"; } + { title = "Preferences$"; } + { app_id = "org.keepassxc.KeePassXC"; } + { app_id = "pavucontrol"; } + { class = "^Pinentry-gtk-2$"; } + ]; + }; + + terminal = "alacritty"; + + keybindings = lib.mkOptionDefault { + "${mod}+b" = "split h"; + "${mod}+v" = "split v"; + "${mod}+s" = "layout stacking"; + "${mod}+w" = "layout tabbed"; + "${mod}+e" = "layout toggle split"; + "${mod}+space" = "focus mode_toggle"; + "${mod}+d" = "exec rofi -show drun"; + "${mod}+Tab" = "exec rofi -show window"; + + "${mod}+1" = "workspace ${ws1}"; + "${mod}+2" = "workspace ${ws2}"; + "${mod}+3" = "workspace ${ws3}"; + "${mod}+4" = "workspace ${ws4}; layout tabbed"; + "${mod}+5" = "workspace ${ws5}"; + "${mod}+6" = "workspace ${ws6}"; + "${mod}+7" = "workspace ${ws7}; layout tabbed"; + "${mod}+8" = "workspace ${ws8}"; + "${mod}+9" = "workspace ${ws9}"; + "${mod}+0" = "workspace ${ws10}"; + + "${mod}+Shift+1" = "move container to workspace ${ws1}"; + "${mod}+Shift+2" = "move container to workspace ${ws2}"; + "${mod}+Shift+3" = "move container to workspace ${ws3}"; + "${mod}+Shift+4" = "move container to workspace ${ws4}"; + "${mod}+Shift+5" = "move container to workspace ${ws5}"; + "${mod}+Shift+6" = "move container to workspace ${ws6}"; + "${mod}+Shift+7" = "move container to workspace ${ws7}"; + "${mod}+Shift+8" = "move container to workspace ${ws8}"; + "${mod}+Shift+9" = "move container to workspace ${ws9}"; + "${mod}+Shift+0" = "move container to workspace ${ws10}"; + + "${mod}+Shift+r" = "reload"; + + "${mod}+r" = "mode \"resize\""; + "${mod}+x" = "mode \"${mode_system}\""; + + "${mod}+Shift+x" = "exec swaylock"; + }; + + modes = { + resize = { + h = "resize shrink width 10 px or 10 ppt"; + j = "resize grow height 10 px or 10 ppt"; + k = "resize shrink height 10 px or 10 ppt"; + l = "resize grow width 10 px or 10 ppt"; + + Return = "mode \"default\""; + Escape = "mode \"default\""; + "${mod}+r" = "mode \"default\""; + }; + "${mode_system}" = { + l = "exec ~/bin/lock.sh, mode \"default\""; + s = "exec $Lock systemctl suspend, mode \"default\""; + p = "exec systemctl poweroff -i, mode \"default\""; + r = "exec systemctl reboot, mode \"default\""; + e = "exec i3-msg exit, mode \"default\""; + + # back to normal: Enter or Escape or mod+x again + Return = "mode \"default\""; + Escape = "mode \"default\""; + "${mod}+x" = "mode \"default\""; + }; + }; + window = { + hideEdgeBorders = "both"; + # disable titlebar + titlebar = false; + }; + }; + }; +} diff --git a/home/waybar.nix b/home/waybar.nix new file mode 100644 index 0000000..b4e3823 --- /dev/null +++ b/home/waybar.nix @@ -0,0 +1,100 @@ +{ pkgs, ... }: { + programs.waybar = { + enable = true; + systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 30; + output = [ + "eDP-1" + "HDMI-A-1" + ]; + modules-left = ["sway/workspaces" "sway/mode"]; + #modules-center = ["sway/window"]; + modules-right = [ + "pulseaudio" + "network" + "disk" + "memory" + "cpu" + "battery" + "clock#date" + "clock#time" + "tray" + ]; + + "disk" = { + format = "Disk {percentage_free}%"; + }; + + "pulseaudio" = { + format = "{volume}% {format_source}"; + on-click = "pavucontrol"; + }; + + "cpu" = { + format = "CPU {usage}% ({load})"; + states = { + warning = "70"; + critical = "90"; + }; + }; + + "memory" = { + format = "Mem {}%"; + states = { + warning = "70"; + critical = "90"; + }; + }; + + "network" = { + format-wifi = " {essid} ({signalStrength}%)"; + format-ethernet = " {ifname}: {ipaddr}/{cidr}"; + format-disconnected = "⚠ Disconnected"; + }; + + "battery" = { + states = { + warning = "30"; + critical = "15"; + }; + format = " {icon} {capacity}%"; + format-discharging = "{icon} {capacity}%"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + }; + + tray = { + icon-size = 21; + spacing = 10; + }; + + "clock#time" = { + interval = 1; + format = "{:%H:%M:%S}"; + }; + + "clock#date" = { + format = "{:%e %B %Y}"; + }; + + "sway/workspaces" = { + all-outputs = false; + }; + }; + }; + + package = pkgs.waybar.override { + pulseSupport = true; + #i3Support = true; + }; + }; +} diff --git a/machines/common.nix b/machines/common.nix index 3963dcb..85a3897 100644 --- a/machines/common.nix +++ b/machines/common.nix @@ -87,7 +87,8 @@ inputs: }; displayManager = { - defaultSession = "none+i3"; + #defaultSession = "none+i3"; + defaultSession = "sway"; }; xserver = { diff --git a/machines/morpheus.nix b/machines/morpheus.nix index 582814a..3310891 100644 --- a/machines/morpheus.nix +++ b/machines/morpheus.nix @@ -15,6 +15,7 @@ inputs.nixpkgs.lib.nixosSystem { nixpkgs.overlays = [ overlay-unstable ]; }) (import ./common.nix inputs) + (import ./sway.nix inputs) (import ./morpheus/btrbk.nix inputs) (import ./dev.nix inputs) (import ./entertainment.nix inputs) diff --git a/machines/sway.nix b/machines/sway.nix new file mode 100644 index 0000000..1e526fb --- /dev/null +++ b/machines/sway.nix @@ -0,0 +1,9 @@ +inputs: +{ config, lib, pkgs, ... }: { + services.gnome.gnome-keyring.enable = true; + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; +}