{ config, pkgs, lib, ... }: { config = { security.pam.services.swaylock = {}; home-manager.users.tzlil = { programs.waybar = { enable = true; settings = { mainBar = { modules-left = ["sway/workspaces" "sway/mode" "wlr/taskbar"]; modules-center = ["sway/window"]; modules-right = ["mpd" "temperature" "battery" "clock"]; "sway/workspaces" = { disable-scroll = true; all-outputs = false; }; }; }; }; services.mako.enable = true; home.packages = with pkgs; [ wf-recorder font-awesome_6 waypipe alsa-utils wl-clipboard ]; programs.foot = { enable = true; server.enable = true; settings = { main = { # term = "xterm-256color"; # font = "Fira Code:size=11"; dpi-aware = "yes"; }; colors = { background = "000000"; foreground = "ffffff"; }; # mouse = { # hide-when-typing = "yes"; # }; }; }; services.swayidle = let pgrep = "${lib.getExe pkgs.procps}"; dpms_check = s: pkgs.writeShellScript "dpms_check_${s}" '' set -x if ${pgrep} swaylock; then ${pkgs.sway}/bin/swaymsg 'output * dpms ${s}'; fi ''; dpms_set = s: pkgs.writeShellScript "dpms_set_${s}" '' set -x "${pkgs.sway}/bin/swaymsg" 'output * dpms ${s}' ''; fadelock = pkgs.writeShellScript "fadelock.sh" '' set -x exec "${lib.getExe pkgs.swaylock}" ''; in { enable = false; systemdTarget = "graphical-session.target"; timeouts = [ # auto-lock after 30 seconds { timeout = 30; command = fadelock.outPath; } ]; events = [ { event = "before-sleep"; command = fadelock.outPath; } ]; extraArgs = [ "idlehint 30" ]; }; wayland.windowManager.sway = rec { enable = true; wrapperFeatures.gtk = true; config = rec { fonts = { names = ["Iosevka"]; style = "Regular"; size = 11.0; }; output = { "DP-1" = { resolution = "1920x1080@166Hz"; }; }; bars = [ { fonts = { # names = ["Iosevka" "FontAwesome"]; names = ["APL385 Unicode"]; style = "Regular"; size = 14.0; }; position = "top"; # statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs"; command = "${lib.getExe pkgs.waybar}"; # command = "waybar"; colors = { statusline = "#ffffff"; background = "#323232"; inactiveWorkspace = { background = "#323232"; border = "#323232"; text = "#5c5c5c"; }; }; } ]; modifier = "Mod4"; left = "h"; down = "n"; up = "e"; right = "i"; keybindings = { "${modifier}+Return" = "exec $term"; "${modifier}+q" = "kill"; "${modifier}+d" = "exec ${lib.getExe pkgs.kickoff}"; "${modifier}+Shift+c" = "reload"; "${modifier}+Shift+q" = "exec swaynag -t warning -m 'you sure?' -B 'yes' 'swaymsg exit' -s 'no'"; "${modifier}+Shift+p" = "exec systemctl poweroff"; "${modifier}+Shift+s" = "exec systemctl suspend"; "${modifier}+${left}" = "focus left"; "${modifier}+${down}" = "focus down"; "${modifier}+${up}" = "focus up"; "${modifier}+${right}" = "focus right"; "${modifier}+Left" = "focus left"; "${modifier}+Down" = "focus down"; "${modifier}+Up" = "focus up"; "${modifier}+Right" = "focus right"; "${modifier}+Shift+${left}" = "move left"; "${modifier}+Shift+${down}" = "move down"; "${modifier}+Shift+${up}" = "move up"; "${modifier}+Shift+${right}" = "move right"; "${modifier}+Shift+Left" = "move left"; "${modifier}+Shift+Down" = "move down"; "${modifier}+Shift+Up" = "move up"; "${modifier}+Shift+Right" = "move right"; "${modifier}+1" = "workspace number 1"; "${modifier}+2" = "workspace number 2"; "${modifier}+3" = "workspace number 3"; "${modifier}+4" = "workspace number 4"; "${modifier}+5" = "workspace number 5"; "${modifier}+6" = "workspace number 6"; "${modifier}+7" = "workspace number 7"; "${modifier}+8" = "workspace number 8"; "${modifier}+9" = "workspace number 9"; "${modifier}+0" = "workspace number 10"; "${modifier}+Tab" = "workspace back_and_forth"; "${modifier}+Shift+1" = "move container to workspace number 1"; "${modifier}+Shift+2" = "move container to workspace number 2"; "${modifier}+Shift+3" = "move container to workspace number 3"; "${modifier}+Shift+4" = "move container to workspace number 4"; "${modifier}+Shift+5" = "move container to workspace number 5"; "${modifier}+Shift+6" = "move container to workspace number 6"; "${modifier}+Shift+7" = "move container to workspace number 7"; "${modifier}+Shift+8" = "move container to workspace number 8"; "${modifier}+Shift+9" = "move container to workspace number 9"; "${modifier}+Shift+0" = "move container to workspace number 10"; "${modifier}+b" = "splith"; "${modifier}+v" = "splitv"; "${modifier}+s" = "layout stacking"; "${modifier}+w" = "layout tabbed"; "${modifier}+k" = "layout toggle split"; "${modifier}+f" = "fullscreen"; "${modifier}+Shift+space" = "floating toggle"; "${modifier}+t" = "focus mode_toggle"; "${modifier}+a" = "focus parent"; "${modifier}+shift+a" = "focus child"; "${modifier}+Shift+minus" = "move scratchpad"; "${modifier}+minus" = "scratchpad show"; #"${modifier}+m" = "mode notifications"; "${modifier}+m" = "exec ${pkgs.wl-clipboard}/bin/wl-paste | xargs mpv"; "${modifier}+y" = "exec ${lib.getExe pkgs.ytfzf} -D -L | xargs mpv"; "${modifier}+l" = "exec ${lib.getExe pkgs.swaylock} -c 070D0D"; "Print" = "exec ${lib.getExe pkgs.sway-contrib.grimshot} copy area"; "Shift+Print" = "exec ${lib.getExe pkgs.sway-contrib.grimshot} copy active"; "Ctrl+Print" = "exec ${lib.getExe pkgs.sway-contrib.grimshot} copy output"; }; input = { "type:keyboard" = { xkb_layout = "us"; # xkb_variant = "colemak_dh"; xkb_options = "caps:backspace"; }; "type:touchpad" = { tap = "enabled"; }; }; }; extraConfig = '' exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway # exec ${lib.getExe pkgs.swayidle} -w \ # timeout 300 '${lib.getExe pkgs.swaylock} -f -c 000000' \ # timeout 600 'swaymsg "output * dpms off"' \ # resume 'swaymsg "output * dpms on"' \ # before-sleep '${lib.getExe pkgs.swaylock} -f -c 000000' # exec ${pkgs.polkit_gnome}/polkit-gnome/polkit-gnome-authentication-agent-1 #set $mod Alt set $mod Mod4 set $left h set $down n set $up e set $right i set $term ${lib.getExe pkgs.foot} default_border pixel hide_edge_borders smart smart_borders on # if want to use in the future use fetchurl # output * bg ~/tmp/graveyard.png fill floating_modifier $mod normal mode notifications { bindsym Escape mode default bindsym Return exec ${lib.getExe pkgs.mako} invoke; exec ${lib.getExe pkgs.mako} dismiss; mode default bindsym d exec ${lib.getExe pkgs.mako} dismiss; mode default bindsym Shift+d exec ${lib.getExe pkgs.mako} dismiss -a; mode default } font Iosevka 10 bindsym $mod+p exec passmenu $menu_args bindsym --locked XF86AudioMute exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle bindsym --locked XF86AudioLowerVolume exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5% bindsym --locked XF86AudioRaiseVolume exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5% bindsym --locked XF86AudioMicMute exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle bindsym --locked XF86AudioNext exec ${lib.getExe pkgs.playerctl} next bindsym --locked XF86AudioPlay exec ${lib.getExe pkgs.playerctl} play-pause bindsym --locked XF86AudioPrev exec ${lib.getExe pkgs.playerctl} previous bindsym --locked XF86AudioStop exec ${lib.getExe pkgs.playerctl} stop for_window [app_id="^menu$"] floating enable, border none #for_window [app_id="mpv"] sticky enable #for_window [floating] border csd #for_window [app_id="firefox" title="Picture-in-Picture"] floating enable, sticky enable, border none #for_window [app_id="imv"] floating enable #for_window [app_id="imv"] floating enable #for_window [class="PacketTracer"] floating enable bindsym XF86MonBrightnessUp exec ${lib.getExe pkgs.brightnessctl} s +5% bindsym XF86MonBrightnessDown exec ${lib.getExe pkgs.brightnessctl} s 5%- exec ${lib.getExe pkgs.mako} >/tmp/mako.log 2>&1 exec_always ${lib.getExe pkgs.kanshi} >/tmp/kanshi.log 2>&1 default_border pixel 2 gaps outer 0 gaps inner 0 include /etc/sway/config.d/* ''; }; }; }; }