mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-14 04:07:18 +00:00
Compare commits
6 commits
c5074480ec
...
aa8cc54140
Author | SHA1 | Date | |
---|---|---|---|
ItsDrike | aa8cc54140 | ||
ItsDrike | 5ac92f8d3d | ||
ItsDrike | bb39670cd1 | ||
ItsDrike | 0f4d3f1e05 | ||
ItsDrike | 98f1ed0089 | ||
ItsDrike | 14d5cf5261 |
|
@ -1,5 +1,6 @@
|
||||||
_: {
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./shared.nix
|
./shared.nix
|
||||||
|
./desktop.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
18
home/packages/cli/desktop.nix
Normal file
18
home/packages/cli/desktop.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
osConfig,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
|
||||||
|
devType = osConfig.myOptions.device.roles.type;
|
||||||
|
acceptedTypes = [ "laptop" "desktop" ];
|
||||||
|
in {
|
||||||
|
config = mkIf (builtins.elem devType acceptedTypes) {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
trash-cli
|
||||||
|
bitwarden-cli
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
wayland.windowManager.hyprland.settings = {
|
wayland.windowManager.hyprland = {
|
||||||
|
settings = {
|
||||||
"$MOUSE_LMB" = "mouse:272";
|
"$MOUSE_LMB" = "mouse:272";
|
||||||
"$MOUSE_RMB" = "mouse:273";
|
"$MOUSE_RMB" = "mouse:273";
|
||||||
"$MOUSE_MMB" = "mouse:274";
|
"$MOUSE_MMB" = "mouse:274";
|
||||||
|
@ -29,6 +30,7 @@
|
||||||
#
|
#
|
||||||
# TODO: Requires programs
|
# TODO: Requires programs
|
||||||
"SUPER_SHIFT, L, exec, wlogout -p layer-shell"
|
"SUPER_SHIFT, L, exec, wlogout -p layer-shell"
|
||||||
|
"SUPER_CTRL, L, exec, loginctl lock-session"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Screenshots
|
# Screenshots
|
||||||
|
@ -38,18 +40,17 @@
|
||||||
#
|
#
|
||||||
# Brightness control
|
# Brightness control
|
||||||
#
|
#
|
||||||
# TODO: requires script
|
"SUPER, Right, exec, brightness 5%+"
|
||||||
|
"SUPER, Left, exec, brightness 5%-"
|
||||||
|
", XF86MonBrightnessUp, exec, brightness 5%+"
|
||||||
|
", XF86MonBrightnessDown, exec, brightness 5%-"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Audio/Volume control
|
# Audio/Volume control
|
||||||
#
|
#
|
||||||
"SUPER, Down, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
|
|
||||||
"SUPER, Up, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"
|
|
||||||
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
|
|
||||||
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"
|
|
||||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||||
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||||
|
# (rest in binde section)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Notifications
|
# Notifications
|
||||||
|
@ -89,7 +90,10 @@
|
||||||
#
|
#
|
||||||
# Move floating windows
|
# Move floating windows
|
||||||
#
|
#
|
||||||
# TODO: requires script (move-window.sh)
|
"SUPER_ALT, left, exec, hyprland-move-window 100 l"
|
||||||
|
"SUPER_ALT, right, exec, hyprland-move-window 100 r"
|
||||||
|
"SUPER_ALT, up, exec, hyprland-move-window 100 u"
|
||||||
|
"SUPER_ALT, down, exec, hyprland-move-window 100 d"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Override split direction for next window (manual tiling)
|
# Override split direction for next window (manual tiling)
|
||||||
|
@ -153,22 +157,101 @@
|
||||||
"SUPER_SHIFT, mouse_up, focusmonitor, -1"
|
"SUPER_SHIFT, mouse_up, focusmonitor, -1"
|
||||||
"SUPER_SHIFT, bracketright, focusmonitor, +1"
|
"SUPER_SHIFT, bracketright, focusmonitor, +1"
|
||||||
"SUPER_SHIFT, bracketleft, focusmonitor, -1"
|
"SUPER_SHIFT, bracketleft, focusmonitor, -1"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Mouse bindings
|
||||||
|
bindm = [
|
||||||
|
#
|
||||||
|
# Mouse window resizing
|
||||||
|
#
|
||||||
|
"SUPER, $MOUSE_LMB, movewindow"
|
||||||
|
"SUPER, $MOUSE_RMB, resizewindow"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Repeat bindings
|
||||||
|
binde = [
|
||||||
|
#
|
||||||
|
# Audio/Volume control
|
||||||
|
#
|
||||||
|
"SUPER, Down, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
|
||||||
|
"SUPER, Up, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"
|
||||||
|
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"
|
||||||
|
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"
|
||||||
|
# (rest in bind section)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Window resizing
|
# Window resizing
|
||||||
#
|
#
|
||||||
# TODO: Submaps + binde
|
"ALT, right, resizeactive, 10 0"
|
||||||
|
"ALT, left, resizeactive, -10 0"
|
||||||
|
"ALT, up, resizeactive, 0 -10"
|
||||||
|
"ALT, down, resizeactive, 0 10 "
|
||||||
|
"ALT, H, resizeactive, -10 0"
|
||||||
|
"ALT, K, resizeactive, 0 -10"
|
||||||
|
"ALT, J, resizeactive, 0 10"
|
||||||
|
"ALT, L, resizeactive, 10 0"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Used for submaps, which don't support `settings`
|
||||||
|
extraConfig = ''
|
||||||
#
|
#
|
||||||
# Isolation group
|
# Isolation group
|
||||||
#
|
#
|
||||||
# TODO: Submaps
|
|
||||||
];
|
|
||||||
|
|
||||||
bindm = [
|
# Useful to prevent keybind capturing (for games, etc)
|
||||||
# Mouse window resizing
|
# SUPER + Fn + F12 (Favorites)
|
||||||
"SUPER, $MOUSE_LMB, movewindow"
|
bind = SUPER, XF86Favorites, exec, hyprctl dispatch submap isolate && notify-send "Keybind isolation" "Keybind isolation on"
|
||||||
"SUPER, $MOUSE_RMB, resizewindow"
|
submap = isolate
|
||||||
];
|
bind = SUPER, XF86Favorites, exec, hyprctl dispatch submap reset && notify-send "Keybind isolation" "Keybind isolation off"
|
||||||
|
submap = reset
|
||||||
|
|
||||||
|
#
|
||||||
|
# Precise keyboard window resizing
|
||||||
|
#
|
||||||
|
|
||||||
|
bind = SUPER, slash, submap, resize
|
||||||
|
submap = resize
|
||||||
|
|
||||||
|
binde = , right, resizeactive, 10 0
|
||||||
|
binde = , left, resizeactive, -10 0
|
||||||
|
binde = , up, resizeactive, 0 -10
|
||||||
|
binde = , down, resizeactive, 0 10
|
||||||
|
|
||||||
|
binde = SUPER, right, resizeactive, 30 0
|
||||||
|
binde = SUPER, left, resizeactive, -30 0
|
||||||
|
binde = SUPER, up, resizeactive, 0 -30
|
||||||
|
binde = SUPER, down, resizeactive, 0 30
|
||||||
|
|
||||||
|
binde = SHIFT, right, resizeactive, 1 0
|
||||||
|
binde = SHIFT, left, resizeactive, -1 0
|
||||||
|
binde = SHIFT, up, resizeactive, 0 -1
|
||||||
|
binde = SHIFT, down, resizeactive, 0 1
|
||||||
|
|
||||||
|
binde = , H, resizeactive, -10 0
|
||||||
|
binde = , K, resizeactive, 0 -10
|
||||||
|
binde = , J, resizeactive, 0 10
|
||||||
|
binde = , L, resizeactive, 10 0
|
||||||
|
|
||||||
|
binde = , right, resizeactive, 10 0
|
||||||
|
binde = , left, resizeactive, -10 0
|
||||||
|
binde = , up, resizeactive, 0 -10
|
||||||
|
binde = , down, resizeactive, 0 10
|
||||||
|
|
||||||
|
binde = SUPER, H, resizeactive, -30 0
|
||||||
|
binde = SUPER, K, resizeactive, 0 -30
|
||||||
|
binde = SUPER, J, resizeactive, 0 30
|
||||||
|
binde = SUPER, L, resizeactive, 30 0
|
||||||
|
|
||||||
|
binde = SHIFT, H, resizeactive, -1 0
|
||||||
|
binde = SHIFT, K, resizeactive, 0 -1
|
||||||
|
binde = SHIFT, J, resizeactive, 0 1
|
||||||
|
binde = SHIFT, L, resizeactive, 1 0
|
||||||
|
|
||||||
|
bind = , escape, submap, reset
|
||||||
|
bind = , return, submap, reset
|
||||||
|
bind = SUPER, slash, submap, reset
|
||||||
|
submap = reset
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,101 @@
|
||||||
{
|
{
|
||||||
wayland.windowManager.hyprland.settings = {
|
wayland.windowManager.hyprland.settings = {
|
||||||
windowrulev2 = [
|
windowrulev2 = [
|
||||||
# TODO: Add these
|
#
|
||||||
|
# Assigned workspaces
|
||||||
|
#
|
||||||
|
"workspace, 2, class:^(firefox)$"
|
||||||
|
"workspace 4, class:^(discord)$"
|
||||||
|
"workspace 4, class:^(vesktop)$"
|
||||||
|
"workspace 4, class:^(WebCord)$"
|
||||||
|
"workspace 5, class:^(Spotify)$"
|
||||||
|
"workspace 6, class:^(Stremio)$"
|
||||||
|
"workspace 6, class:^(com.stremio.stremio)$"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Idle inhibition
|
||||||
|
#
|
||||||
|
"idleinhibit focus, class:^(Stremio)$"
|
||||||
|
"idleinhibit focus, class:^(com.stremio.stremio)$"
|
||||||
|
"idleinhibit focus, class:^(mpv)$"
|
||||||
|
"idleinhibit focus, class:^(firefox)$,title:^(.+ - YouTube — Mozilla Firefox)$"
|
||||||
|
"idleinhibit focus, class:^(firefox)$,title:^(Picture-in-Picture)$"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Correct size / Auto tile
|
||||||
|
#
|
||||||
|
"size 800 550, class:^(qalculate-gtk)$"
|
||||||
|
"tile, class:^(Spotify)$"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Auto float
|
||||||
|
#
|
||||||
|
"float, class:^(Lxappearance)$"
|
||||||
|
"float, class:^(Rofi)$"
|
||||||
|
"float, class:^(feh)$"
|
||||||
|
"float, class:^(pavucontrol-qt)$"
|
||||||
|
"float, class:^(pavucontrol)$"
|
||||||
|
"float, class:^(file-roller)$"
|
||||||
|
"float, class:^(qalculate-gtk)$"
|
||||||
|
"float, class:^(com.github.wwmm.easyeffects)"
|
||||||
|
"float, class:^(opensnitch_ui)$"
|
||||||
|
"float, class:^(Brave-browser)$,title:^(_crx_.+)$"
|
||||||
|
"float, class:^(hyprland-share-picker)$"
|
||||||
|
"float,class:^(floating)$"
|
||||||
|
|
||||||
|
"center, class:^(hyprland-share-picker)$"
|
||||||
|
"animation slide, class:^(hyprland-share-picker)$"
|
||||||
|
|
||||||
|
# Float firefox windows (like bookmark menus, or some extension windows)
|
||||||
|
"float, class:^(firefox)$,title:^(Revert Bookmarks)$"
|
||||||
|
"float, class:^(firefox)$,title:^(Library)$"
|
||||||
|
"float, class:^(firefox)$,title:^(Extension: \(uBlock Origin\))"
|
||||||
|
"float, class:^(firefox)$,title:^(Firefox — Sharing Indicator)$"
|
||||||
|
"float, class:^(firefox)$,title:^(Opening .+)$"
|
||||||
|
"float, class:^(firefox)$,title:^$"
|
||||||
|
|
||||||
|
# Float some pcmanfm windows
|
||||||
|
"float, class:^(pcmanfm-qt)$,title:^(Mount)$"
|
||||||
|
"float, class:^(pcmanfm-qt)$,title:^(Preferences)$"
|
||||||
|
"float, class:^(pcmanfm-qt)$,title:^(Move files)$"
|
||||||
|
"float, class:^(pcmanfm-qt)$,title:^(Search Files)$"
|
||||||
|
"float, class:^(pcmanfm-qt)$,title:^(Copy Files)$"
|
||||||
|
"float, class:^(pcmanfm-qt)$,title:^(Confirm to replace files)$"
|
||||||
|
|
||||||
|
# Float some windows from other apps
|
||||||
|
"float, class:^(Spotify)$,title:^(Ozone X11)$"
|
||||||
|
"float, class:^(python3)$,title:^(Tor Browser Launcher Settings)$"
|
||||||
|
"float, class:^(python3)$,title:^(Tor Browser)$"
|
||||||
|
|
||||||
|
# General float rules
|
||||||
|
"float, class:^(file_progress)$"
|
||||||
|
"float, class:^(confirm)$"
|
||||||
|
"float, class:^(dialog)$"
|
||||||
|
"float, class:^(download)$"
|
||||||
|
"float, class:^(notification)$"
|
||||||
|
"float, class:^(error)$"
|
||||||
|
"float, class:^(splash)$"
|
||||||
|
"float, class:^(confirmreset)$"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Fixes
|
||||||
|
#
|
||||||
|
|
||||||
|
# Jetbrains
|
||||||
|
"windowdance, class:^(jetbrains-.*)$,floating:1"
|
||||||
|
"center, class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
|
||||||
|
"nofocus, class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
|
||||||
|
"noborder, class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
|
||||||
|
"center, class:^(jetbrains-.*)$,title:^( )$,floating:1"
|
||||||
|
"stayfocused, class:^(jetbrains-.*)$,title:^( )$,floating:1"
|
||||||
|
"noborder, class:^(jetbrains-.*)$,title:^( )$,floating:1"
|
||||||
|
"nofocus, class:^(jetbrains-.*)$,title:^(win.*)$,floating:1"
|
||||||
|
"noinitialfocus, class:^(jetbrains-.*)$,title:^(win.*)$"
|
||||||
|
];
|
||||||
|
|
||||||
|
layerrule = [
|
||||||
|
# Don't add borders to grim selections when taking screenshots
|
||||||
|
"noanim, ^(selection)$"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
|
|
||||||
inherit (import ./packages {inherit pkgs;}) hyprland-swap-workspace;
|
hyprPkgs = (import ./packages {inherit pkgs;});
|
||||||
|
|
||||||
cfg = osConfig.myOptions.home-manager.wms.hyprland;
|
cfg = osConfig.myOptions.home-manager.wms.hyprland;
|
||||||
in {
|
in {
|
||||||
|
@ -15,8 +15,11 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = [
|
||||||
hyprland-swap-workspace
|
hyprPkgs.hyprland-swap-workspace
|
||||||
|
hyprPkgs.hyprland-move-window
|
||||||
|
pkgs.brightnessctl
|
||||||
|
hyprPkgs.brightness
|
||||||
];
|
];
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# This is mainly a wrapper, acting as just: `brightnessctl s $1`
|
||||||
|
# However, in addition, this will also produce a notification with
|
||||||
|
# the brightness level shown as a progress bar.
|
||||||
|
|
||||||
|
# Send brightness level desktop notification, showing the given brightness level
|
||||||
|
# as progress bar, along with given message.
|
||||||
|
# $1 - brightness level (number 0-100)
|
||||||
|
send_brightness_notify() {
|
||||||
|
percent_brightness="$1"
|
||||||
|
|
||||||
|
notify-send \
|
||||||
|
--app-name="brightness" \
|
||||||
|
--urgency="normal" \
|
||||||
|
-h int:value:$percent_brightness \
|
||||||
|
-h string:synchronous:brightness \
|
||||||
|
"brightness" "Level: $percent_brightness"
|
||||||
|
}
|
||||||
|
|
||||||
|
out="$(brightnessctl s "$1")"
|
||||||
|
cur_percent="$(echo "$out" | grep "Current" | grep -oP '\(\d+%' | tr -d '()%')"
|
||||||
|
send_brightness_notify "$cur_percent"
|
|
@ -0,0 +1,4 @@
|
||||||
|
{pkgs, ...}:
|
||||||
|
pkgs.writeShellScriptBin "brightness" ''
|
||||||
|
${builtins.readFile ./brightness.sh}
|
||||||
|
''
|
|
@ -3,7 +3,9 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
packages = {
|
packages = {
|
||||||
hyprland-swap-workspace = pkgs.callPackage ./hyprland-swap-workspace.nix {};
|
hyprland-swap-workspace = pkgs.callPackage ./hyprland-swap-workspace {};
|
||||||
|
hyprland-move-window = pkgs.callPackage ./hyprland-move-window {};
|
||||||
|
brightness = pkgs.callPackage ./brightness {};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
packages
|
packages
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{pkgs, ...}:
|
||||||
|
pkgs.writeShellScriptBin "hyprland-move-window" ''
|
||||||
|
${builtins.readFile ./hyprland-move-window.sh}
|
||||||
|
''
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
RESIZE_SIZE=${1:?Missing resize size}
|
||||||
|
|
||||||
|
RESIZE_PARAMS_X=0
|
||||||
|
RESIZE_PARAMS_Y=0
|
||||||
|
|
||||||
|
DIRECTION=${2:?Missing move direction}
|
||||||
|
case $DIRECTION in
|
||||||
|
l)
|
||||||
|
RESIZE_PARAMS_X=-$RESIZE_SIZE
|
||||||
|
;;
|
||||||
|
r)
|
||||||
|
RESIZE_PARAMS_X=$RESIZE_SIZE
|
||||||
|
;;
|
||||||
|
u)
|
||||||
|
RESIZE_PARAMS_Y=-$RESIZE_SIZE
|
||||||
|
;;
|
||||||
|
d)
|
||||||
|
RESIZE_PARAMS_Y=$RESIZE_SIZE
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "kbye"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ACTIVE_WINDOW=$(hyprctl activewindow -j)
|
||||||
|
IS_FLOATING=$(echo "$ACTIVE_WINDOW" | jq .floating)
|
||||||
|
|
||||||
|
if [ "$IS_FLOATING" = "true" ]; then
|
||||||
|
hyprctl dispatch moveactive "$RESIZE_PARAMS_X" "$RESIZE_PARAMS_Y"
|
||||||
|
else
|
||||||
|
hyprctl dispatch movewindow "$DIRECTION"
|
||||||
|
fi
|
Loading…
Reference in a new issue