diff --git a/hosts/ymir/configuration.nix b/hosts/ymir/configuration.nix index 738cfac..df90265 100644 --- a/hosts/ymir/configuration.nix +++ b/hosts/ymir/configuration.nix @@ -104,11 +104,6 @@ # Enable light for image control programs.light.enable = true; - programs.river = { - enable = true; - extraPackages = []; - }; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.crony = { isNormalUser = true; diff --git a/hosts/ymir/home.nix b/hosts/ymir/home.nix index a8aa349..a390ef2 100644 --- a/hosts/ymir/home.nix +++ b/hosts/ymir/home.nix @@ -30,7 +30,6 @@ crony.gaming.enable = true; crony.flatpak.enable = true; crony.wayland.enable = true; - crony.river.enable = true; # DO NOT CHANGE ALSO home.stateVersion = "24.11"; # Please read the comment before changing. diff --git a/modules/linux/home-manager/configs/qutebrowser/pyconfig/redirectors.py b/modules/linux/home-manager/configs/qutebrowser/pyconfig/redirectors.py index 2f62c17..22868c6 100644 --- a/modules/linux/home-manager/configs/qutebrowser/pyconfig/redirectors.py +++ b/modules/linux/home-manager/configs/qutebrowser/pyconfig/redirectors.py @@ -17,6 +17,8 @@ REDIRECT_MAP = { "www.tiktok.com": operator.methodcaller("setHost", "proxytok.cronyakatsuki.xyz"), "imgur.com": operator.methodcaller("setHost", "rimgo.cronyakatsuki.xyz"), "www.imgur.com": operator.methodcaller("setHost", "rimgo.cronyakatsuki.xyz"), + "github.com": operator.methodcaller("setHost", "gh.cronyakatsuki.xyz"), + "gist.github.com": operator.methodcaller("setHost", "gh.cronyakatsuki.xyz/gist"), } diff --git a/modules/linux/home-manager/default.nix b/modules/linux/home-manager/default.nix index 3fb86ca..68f7ded 100644 --- a/modules/linux/home-manager/default.nix +++ b/modules/linux/home-manager/default.nix @@ -16,10 +16,8 @@ ./xdg-user-dirs.nix ./qutebrowser.nix ./wayland.nix - ./river.nix ]; - crony.river.enable = lib.mkDefault false; crony.wayland.enable = lib.mkDefault false; crony.qutebrowser.enable = lib.mkDefault true; crony.mangohud.enable = lib.mkDefault false; diff --git a/modules/linux/home-manager/river.nix b/modules/linux/home-manager/river.nix deleted file mode 100644 index 78114ff..0000000 --- a/modules/linux/home-manager/river.nix +++ /dev/null @@ -1,158 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - volume-notify = pkgs.writeShellScriptBin "volume-notify" '' - #!/usr/bin/env sh - - volumep="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" - - case "$volumep" in - *0.0*) volumep="''${volumep##* 0.0}%" ;; - *0.*) volumep="''${volumep##* 0.}%" ;; - *MUTED*) volumep='MUTED' ;; - *) volumep="100%" ;; - esac - - notify-send -h string:x-canonical-private-synchronous:sys-notify "🔊 Volume: ''${volumep}" - ''; - toggle-sound-output = pkgs.writeShellScriptBin "toggle-sound-output" '' - #!/usr/bin/env sh - - speakers="alsa_output.pci-0000_05_00.1.hdmi-stereo" - headphones="alsa_output.usb-Xtrfy_SC1_Xtrfy_SC1-00.analog-stereo" - - current="$(wpctl status -n | grep Audio/Sink | grep -oE '[^ ]+$')" - - if [ "''${current}" = "''${headphones}" ]; then - wpctl set-default "$(pw-cli info $speakers | head -n 1 | awk '{print $2}')" - else - wpctl set-default "$(pw-cli info $headphones | head -n 1 | awk '{print $2}')" - fi - - ''; - power-menu = pkgs.writeShellScriptBin "power-menu" '' - #!/usr/bin/env sh - - case "$(printf "shutdown\\nreboot" | tofi --prompt "Choose your poison")" in - "shutdown") poweroff ;; - "reboot") reboot ;; - esac - ''; -in { - options = { - crony.river.enable = lib.mkEnableOption "Enable and setup river window manager"; - }; - - config = lib.mkIf config.crony.river.enable { - home.packages = with pkgs; [ - playerctl - grim - ]; - - wayland.windowManager.river = { - enable = true; - settings = { - set-repeat = "50 300"; - default-layout = "rivertile"; - keyboard-layout = { - "-options" = { - "'caps:escape,grp:alt_space_toggle'" = "'us,hr'"; - }; - }; - rule-add = { - "-app-id" = { - "'bar'" = "csd"; - "'float*'" = { - "-title" = { - "foo" = "float"; - }; - }; - }; - }; - map = { - normal = { - "Super Return" = "spawn foot"; - "Super Q" = "close"; - "Super+Ctrl E" = "exit"; - "J" = "focus-view next"; - "K" = "focus-view previous"; - "Super+Shift J" = "swap next"; - "Super+Shift K" = "swap previous"; - "Super+Shift Return" = "zoom"; - "Super H" = "send-layout-cmd rivertile 'main-ratio -0.05'"; - "Super L" = "send-layout-cmd rivertile 'main-ratio +0.05'"; - "Super+Shift ." = "send-layout-cmd rivertile 'main-count +1'"; - "Super+Shift ," = "send-layout-cmd rivertile 'main-count -1'"; - "Super+Shift Space" = "toggle-float"; - "Super F" = "toggle-fullscreen"; - "Super D" = "spawn 'tofi-run | xargs riverctl dispatch exec --'"; - "Super+Shift D" = "spawn 'tofi-drun | xargs riverctl dispatch exec --'"; - "Super+Shift L" = "spawn 'hyprlock --immediate'"; - "Super B" = "spawn qutebrowser"; - "Super+Shift B" = "spawn librewolf"; - "Super F1" = "spawn '${toggle-sound-output}/bin/toggle-sound-output'"; - "Super E" = "spawn '${power-menu}/bin/power-menu'"; - "Super F12" = "spawn 'grim ${config.xdg.userDirs.pictures}/screenshots/$(date +%s_grim.png)'"; - "Super V" = "spawn 'cliphist list | tofi --horizontal false --height 380 | cliphist decode | wl-copy'"; - }; - }; - map-pointer = { - normal = { - "Super BTN_LEFT" = "move-view"; - "Super BTN_RIGHT" = "resize-view"; - "Super BTN_MIDDLE" = "toggle-float"; - }; - }; - spawn = [ - "wl-paste --type text --watch cliphist store" # Stores only text data - "wl-paste --type image --watch cliphist store" # Stores only image data - "keepassxc" # Startup my password manager - "waybar" # Start waybar on start - ]; - }; - systemd = { - enable = true; - }; - xwayland.enable = true; - extraConfig = '' - for i in $(seq 1 9) - do - tags=$((1 << ($i - 1))) - - # Super+[1-9] to focus tag [0-8] - riverctl map normal Super $i set-focused-tags $tags - - # Super+Shift+[1-9] to tag focused view with tag [0-8] - riverctl map normal Super+Shift $i set-view-tags $tags - - # Super+Control+[1-9] to toggle focus of tag [0-8] - riverctl map normal Super+Control $i toggle-focused-tags $tags - - # Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view - riverctl map normal Super+Shift+Control $i toggle-view-tags $tags - done - - for mode in normal locked - do - riverctl map $mode None XF86AudioRaiseVolume spawn 'pctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ --limit 1 && ${volume-notify}/bin/volume-notify' - riverctl map $mode None XF86AudioLowerVolume spawn 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- --limit 1 && ${volume-notify}/bin/volume-notify' - riverctl map $mode None XF86AudioMute spawn 'wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && ${volume-notify}/bin/volume-notify' - - riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' - riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' - riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' - riverctl map $mode None XF86AudioNext spawn 'playerctl next' - - riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 10' - riverctl map $mode None XF86MonBrightnessDown spawn 'light -D 10' - done - - - rivertile -view-padding 6 -outer-padding 6 & - ''; - }; - }; -} diff --git a/modules/linux/home-manager/wayland.nix b/modules/linux/home-manager/wayland.nix index f4056b2..81857f4 100644 --- a/modules/linux/home-manager/wayland.nix +++ b/modules/linux/home-manager/wayland.nix @@ -137,21 +137,25 @@ padding-left: 10px; } - #tags { + #workspaces { background-color: @base01; margin: 0.25em; border-radius: 1em; } - #tags button { + #workspaces button { padding: 0 0.5em; - color: @base03; - } - - #tags button.occupied { color: @base06; } - #tags button.focused { + #workspaces button.empty { + color: @base03; + } + + #workspaces button.visible { + color: @base06; + } + + #workspaces button.active { color: @base0D; } @@ -185,8 +189,8 @@ mainBar = { height = 34; modules-left = [ - "river/tags" - "river/window" + "hyprland/workspaces" + "hyprland/window" ]; modules-center = [ ]; @@ -199,8 +203,10 @@ "clock" "tray" ]; - "river/window" = { - max-length = 50; + "hyprland/workspaces" = { + persistent-workspaces = { + "*" = [1 2 3 4 5 6 7 8 9]; + }; }; disk = { path = "/";