diff --git a/SwarselSystems.org b/SwarselSystems.org index c427675..ab7fff4 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -2069,7 +2069,7 @@ My new main machine. #+begin_src nix :tangle profiles/fourside/default.nix - { inputs, outputs, ... }: + { inputs, outputs, config, ... }: { imports = [ @@ -2104,23 +2104,23 @@ My new main machine. input-filename = "temp1_input"; }; monitors = { - main = { - name = "California Institute of Technology 0x1407 Unknown"; - mode = "1920x1080"; # TEMPLATE - scale = "1"; - position = "2560,0"; - workspace = "2:二"; - output = "eDP-1"; - }; - homedesktop = { - name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320"; - mode = "2560x1440"; - scale = "1"; - position = "0,0"; - workspace = "1:一"; - output = "DP-4"; - }; + main = { + name = "California Institute of Technology 0x1407 Unknown"; + mode = "1920x1080"; # TEMPLATE + scale = "1"; + position = "2560,0"; + workspace = "2:二"; + output = "eDP-1"; }; + homedesktop = { + name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320"; + mode = "2560x1440"; + scale = "1"; + position = "0,0"; + workspace = "1:一"; + output = "DP-4"; + }; + }; inputs = { "1:1:AT_Translated_Set_2_keyboard" = { xkb_layout = "us"; @@ -2128,6 +2128,21 @@ My new main machine. xkb_variant = "altgr-intl"; }; }; + keybindings = { + "Mod4+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\""; + "XF86MonBrightnessUp" = "exec brightnessctl set +5%"; + "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; + "XF86Display" = "exec wl-mirror eDP-1"; + # these are left open to use + # "XF86WLAN" = "exec wl-mirror eDP-1"; + # "XF86Messenger" = "exec wl-mirror eDP-1"; + # "XF86Go" = "exec wl-mirror eDP-1"; + # "XF86Favorites" = "exec wl-mirror eDP-1"; + # "XF86HomePage" = "exec wtype -P Escape -p Escape"; + # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%"; + # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5% "; + "XF86AudioMute" = "exec pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__Speaker__sink toggle && exec pactl set-sink-mute alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_4_Dock_USB_Audio_000000000000-00.analog-stereo toggle"; + }; }; } @@ -2272,25 +2287,6 @@ This is basically just adjusted to the core count, path to the =hwmon= (this was # ]; - keybindings = - let - inherit (config.wayland.windowManager.sway.config) modifier; - in - { - "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\""; - "XF86MonBrightnessUp" = "exec brightnessctl set +5%"; - "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; - "XF86Display" = "exec wl-mirror eDP-1"; - # these are left open to use - # "XF86WLAN" = "exec wl-mirror eDP-1"; - # "XF86Messenger" = "exec wl-mirror eDP-1"; - # "XF86Go" = "exec wl-mirror eDP-1"; - # "XF86Favorites" = "exec wl-mirror eDP-1"; - # "XF86HomePage" = "exec wtype -P Escape -p Escape"; - # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%"; - # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5% "; - "XF86AudioMute" = "pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink toggle"; - }; }; }; @@ -4459,28 +4455,28 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a { options.swarselsystems.isLaptop = lib.mkEnableOption "laptop host"; config.swarselsystems.touchpad = lib.mkIf config.swarselsystems.isLaptop { - "type:touchpad" = { - dwt = "enabled"; - tap = "enabled"; - natural_scroll = "enabled"; - middle_emulation = "enabled"; - }; + "type:touchpad" = { + dwt = "enabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; }; config.swarselsystems.waybarModules = lib.mkIf config.swarselsystems.isLaptop [ - "custom/outer-left-arrow-dark" - "mpris" - "custom/left-arrow-light" - "network" - "custom/left-arrow-dark" - "pulseaudio" - "custom/left-arrow-light" - "battery" - "custom/left-arrow-dark" - "group/hardware" - "custom/left-arrow-light" - "clock#2" - "custom/left-arrow-dark" - "clock#1" + "custom/outer-left-arrow-dark" + "mpris" + "custom/left-arrow-light" + "network" + "custom/left-arrow-dark" + "pulseaudio" + "custom/left-arrow-light" + "battery" + "custom/left-arrow-dark" + "group/hardware" + "custom/left-arrow-light" + "clock#2" + "custom/left-arrow-dark" + "clock#1" ]; } #+end_src @@ -4588,6 +4584,11 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a options.swarselsystems.standardinputs = mkOption { type = types.attrsOf (types.attrsOf types.str ); default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; + internal = true; + }; + options.swarselsystems.keybindings = mkOption { + type = types.attrsOf types.str; + default = { }; }; @@ -7317,7 +7318,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se let inherit (config.wayland.windowManager.sway.config) modifier; in - { + recursiveUpdate { "${modifier}+q" = "kill"; "${modifier}+f" = "exec firefox"; "${modifier}+Space" = "exec fuzzel"; @@ -7385,7 +7386,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "${modifier}+r" = "mode resize"; "${modifier}+Return" = "exec kitty"; - }; + } config.swarselsystems.keybindings; modes = { resize = { Down = "resize grow height 10 px or 10 ppt"; diff --git a/index.html b/index.html index b8ef69b..0ea71e5 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -223,7 +223,7 @@ -
  • 3.2. Overlays, packages, and modules +
  • 3.2. Overlays, packages, and modules
  • 3.3. Common NixOS @@ -253,7 +253,7 @@
  • 3.3.1. Imports, enable home-manager module
  • 3.3.2. General
  • 3.3.3. sops
  • -
  • 3.3.4. Theme (stylix)
  • +
  • 3.3.4. Theme (stylix)
  • 3.3.5. System Packages
  • 3.3.6. Programs (including zsh setup)
  • 3.3.7. Services
  • @@ -263,7 +263,7 @@
  • 3.4. Common Home-Manager
  • 3.5. flake.nix template @@ -340,7 +340,7 @@ @@ -1060,8 +1060,8 @@ mixedModules = [ -
    -

    2.3.3. General (outputs)

    +
    +

    2.3.3. General (outputs)

    @@ -2440,7 +2440,7 @@ in
     
  • -
  • Home-manager only
    +
  • Home-manager only
    1. Home manager
      @@ -2838,7 +2838,7 @@ My new main machine.
      -{ inputs, outputs, ... }:
      +{ inputs, outputs, config, ... }:
       {
       
         imports = [
      @@ -2873,23 +2873,23 @@ My new main machine.
             input-filename = "temp1_input";
           };
           monitors = {
      -        main = {
      -          name = "California Institute of Technology 0x1407 Unknown";
      -          mode = "1920x1080"; # TEMPLATE
      -          scale = "1";
      -          position = "2560,0";
      -          workspace = "2:二";
      -          output = "eDP-1";
      -        };
      -        homedesktop = {
      -          name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
      -          mode = "2560x1440";
      -          scale = "1";
      -          position = "0,0";
      -          workspace = "1:一";
      -          output = "DP-4";
      -        };
      +      main = {
      +        name = "California Institute of Technology 0x1407 Unknown";
      +        mode = "1920x1080"; # TEMPLATE
      +        scale = "1";
      +        position = "2560,0";
      +        workspace = "2:二";
      +        output = "eDP-1";
             };
      +      homedesktop = {
      +        name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
      +        mode = "2560x1440";
      +        scale = "1";
      +        position = "0,0";
      +        workspace = "1:一";
      +        output = "DP-4";
      +      };
      +    };
           inputs =  {
             "1:1:AT_Translated_Set_2_keyboard" = {
               xkb_layout = "us";
      @@ -2897,6 +2897,21 @@ My new main machine.
               xkb_variant = "altgr-intl";
             };
           };
      +    keybindings = {
      +      "Mod4+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\"";
      +      "XF86MonBrightnessUp" = "exec brightnessctl set +5%";
      +      "XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
      +      "XF86Display" = "exec wl-mirror eDP-1";
      +      # these are left open to use
      +      # "XF86WLAN" = "exec wl-mirror eDP-1";
      +      # "XF86Messenger" = "exec wl-mirror eDP-1";
      +      # "XF86Go" = "exec wl-mirror eDP-1";
      +      # "XF86Favorites" = "exec wl-mirror eDP-1";
      +      # "XF86HomePage" = "exec wtype -P Escape -p Escape";
      +      # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%";
      +      # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5%  ";
      +      "XF86AudioMute" = "exec pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__Speaker__sink toggle && exec pactl set-sink-mute alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_4_Dock_USB_Audio_000000000000-00.analog-stereo toggle";
      +    };
         };
       
       }
      @@ -3043,25 +3058,6 @@ This is basically just adjusted to the core count, path to the hwmon
       
      -
      -

      3.2. Overlays, packages, and modules

      +
      +

      3.2. Overlays, packages, and modules

      In this section I define packages that I manually want to nixpkgs. This can be useful for packages that are currently awaiting a PR or public packages that I do not want to maintain. @@ -5470,8 +5466,8 @@ These are for packages that are on nixpkgs, but do not fit my usecase, meaning I This is simply a mirror of the most recent stable branch of nixpkgs. Useful for packages that are broken on nixpkgs, but do not need to be on bleeding edge anyways.

    -
    -

    3.2.1. Packages

    +
    +

    3.2.1. Packages

    @@ -5481,8 +5477,8 @@ _ : rec { }
     
    -
    -

    3.2.2. Overlays

    +
    +

    3.2.2. Overlays

    @@ -5515,15 +5511,15 @@ _ : rec { }
     
    -
    -

    3.2.3. Modules

    +
    +

    3.2.3. Modules

    In this section I define custom modules under the swarsel attribute. These are mostly used to define settings specific to a host. I keep these settings confined to either home-manager or nixos to maintain compatibility with non-NixOS machines.

      -
    1. NixOS
      +
    2. NixOS

      Modules that need to be loaded on the NixOS level. Note that these will not be available on systems that are not running NixOS @@ -5537,7 +5533,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a

  • -
  • home-manager
    +
  • home-manager
    {
    @@ -5553,42 +5549,42 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
     
      -
    1. Laptop
      +
    2. Laptop
      { lib, config, ... }:
       {
         options.swarselsystems.isLaptop = lib.mkEnableOption "laptop host";
         config.swarselsystems.touchpad = lib.mkIf config.swarselsystems.isLaptop {
      -     "type:touchpad" = {
      -        dwt = "enabled";
      -        tap = "enabled";
      -        natural_scroll = "enabled";
      -        middle_emulation = "enabled";
      -     };
      +    "type:touchpad" = {
      +      dwt = "enabled";
      +      tap = "enabled";
      +      natural_scroll = "enabled";
      +      middle_emulation = "enabled";
      +    };
         };
         config.swarselsystems.waybarModules = lib.mkIf config.swarselsystems.isLaptop [
      -  "custom/outer-left-arrow-dark"
      -  "mpris"
      -  "custom/left-arrow-light"
      -  "network"
      -  "custom/left-arrow-dark"
      -  "pulseaudio"
      -  "custom/left-arrow-light"
      -  "battery"
      -  "custom/left-arrow-dark"
      -  "group/hardware"
      -  "custom/left-arrow-light"
      -  "clock#2"
      -  "custom/left-arrow-dark"
      -  "clock#1"
      +    "custom/outer-left-arrow-dark"
      +    "mpris"
      +    "custom/left-arrow-light"
      +    "network"
      +    "custom/left-arrow-dark"
      +    "pulseaudio"
      +    "custom/left-arrow-light"
      +    "battery"
      +    "custom/left-arrow-dark"
      +    "group/hardware"
      +    "custom/left-arrow-light"
      +    "clock#2"
      +    "custom/left-arrow-dark"
      +    "clock#1"
         ];
       }
       
    3. -
    4. Hardware
      +
    5. Hardware
      { lib, ... }:
      @@ -5612,7 +5608,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
       
    6. -
    7. Waybar
      +
    8. Waybar
        { lib, config, ... }:
      @@ -5652,7 +5648,7 @@ in
       
    9. -
    10. Monitors
      +
    11. Monitors
      { lib, config, ... }:
      @@ -5669,7 +5665,7 @@ in
       
    12. -
    13. Input
      +
    14. Input
      { lib, config, ... }:
      @@ -5697,6 +5693,11 @@ in
         options.swarselsystems.standardinputs = mkOption {
           type = types.attrsOf (types.attrsOf types.str );
           default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs;
      +    internal = true;
      +  };
      +  options.swarselsystems.keybindings = mkOption {
      +    type = types.attrsOf types.str;
      +    default = { };
         };
       
       
      @@ -5705,7 +5706,7 @@ in
       
    15. -
    16. Nixos
      +
    17. Nixos
      { lib, config, ... }:
      @@ -5727,7 +5728,7 @@ in
       
    18. -
    19. System startup
      +
    20. System startup
      { lib, config, ... }:
      @@ -6303,8 +6304,8 @@ I use sops-nix to handle secrets that I want to have available on my machines at
       
      -
      -

      3.3.4. Theme (stylix)

      +
      +

      3.3.4. Theme (stylix)

      By default, stylix wants to style GRUB as well. However, I think that looks horrible. @@ -6486,7 +6487,7 @@ Some programs profit from being installed through dedicated NixOS settings on sy

        -
      1. zsh
        +
      2. zsh

        Do not touch this. @@ -6504,7 +6505,7 @@ Do not touch this.

    21. -
    22. syncthing
      +
    23. syncthing
      @@ -6582,7 +6583,7 @@ Enables the blueman service including the nice system tray icon.
       
    24. -
    25. Network devices
      +
    26. Network devices

      In this section we enable compatibility with several network devices I have at home, mainly printers and scanners. @@ -6634,7 +6635,7 @@ services.printing = {

    27. -
    28. Avahi (device discovery)
      +
    29. Avahi (device discovery)

      Avahi is the service used for the network discovery. @@ -6788,8 +6789,8 @@ This section houses the greetd related settings. I do not really want to use a d

      3.4. Common Home-Manager

      -
      -

      3.4.1. Imports

      +
      +

      3.4.1. Imports

      This section sets up all the imports that are used in the home-manager section. @@ -7599,8 +7600,8 @@ This section is for programs that require no further configuration. zsh Integrat

    -
    -

    3.4.10. nix-index

    +
    +

    3.4.10. nix-index

    nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for command-not-found.sh, however, the implementation is based on a channel based setup. I like consistency, so I replace the command with one that provides a flakes-based output. @@ -8686,7 +8687,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se let inherit (config.wayland.windowManager.sway.config) modifier; in - { + recursiveUpdate { "${modifier}+q" = "kill"; "${modifier}+f" = "exec firefox"; "${modifier}+Space" = "exec fuzzel"; @@ -8754,7 +8755,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "${modifier}+r" = "mode resize"; "${modifier}+Return" = "exec kitty"; - }; + } config.swarselsystems.keybindings; modes = { resize = { Down = "resize grow height 10 px or 10 ppt"; @@ -8941,8 +8942,8 @@ Currently, I am too lazy to explain every option here, but most of it is very se

    -
    -

    3.4.25. gpg-agent

    +
    +

    3.4.25. gpg-agent

    { pkgs, ... }:
    @@ -9977,7 +9978,7 @@ The standard Emacs behaviour for the Python process shell is a bit annoying. Thi
     
  • -
  • Nix common prefix bracketer
    +
  • Nix common prefix bracketer

    This function searches for common delimiters in region and removes them, summarizing all captured lines by it. @@ -10010,7 +10011,7 @@ This function searches for common delimiters in region and removes them, summari

  • -
  • Nix formatters
    +
  • Nix formatters

    This formats the org code block at point in accordance to the nixpkgs-fmt formatter @@ -11583,8 +11584,8 @@ This adds a rudimentary nix-mode to Emacs. I have not really tried this out, as

    -
    -

    4.4.3. nixpkgs-fmt

    +
    +

    4.4.3. nixpkgs-fmt

    Adds functions for formatting nix code. @@ -13599,7 +13600,7 @@ My laptop, sadly soon to be replaced by a new one, since most basic functions ar

    Author: Leon Schwarzäugl

    -

    Created: 2024-07-25 Do 15:13

    +

    Created: 2024-07-25 Do 16:01

    Validate

    diff --git a/modules/home/input.nix b/modules/home/input.nix index 7f7cc9a..63f523c 100644 --- a/modules/home/input.nix +++ b/modules/home/input.nix @@ -23,6 +23,11 @@ in options.swarselsystems.standardinputs = mkOption { type = types.attrsOf (types.attrsOf types.str); default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; + internal = true; + }; + options.swarselsystems.keybindings = mkOption { + type = types.attrsOf types.str; + default = { }; }; diff --git a/profiles/common/home/sway.nix b/profiles/common/home/sway.nix index 0fcae08..793f255 100644 --- a/profiles/common/home/sway.nix +++ b/profiles/common/home/sway.nix @@ -31,75 +31,77 @@ in let inherit (config.wayland.windowManager.sway.config) modifier; in - { - "${modifier}+q" = "kill"; - "${modifier}+f" = "exec firefox"; - "${modifier}+Space" = "exec fuzzel"; - "${modifier}+Shift+Space" = "floating toggle"; - "${modifier}+e" = "exec emacsclient -nquc -a emacs -e \"(dashboard-open)\""; - "${modifier}+Shift+m" = "exec emacsclient -nquc -a emacs -e \"(mu4e)\""; - "${modifier}+Shift+c" = "exec emacsclient -nquc -a emacs -e \"(swarsel/open-calendar)\""; - "${modifier}+Shift+s" = "exec \"bash ~/.dotfiles/scripts/checkspotify.sh\""; - "${modifier}+m" = "exec \"bash ~/.dotfiles/scripts/checkspotifytui.sh\""; - "${modifier}+x" = "exec \"bash ~/.dotfiles/scripts/checkkitty.sh\""; - "${modifier}+d" = "exec \"bash ~/.dotfiles/scripts/checkdiscord.sh\""; - "${modifier}+Shift+r" = "exec \"bash ~/.dotfiles/scripts/restart.sh\""; - "${modifier}+Shift+t" = "exec \"bash ~/.dotfiles/scripts/toggle_opacity.sh\""; - "${modifier}+Shift+F12" = "move scratchpad"; - "${modifier}+F12" = "scratchpad show"; - "${modifier}+c" = "exec qalculate-gtk"; - "${modifier}+p" = "exec pass-fuzzel"; - "${modifier}+o" = "exec pass-fuzzel-otp"; - "${modifier}+Shift+p" = "exec pass-fuzzel --type"; - "${modifier}+Shift+o" = "exec pass-fuzzel-otp --type"; - "${modifier}+Escape" = "mode $exit"; - # "${modifier}+Shift+Escape" = "exec com.github.stsdc.monitor"; - "${modifier}+Shift+Escape" = "exec kitty -o confirm_os_window_close=0 btm"; - "${modifier}+s" = "exec grim -g \"$(slurp)\" -t png - | wl-copy -t image/png"; - "${modifier}+i" = "exec \"bash ~/.dotfiles/scripts/startup.sh\""; - "${modifier}+1" = "workspace 1:一"; - "${modifier}+Shift+1" = "move container to workspace 1:一"; - "${modifier}+2" = "workspace 2:二"; - "${modifier}+Shift+2" = "move container to workspace 2:二"; - "${modifier}+3" = "workspace 3:三"; - "${modifier}+Shift+3" = "move container to workspace 3:三"; - "${modifier}+4" = "workspace 4:四"; - "${modifier}+Shift+4" = "move container to workspace 4:四"; - "${modifier}+5" = "workspace 5:五"; - "${modifier}+Shift+5" = "move container to workspace 5:五"; - "${modifier}+6" = "workspace 6:六"; - "${modifier}+Shift+6" = "move container to workspace 6:六"; - "${modifier}+7" = "workspace 7:七"; - "${modifier}+Shift+7" = "move container to workspace 7:七"; - "${modifier}+8" = "workspace 8:八"; - "${modifier}+Shift+8" = "move container to workspace 8:八"; - "${modifier}+9" = "workspace 9:九"; - "${modifier}+Shift+9" = "move container to workspace 9:九"; - "${modifier}+0" = "workspace 10:十"; - "${modifier}+Shift+0" = "move container to workspace 10:十"; - "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "${modifier}+Left" = "focus left"; - "${modifier}+Right" = "focus right"; - "${modifier}+Down" = "focus down"; - "${modifier}+Up" = "focus up"; - "${modifier}+Shift+Left" = "move left 40px"; - "${modifier}+Shift+Right" = "move right 40px"; - "${modifier}+Shift+Down" = "move down 40px"; - "${modifier}+Shift+Up" = "move up 40px"; - "${modifier}+h" = "focus left"; - "${modifier}+l" = "focus right"; - "${modifier}+j" = "focus down"; - "${modifier}+k" = "focus up"; - "${modifier}+Shift+h" = "move left 40px"; - "${modifier}+Shift+l" = "move right 40px"; - "${modifier}+Shift+j" = "move down 40px"; - "${modifier}+Shift+k" = "move up 40px"; - "${modifier}+Ctrl+Shift+c" = "reload"; - "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; - "${modifier}+r" = "mode resize"; - "${modifier}+Return" = "exec kitty"; - }; + recursiveUpdate + { + "${modifier}+q" = "kill"; + "${modifier}+f" = "exec firefox"; + "${modifier}+Space" = "exec fuzzel"; + "${modifier}+Shift+Space" = "floating toggle"; + "${modifier}+e" = "exec emacsclient -nquc -a emacs -e \"(dashboard-open)\""; + "${modifier}+Shift+m" = "exec emacsclient -nquc -a emacs -e \"(mu4e)\""; + "${modifier}+Shift+c" = "exec emacsclient -nquc -a emacs -e \"(swarsel/open-calendar)\""; + "${modifier}+Shift+s" = "exec \"bash ~/.dotfiles/scripts/checkspotify.sh\""; + "${modifier}+m" = "exec \"bash ~/.dotfiles/scripts/checkspotifytui.sh\""; + "${modifier}+x" = "exec \"bash ~/.dotfiles/scripts/checkkitty.sh\""; + "${modifier}+d" = "exec \"bash ~/.dotfiles/scripts/checkdiscord.sh\""; + "${modifier}+Shift+r" = "exec \"bash ~/.dotfiles/scripts/restart.sh\""; + "${modifier}+Shift+t" = "exec \"bash ~/.dotfiles/scripts/toggle_opacity.sh\""; + "${modifier}+Shift+F12" = "move scratchpad"; + "${modifier}+F12" = "scratchpad show"; + "${modifier}+c" = "exec qalculate-gtk"; + "${modifier}+p" = "exec pass-fuzzel"; + "${modifier}+o" = "exec pass-fuzzel-otp"; + "${modifier}+Shift+p" = "exec pass-fuzzel --type"; + "${modifier}+Shift+o" = "exec pass-fuzzel-otp --type"; + "${modifier}+Escape" = "mode $exit"; + # "${modifier}+Shift+Escape" = "exec com.github.stsdc.monitor"; + "${modifier}+Shift+Escape" = "exec kitty -o confirm_os_window_close=0 btm"; + "${modifier}+s" = "exec grim -g \"$(slurp)\" -t png - | wl-copy -t image/png"; + "${modifier}+i" = "exec \"bash ~/.dotfiles/scripts/startup.sh\""; + "${modifier}+1" = "workspace 1:一"; + "${modifier}+Shift+1" = "move container to workspace 1:一"; + "${modifier}+2" = "workspace 2:二"; + "${modifier}+Shift+2" = "move container to workspace 2:二"; + "${modifier}+3" = "workspace 3:三"; + "${modifier}+Shift+3" = "move container to workspace 3:三"; + "${modifier}+4" = "workspace 4:四"; + "${modifier}+Shift+4" = "move container to workspace 4:四"; + "${modifier}+5" = "workspace 5:五"; + "${modifier}+Shift+5" = "move container to workspace 5:五"; + "${modifier}+6" = "workspace 6:六"; + "${modifier}+Shift+6" = "move container to workspace 6:六"; + "${modifier}+7" = "workspace 7:七"; + "${modifier}+Shift+7" = "move container to workspace 7:七"; + "${modifier}+8" = "workspace 8:八"; + "${modifier}+Shift+8" = "move container to workspace 8:八"; + "${modifier}+9" = "workspace 9:九"; + "${modifier}+Shift+9" = "move container to workspace 9:九"; + "${modifier}+0" = "workspace 10:十"; + "${modifier}+Shift+0" = "move container to workspace 10:十"; + "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "${modifier}+Left" = "focus left"; + "${modifier}+Right" = "focus right"; + "${modifier}+Down" = "focus down"; + "${modifier}+Up" = "focus up"; + "${modifier}+Shift+Left" = "move left 40px"; + "${modifier}+Shift+Right" = "move right 40px"; + "${modifier}+Shift+Down" = "move down 40px"; + "${modifier}+Shift+Up" = "move up 40px"; + "${modifier}+h" = "focus left"; + "${modifier}+l" = "focus right"; + "${modifier}+j" = "focus down"; + "${modifier}+k" = "focus up"; + "${modifier}+Shift+h" = "move left 40px"; + "${modifier}+Shift+l" = "move right 40px"; + "${modifier}+Shift+j" = "move down 40px"; + "${modifier}+Shift+k" = "move up 40px"; + "${modifier}+Ctrl+Shift+c" = "reload"; + "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; + "${modifier}+r" = "mode resize"; + "${modifier}+Return" = "exec kitty"; + } + config.swarselsystems.keybindings; modes = { resize = { Down = "resize grow height 10 px or 10 ppt"; diff --git a/profiles/fourside/default.nix b/profiles/fourside/default.nix index 39a6f84..d6e0ddf 100644 --- a/profiles/fourside/default.nix +++ b/profiles/fourside/default.nix @@ -1,4 +1,4 @@ -{ inputs, outputs, ... }: +{ inputs, outputs, config, ... }: { imports = [ @@ -57,6 +57,21 @@ xkb_variant = "altgr-intl"; }; }; + keybindings = { + "Mod4+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\""; + "XF86MonBrightnessUp" = "exec brightnessctl set +5%"; + "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; + "XF86Display" = "exec wl-mirror eDP-1"; + # these are left open to use + # "XF86WLAN" = "exec wl-mirror eDP-1"; + # "XF86Messenger" = "exec wl-mirror eDP-1"; + # "XF86Go" = "exec wl-mirror eDP-1"; + # "XF86Favorites" = "exec wl-mirror eDP-1"; + # "XF86HomePage" = "exec wtype -P Escape -p Escape"; + # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%"; + # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5% "; + "XF86AudioMute" = "exec pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__Speaker__sink toggle && exec pactl set-sink-mute alsa_output.usb-Lenovo_ThinkPad_Thunderbolt_4_Dock_USB_Audio_000000000000-00.analog-stereo toggle"; + }; }; } diff --git a/profiles/fourside/home.nix b/profiles/fourside/home.nix index 744ad00..05fe326 100644 --- a/profiles/fourside/home.nix +++ b/profiles/fourside/home.nix @@ -11,25 +11,6 @@ # ]; - keybindings = - let - inherit (config.wayland.windowManager.sway.config) modifier; - in - { - "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\""; - "XF86MonBrightnessUp" = "exec brightnessctl set +5%"; - "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; - "XF86Display" = "exec wl-mirror eDP-1"; - # these are left open to use - # "XF86WLAN" = "exec wl-mirror eDP-1"; - # "XF86Messenger" = "exec wl-mirror eDP-1"; - # "XF86Go" = "exec wl-mirror eDP-1"; - # "XF86Favorites" = "exec wl-mirror eDP-1"; - # "XF86HomePage" = "exec wtype -P Escape -p Escape"; - # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%"; - # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5% "; - "XF86AudioMute" = "pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink toggle"; - }; }; };