diff options
author | Franck Cuny <franck@fcuny.net> | 2022-02-25 06:42:48 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-02-27 13:05:29 -0800 |
commit | 713d0476c69c06d6baad9568c0d4def8c1e9fae9 (patch) | |
tree | ecea510c6d3524a589a2de406c16a9bfe140dc0b /users/fcuny/desktop/wm/default.nix | |
parent | hosts: add tahoe, the new NAS (diff) | |
download | world-713d0476c69c06d6baad9568c0d4def8c1e9fae9.tar.gz |
sway: re-organize the modules
Rename 'sway' to 'wm' to make it more generic; rename some of the other modules (e.g. 'wofi' to 'launcher'), for the same reason.
Diffstat (limited to 'users/fcuny/desktop/wm/default.nix')
-rw-r--r-- | users/fcuny/desktop/wm/default.nix | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/users/fcuny/desktop/wm/default.nix b/users/fcuny/desktop/wm/default.nix new file mode 100644 index 0000000..0880b1c --- /dev/null +++ b/users/fcuny/desktop/wm/default.nix @@ -0,0 +1,90 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./bar.nix + ./gammastep.nix + ./launcher.nix + ./screenlock.nix + ./screenshot.nix + ]; + + home.packages = [ + pkgs.pavucontrol + pkgs.wev + pkgs.wf-recorder + pkgs.wofi + ]; + + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = true; + XDG_CURRENT_DESKTOP = "sway"; + XDG_SESSION_TYPE = "wayland"; + }; + + wayland.windowManager.sway = { + enable = true; + systemdIntegration = true; + extraSessionCommands = '' + export XDG_SESSION_TYPE=wayland + export XDG_CURRENT_DESKTOP=sway + export MOZ_ENABLE_WAYLAND=1 + ''; + config = rec { + modifier = "Mod4"; + terminal = "${config.programs.alacritty.package}/bin/alacritty"; + menu = "${pkgs.wofi}/bin/wofi -S run"; + bars = [ + { + fonts = { + names = [ + "Source Code Pro" + "Font Awesome 5 Free" + ]; + size = 10.0; + }; + position = "top"; + statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml"; + } + ]; + fonts = { + names = [ "Source Code Pro" ]; + size = 10.0; + }; + keybindings = lib.mkOptionDefault { + "XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-"; + "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%"; + "${modifier}+s" = "exec ${pkgs.grim}/bin/grim $(xdg-user-dir DOCUMENTS)/screenshots/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')"; + "${modifier}+Shift+s" = "exec ${pkgs.slurp}/bin/slurp | ${pkgs.grim}/bin/grim -g - $(xdg-user-dir DOCUMENTS)/screenshots/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')"; + }; + window.commands = [ + # pavucontrol + { + command = "floating enable"; + criteria.app_id = "pavucontrol"; + } + ]; + input = { + "*" = { + "xkb_layout" = "us,fr"; + # map capslock to ctrl, and switch layout using shift+caps + "xkb_options" = "ctrl:nocaps,grp:shift_caps_toggle"; + }; + }; + output = { + "*" = { + scale = "1.5"; + bg = "#32324b solid_color"; + }; + # This is for aptos + "eDP-1" = { + scale = "1.3"; + }; + }; + }; + }; +} |