diff --git a/home/sway/kitty.nix b/home/sway/kitty.nix new file mode 100644 index 0000000..6284487 --- /dev/null +++ b/home/sway/kitty.nix @@ -0,0 +1,19 @@ +{ config, ... }: + +{ + wayland.windowManager.sway.extraSessionCommands = '' + export KITTY_CACHE_DIRECTORY="/tmp/kitty"; + ''; + programs.kitty = { + enable = true; + font.name = "Comic Mono"; + settings = { + font_size = 20; + bold_font = "auto"; + italic_font = "auto"; + bold_italic_font = "auto"; + background_opacity = "0.9"; + disable_ligatures = "cursor"; + }; + }; +} \ No newline at end of file diff --git a/home/sway/sway.nix b/home/sway/sway.nix new file mode 100644 index 0000000..e84efd1 --- /dev/null +++ b/home/sway/sway.nix @@ -0,0 +1,124 @@ +{ config, pkgs, lib, ... }: { + programs.mako = { + enable = true; + defaultTimeout = 3000; + }; + wayland.windowManager.sway = { + enable = true; + config = let + terminal = "${pkgs.kitty}/bin/kitty"; + menu = "${pkgs.wofi}/bin/wofi -idbt ${pkgs.kitty}/bin/kitty -p '' -W 25%"; + cfg = config.wayland.windowManager.sway.config; + in { + bars = [{ command = "${pkgs.waybar}/bin/waybar"; }]; + + input = { + "*" = { + xkb_layout = "gb"; + }; + }; + + fonts = { + names = [ "Comic Code" ]; + size = 18.0; + }; + + modifier = "Mod1"; + terminal = "${pkgs.kitty}/bin/kitty"; + + startup = [ + { command = "systemctl --user restart mako"; always = true; } + ]; + + window = { + border = 1; + titlebar = true; + }; + + keybindings = { + "${cfg.modifier}+Return" = "${cfg.terminal}"; + + "${cfg.modifier}+Left" = "focus left"; + "${cfg.modifier}+Down" = "focus down"; + "${cfg.modifier}+Up" = "focus up"; + "${cfg.modifier}+Right" = "focus right"; + + "${cfg.modifier}+Shift+Left" = "move left"; + "${cfg.modifier}+Shift+Down" = "move down"; + "${cfg.modifier}+Shift+Up" = "move up"; + "${cfg.modifier}+Shift+Right" = "move right"; + + "${cfg.modifier}+Shift+space" = "floating toggle"; + "${cfg.modifier}+space" = "focus mode_toggle"; + + "XF86AudioRaiseVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%"; + "XF86AudioLowerVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%"; + "XF86AudioMute" = "exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle"; + "XF86AudioMicMute" = "exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle"; + "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5"; + "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5"; + "${cfg.modifier}+Print" = "exec ${pkgs.bash}/bin/bash -c '~/.local/bin/elixiremanager.sh -w'"; + + "${cfg.modifier}+d" = "exec ${cfg.menu}"; + "${cfg.modifier}+f" = "fullscreen"; + + "${cfg.modifier}+Shift+q" = "kill"; + "${cfg.modifier}+Shift+c" = "reload"; + + "${cfg.modifier}+r" = "mode resize"; + } // (lib.foldl lib.recursiveUpdate {} (map (workspace: { + "${cfg.modifier}+${workspace}" = "workspace ${workspace}"; + "${cfg.modifier}+Shift+${workspace}" = "move container to workspace ${workspace}"; + }) [ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" ])); + + keycodebindings = { + "--no-repeat 107" = "exec dbus-send --session --type=method_call --dest=net.sourceforge.mumble.mumble / net.sourceforge.mumble.Mumble.startTalking"; + "--release 107" = "exec dbus-send --session --type=method_call --dest=net.sourceforge.mumble.mumble / net.sourceforge.mumble.Mumble.stopTalking"; + }; + }; + wrapperFeatures.gtk = true; + extraConfig = '' + seat seat0 xcursor_theme breeze_cursors 20 + bindswitch --reload --locked lid:on output eDP-1 disable + bindswitch --reload --locked lid:off output eDP-1 enable + ''; + }; + programs.waybar = { + enable = true; + # style = '' + # * { + # font-family: Iosevka; + # } + # ''; + settings = [{ + modules-left = [ "sway/workspaces" "sway/mode" ]; + modules-center = [ "sway/window" ]; + modules-right = [ "pulseaudio" "network" "cpu" "memory" "temperature" "battery" "clock" "tray" ]; + + modules = { + battery = { + states = { + good = 95; + warning = 30; + critical = 15; + }; + format = "{capacity}% {icon}"; + format-charging = "{capacity}% "; + format-plugged = "{capacity}% "; + format-alt = "{time} {icon}"; + format-icons = ["" "" "" "" ""]; + }; + network = { + format-wifi = "{essid} ({signalStrength}%) "; + format-ethernet = "{ifname}: {ipaddr}/{cidr} "; + format-linked = "{ifname} (No IP) "; + format-disconnected = "Disconnected ⚠"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + }; + }; + }]; + }; +} + + + diff --git a/hosts/nixos.nix b/hosts/nixos.nix index 3068114..377e896 100644 --- a/hosts/nixos.nix +++ b/hosts/nixos.nix @@ -9,8 +9,10 @@ profiles.laptop profiles.pulse profiles.network_manager + profiles.sway home.gui home.network_manager + home.sway ]; boot = { diff --git a/profiles/sway/sway.nix b/profiles/sway/sway.nix new file mode 100644 index 0000000..b5703f3 --- /dev/null +++ b/profiles/sway/sway.nix @@ -0,0 +1,3 @@ +{ config, ... }: { + programs.sway.enable = true; +}