mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-14 21:57:17 +00:00
Compare commits
No commits in common. "7a79342f93e15d8fead502af6dbde8406e09acfc" and "1527b7f9b9021f4ead8e42deb980330e7c333436" have entirely different histories.
7a79342f93
...
1527b7f9b9
|
@ -4,7 +4,8 @@
|
||||||
source "./scripts/include"
|
source "./scripts/include"
|
||||||
|
|
||||||
if [ "$1" = "--switch" ]; then
|
if [ "$1" = "--switch" ]; then
|
||||||
hyprctl dispatch focusworkspaceoncurrentmonitor "$2" >/dev/null
|
$HOME/.local/bin/scripts/gui/hyprland/swap-workspace "$2" >/dev/null
|
||||||
|
# hyprctl dispatch workspace "$2" >/dev/null
|
||||||
elif [ "$1" = "--loop" ]; then
|
elif [ "$1" = "--loop" ]; then
|
||||||
hyprland_ipc "workspace|createworkspace|destroyworkspace" | ./scripts/workspaces.py "$@"
|
hyprland_ipc "workspace|createworkspace|destroyworkspace" | ./scripts/workspaces.py "$@"
|
||||||
else
|
else
|
||||||
|
|
|
@ -107,15 +107,15 @@
|
||||||
#
|
#
|
||||||
# Switch workspace (swapping to current monitor)
|
# Switch workspace (swapping to current monitor)
|
||||||
#
|
#
|
||||||
"SUPER, 1, focusworkspaceoncurrentmonitor, 1"
|
"SUPER, 1, exec, hyprland-swap-workspace 1"
|
||||||
"SUPER, 2, focusworkspaceoncurrentmonitor, 2"
|
"SUPER, 2, exec, hyprland-swap-workspace 2"
|
||||||
"SUPER, 3, focusworkspaceoncurrentmonitor, 3"
|
"SUPER, 3, exec, hyprland-swap-workspace 3"
|
||||||
"SUPER, 4, focusworkspaceoncurrentmonitor, 4"
|
"SUPER, 4, exec, hyprland-swap-workspace 4"
|
||||||
"SUPER, 5, focusworkspaceoncurrentmonitor, 5"
|
"SUPER, 5, exec, hyprland-swap-workspace 5"
|
||||||
"SUPER, 6, focusworkspaceoncurrentmonitor, 6"
|
"SUPER, 6, exec, hyprland-swap-workspace 6"
|
||||||
"SUPER, 7, focusworkspaceoncurrentmonitor, 7"
|
"SUPER, 7, exec, hyprland-swap-workspace 7"
|
||||||
"SUPER, 8, focusworkspaceoncurrentmonitor, 8"
|
"SUPER, 8, exec, hyprland-swap-workspace 8"
|
||||||
"SUPER, 9, focusworkspaceoncurrentmonitor, 9"
|
"SUPER, 9, exec, hyprland-swap-workspace 9"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Move window to workspace
|
# Move window to workspace
|
||||||
|
|
|
@ -16,6 +16,7 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
|
hyprPkgs.hyprland-swap-workspace
|
||||||
hyprPkgs.hyprland-move-window
|
hyprPkgs.hyprland-move-window
|
||||||
pkgs.brightnessctl
|
pkgs.brightnessctl
|
||||||
hyprPkgs.brightness
|
hyprPkgs.brightness
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
packages = {
|
packages = {
|
||||||
|
hyprland-swap-workspace = pkgs.callPackage ./hyprland-swap-workspace {};
|
||||||
hyprland-move-window = pkgs.callPackage ./hyprland-move-window {};
|
hyprland-move-window = pkgs.callPackage ./hyprland-move-window {};
|
||||||
brightness = pkgs.callPackage ./brightness {};
|
brightness = pkgs.callPackage ./brightness {};
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
{pkgs, ...}:
|
||||||
|
pkgs.writeShellScriptBin "hyprland-swap-workspace" ''
|
||||||
|
${builtins.readFile ./hyprland-swap-workspace.sh}
|
||||||
|
''
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
WORKSPACE="$1"
|
||||||
|
|
||||||
|
monitors_out="$(hyprctl monitors -j)"
|
||||||
|
focused_mon="$(echo "$monitors_out" | jq '.[] | select(.focused==true) | .id')"
|
||||||
|
focused_wks="$(echo "$monitors_out" | jq '.[].activeWorkspace.id')"
|
||||||
|
|
||||||
|
# Workspace is already focused, check on which monitor
|
||||||
|
if echo "$focused_wks" | grep "$WORKSPACE" >/dev/null; then
|
||||||
|
mon_id="$(echo "$monitors_out" | jq ".[] | select(.activeWorkspace.id==$WORKSPACE) | .id")"
|
||||||
|
|
||||||
|
# If the workspace is focused on the active monitor, don't do anything (we're here).
|
||||||
|
# Otherwise, swap the workspaces.
|
||||||
|
if [ "$mon_id" -ne "$focused_mon" ]; then
|
||||||
|
hyprctl dispatch swapactiveworkspaces "$focused_mon" "$mon_id"
|
||||||
|
fi
|
||||||
|
# Switching to an unfocused workspace, always move it to focused monitor
|
||||||
|
else
|
||||||
|
hyprctl dispatch moveworkspacetomonitor "$WORKSPACE" "$focused_mon"
|
||||||
|
hyprctl dispatch workspace "$WORKSPACE"
|
||||||
|
fi
|
|
@ -39,9 +39,4 @@
|
||||||
"x-scheme-handler/msteams" = ["teams.desktop"]; # I need it for school, don't judge me
|
"x-scheme-handler/msteams" = ["teams.desktop"]; # I need it for school, don't judge me
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.sessionVariables = {
|
|
||||||
BROWSER = "firefox";
|
|
||||||
DEFAULT_BROWSER = "firefox";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,13 +70,11 @@
|
||||||
".local/share/nvim"
|
".local/share/nvim"
|
||||||
".local/state/nvim"
|
".local/state/nvim"
|
||||||
".local/share/zsh"
|
".local/share/zsh"
|
||||||
".local/share/Smart Code ltd/Stremio"
|
|
||||||
".local/share/cargo"
|
".local/share/cargo"
|
||||||
".local/share/go"
|
".local/share/go"
|
||||||
];
|
];
|
||||||
extraFiles = [
|
extraFiles = [
|
||||||
".config/git/git-credentials"
|
".config/git/git-credentials"
|
||||||
".cache/walker/history.gob"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
@ -13,13 +12,6 @@ in {
|
||||||
enable = mkDefault false; # this just enables ALSA, which we don't really care abouyt
|
enable = mkDefault false; # this just enables ALSA, which we don't really care abouyt
|
||||||
mediaKeys.enable = true;
|
mediaKeys.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
# TUI tool to manage sound devices & levels
|
|
||||||
# It's made for pulseaudio, but it will work with pipewire too since we
|
|
||||||
# run a compatibility layer for pulse
|
|
||||||
pulsemixer
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue