Skip to content

Commit

Permalink
sway: add sway-helper
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Aug 21, 2024
1 parent b9b701a commit 42fb5c0
Show file tree
Hide file tree
Showing 22 changed files with 1,238 additions and 22 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,28 @@ jobs:
- name: flake check
run: nix flake check

sway-helper-code-quality:
name: sway-helper code quality
needs:
- formatting
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./overlays/pkgs/sway-helper

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@V27

- name: clippy
run: nix develop --command cargo clippy --all-targets -- -D warnings

build-home-manager-configs:
name: Build Home Manager configurations
needs:
- formatting
- sway-helper-code-quality
runs-on: ubuntu-latest

strategy:
Expand Down
9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,21 @@
packages = with pkgs; [
nixos-anywhere

# Formatting tools
alejandra
rustfmt
treefmt
mdl

# Secret management
ssh-to-age
sops

# Rust toolchain
cargo
rustc
clippy
rust-analyzer
];
};

Expand Down
22 changes: 3 additions & 19 deletions modules/home-manager/desktop_environment/components/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,14 @@
"${modifier}+comma" = "fullscreen";
"${modifier}+period" = "floating toggle";

"${modifier}+a" = "workspace number 0";
"${modifier}+s" = "workspace number 1";
"${modifier}+d" = "workspace number 2";
"${modifier}+f" = "workspace number 3";
"${modifier}+x" = "workspace number 4";
"${modifier}+c" = "workspace number 5";
"${modifier}+v" = "workspace number 6";

"${modifier}+shift+a" = "move workspace number 0";
"${modifier}+shift+s" = "move workspace number 1";
"${modifier}+shift+d" = "move workspace number 2";
"${modifier}+shift+f" = "move workspace number 3";
"${modifier}+shift+x" = "move workspace number 4";
"${modifier}+shift+c" = "move workspace number 5";
"${modifier}+shift+v" = "move workspace number 6";

"${modifier}+e" = "mode \"sink volume\"";
"${modifier}+r" = "mode resize";

"${modifier}+space" = "exec alacritty";
"${modifier}+semicolon" = "exec ${tofi-run} | ${xargs} swaymsg exec --";

"${modifier}+p" = "exec ${de-screenshot}";

"${modifier}+semicolon" = "exec alacritty --class sway-helper -e sway-helper combi";

"XF86AudioRaiseVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
Expand Down Expand Up @@ -201,7 +185,7 @@

floating.criteria = [
{
app_id = "FloatingAlacritty";
app_id = "sway-helper";
}
{
instance = "qjackctl";
Expand Down
2 changes: 2 additions & 0 deletions modules/home-manager/desktop_environment/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
wdisplays
wl-clipboard
xdg-utils

sway-helper
];

xdg = {
Expand Down
1 change: 1 addition & 0 deletions overlays/pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
de-screenshot = pkgs.callPackage ./de-screenshot {};
firefox-private = pkgs.callPackage ./firefox-private {};
media-control = pkgs.callPackage ./media-control {};
sway-helper = pkgs.callPackage ./sway-helper {};
}
1 change: 1 addition & 0 deletions overlays/pkgs/sway-helper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
Loading

0 comments on commit 42fb5c0

Please sign in to comment.