From b7794c0bca0e3314fb66638113b70466a587b717 Mon Sep 17 00:00:00 2001 From: sioodmy Date: Tue, 12 Nov 2024 22:43:40 +0100 Subject: [PATCH] cleanup: remove unused packages --- user/river/binds.nix | 99 ------------------------------- user/river/default.nix | 18 ------ user/river/init.nix | 71 ---------------------- user/river/scripts/infoscript.nix | 23 ------- user/river/scripts/osd.nix | 40 ------------- user/swaylock/default.nix | 52 ---------------- 6 files changed, 303 deletions(-) delete mode 100644 user/river/binds.nix delete mode 100644 user/river/default.nix delete mode 100644 user/river/init.nix delete mode 100644 user/river/scripts/infoscript.nix delete mode 100644 user/river/scripts/osd.nix delete mode 100644 user/swaylock/default.nix diff --git a/user/river/binds.nix b/user/river/binds.nix deleted file mode 100644 index fc7fcf41..00000000 --- a/user/river/binds.nix +++ /dev/null @@ -1,99 +0,0 @@ -{pkgs, ...}: let - inherit (builtins) concatStringsSep map; - inherit (pkgs.lib) getExe; - binds-normal = [ - # note that we call footclient from vanilla unwrapped foot package - "Super+Shift Return spawn ${pkgs.foot}/bin/footclient" - "None XF86Favorites spawn infoscript" - "None XF86Keyboard spawn tofi-emoji" - "None XF86Display spawn swaylock" - "Super Space spawn 'tofi-run | xargs -0 riverctl spawn'" - "Super+Shift S spawn '${getExe pkgs.slurp} | ${getExe pkgs.grim} -g - - | ${pkgs.wl-clipboard}/bin/wl-copy'" - - "Super Q close" - - # focus windows - "Super J focus-view next" - "Super K focus-view previous" - - "Super+Shift J swap next" - "Super+Shift J swap previous" - - # yoinks focused view into top of layout stack - "Super Return zoom" - - "Super H send-layout-cmd rivercarro 'main-ratio -0.05'" - "Super L send-layout-cmd rivercarro 'main-ratio +0.05'" - - "Super+Shift H send-layout-cmd rivercarro 'main-count +1'" - "Super+Shift L send-layout-cmd rivercarro 'main-count -1'" - - # toggle layouts - "Super M send-layout-cmd rivercarro 'main-location-cycle left,monocle'" - - # move floating windows around - "Super+Alt H move left 50" - "Super+Alt J move down 50" - "Super+Alt K move up 50" - "Super+Alt L move right 50" - - # resize floating windows - "Super+Alt+Shift H resize horizontal -50" - "Super+Alt+Shift J resize vertical 50" - "Super+Alt+Shift K resize vertical -50" - "Super+Alt+Shift L resize horizontal -50" - - "Super V toggle-float" - "Super F toggle-fullscreen" - - "Super Up send-layout-cmd rivercarro 'main-location top'" - "Super Right send-layout-cmd rivercarro 'main-location right'" - "Super Down send-layout-cmd rivercarro 'main-location bottom'" - "Super Left send-layout-cmd rivercarro 'main-location left'" - ]; -in - pkgs.writeShellScript "river-init-binds" '' - #!/bin/sh - - ${concatStringsSep "\n" - (map - ( - bind: "riverctl map normal ${bind}" - ) - binds-normal)} - - # Super + Left Mouse Button to move views - riverctl map-pointer normal Super BTN_LEFT move-view - - # Super + Right Mouse Button to resize views - riverctl map-pointer normal Super BTN_RIGHT resize-view - - for i in $(seq 1 9) - do - tags=$((1 << ($i - 1))) - - riverctl map normal Super $i spawn "${getExe pkgs.river-bnf} $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 'mako-osd volume up' - riverctl map $mode None XF86AudioLowerVolume spawn 'mako-osd volume down' - riverctl map $mode None XF86AudioMute spawn 'mako-osd volume mute' - - riverctl map $mode None XF86MonBrightnessUp spawn 'mako-osd backlight up' - riverctl map $mode None XF86MonBrightnessDown spawn 'mako-osd backlight down' - done - - - '' diff --git a/user/river/default.nix b/user/river/default.nix deleted file mode 100644 index 7adb49dc..00000000 --- a/user/river/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - pkgs, - theme, - ... -}: -# https://github.com/viperML/wrapper-manager/issues/14 -pkgs.symlinkJoin { - name = "river-wrapped"; - paths = [ - pkgs.river - (import ./scripts/infoscript.nix pkgs) - (import ./scripts/osd.nix pkgs) - ]; - buildInputs = [pkgs.makeWrapper]; - postBuild = '' - wrapProgram $out/bin/river --add-flags "-c ${import ./init.nix {inherit pkgs theme;}}"; - ''; -} diff --git a/user/river/init.nix b/user/river/init.nix deleted file mode 100644 index bca61afd..00000000 --- a/user/river/init.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - pkgs, - theme, - ... -}: let - init-binds = import ./binds.nix {inherit pkgs;}; - inherit (pkgs.lib) getExe; - - # river does not support zwp_idle_inhibit_manager_v1 protocol, - # so instead I used this oneliner combined with swayidle - idle = x: ''"sh -c \"${getExe pkgs.playerctl} status || ${x}\""''; -in - pkgs.writeShellScript "river-init" '' - #!/bin/sh - - dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=river - - ${init-binds} - - TOUCHPAD="pointer-1739-52619-SYNA8004:00_06CB:CD8B_Touchpad" - TRACKPOINT="pointer-2-10-TPPS/2_Elan_TrackPoint" - - riverctl input $TOUCHPAD pointer-accel 0.1 - riverctl input $TOUCHPAD accel-profile adaptive - riverctl input $TOUCHPAD click-method clickfinger - riverctl input $TOUCHPAD drag disabled - riverctl input $TOUCHPAD natural-scroll enabled - riverctl input $TOUCHPAD tap enabled - riverctl input $TOUCHPAD tap-button-map left-right-middle - riverctl input $TOUCHPAD scroll-method two-finger - - riverctl input $TRACKPOINT pointer-accel -0.3 - - riverctl rule-add -title "Open As" float - riverctl rule-add -title "Open File" float - riverctl rule-add -title "Open Folder" float - riverctl rule-add -title "Open" float - riverctl rule-add -title "Save As" float - riverctl rule-add -title "Save File" float - riverctl rule-add -title "Save Folder" float - riverctl rule-add -title "Save" float - - riverctl keyboard-layout -options "caps:escape" pl - riverctl set-repeat 30 350 - - riverctl background-color "0x${theme.base01}" - riverctl border-color-focused "0x${theme.base04}" - riverctl border-color-unfocused "0x${theme.base02}" - riverctl border-width 4 - - riverctl default-layout rivercarro - ${getExe pkgs.rivercarro} -inner-gaps 5 -outer-gaps 3 -per-tag & - - riverctl xcursor-theme "Bibata-Modern-Classic" 18 - - # TODO: Make systemd user services instead - - foot --server & - mako & - signal-desktop & - kanshi & - - ${getExe pkgs.swayidle} \ - timeout 135 ${idle "swaylock --grace 5"} \ - timeout 600 ${idle "systemctl suspend"} \ - before-sleep ${idle "swaylock"} \ - lock "swaylock" & - - # your eyes and your sleep schedule will thank you - ${getExe pkgs.wlsunset} -l 50.2597 -L 19.0211 & - '' diff --git a/user/river/scripts/infoscript.nix b/user/river/scripts/infoscript.nix deleted file mode 100644 index e6e01fde..00000000 --- a/user/river/scripts/infoscript.nix +++ /dev/null @@ -1,23 +0,0 @@ -{pkgs, ...}: -# Instead of bar (imagine wasting so much space on your screen) -# I use this script -pkgs.writeShellScriptBin "infoscript" '' - #!/bin/sh - - VOL="$(${pkgs.pamixer}/bin/pamixer --get-volume)" - BAT_TEXT="" - - if [[ -d /sys/class/power_supply/BAT0 ]]; then - BAT="$(cat /sys/class/power_supply/BAT0/capacity)" - BAT_STATUS="$(cat /sys/class/power_supply/BAT0/status)" - BAT_TEXT="\nBattery is at $BAT% ($BAT_STATUS)" - fi - - ${pkgs.libnotify}/bin/notify-send \ - -t 3000 \ - --hint=string:x-dunst-stack-tag:infoscript \ - --hint=string:synchronous:infoscript \ - "$(date +%H:%M)" \ - "$(date +"%a, %d.%m")$BAT_TEXT\nVolume $VOL%" - -'' diff --git a/user/river/scripts/osd.nix b/user/river/scripts/osd.nix deleted file mode 100644 index 9e4b05ae..00000000 --- a/user/river/scripts/osd.nix +++ /dev/null @@ -1,40 +0,0 @@ -{pkgs, ...}: let - pamixer = "${pkgs.pamixer}/bin/pamixer"; - brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; -in - pkgs.writeShellScriptBin "mako-osd" '' - #!/bin/sh - - if [[ "$1" == "volume" ]]; then - if [[ "$2" == "up" ]]; then - ${pamixer} -i 5 - - elif [[ "$2" == "down" ]]; then - ${pamixer} -d 5 - elif [[ "$2" == "mute" ]]; then - ${pamixer} -t - fi - - TAG="vol" - VAL="$(${pamixer} --get-volume)" - LABEL="Volume $([[ $(${pamixer} --get-mute) == true ]] && printf '(Muted)')" - - elif [[ "$1" == "backlight" ]]; then - if [[ "$2" == "up" ]]; then - ${brightnessctl} set +5% - - elif [[ "$2" == "down" ]]; then - ${brightnessctl} set 5%- - fi - TAG="backlight" - LABEL="Backlight" - VAL="$(${brightnessctl} -m | ${pkgs.gawk}/bin/awk -F, '{print substr($4, 0, length($4)-1)}')" - fi - - ${pkgs.libnotify}/bin/notify-send \ - --hint=string:x-dunst-stack-tag:$TAG \ - --hint=string:synchronous:$TAG \ - --hint=int:value:$VAL \ - "$LABEL $VAL%" - - '' diff --git a/user/swaylock/default.nix b/user/swaylock/default.nix deleted file mode 100644 index 74ef01cd..00000000 --- a/user/swaylock/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - pkgs, - theme, - ... -}: let - inherit (builtins) concatStringsSep attrNames map; - inside = theme.base01; - outside = theme.base01; - ring = theme.base05; - text = theme.base05; - positive = theme.base0B; - negative = theme.base08; - - settings = { - color = outside; - scaling = "fill"; - inside-color = inside; - inside-clear-color = inside; - inside-caps-lock-color = inside; - inside-ver-color = inside; - inside-wrong-color = inside; - key-hl-color = positive; - layout-bg-color = inside; - layout-border-color = ring; - layout-text-color = text; - ring-color = ring; - ring-clear-color = negative; - ring-caps-lock-color = ring; - ring-ver-color = positive; - ring-wrong-color = negative; - separator-color = "00000000"; - text-color = text; - text-clear-color = text; - text-caps-lock-color = text; - text-ver-color = text; - text-wrong-color = text; - effect-blur = "3x3"; - font-size = 24; - indicator-radius = 120; - indicator-thickness = 15; - }; - - flags = (concatStringsSep " " (map (key: "--${key}=${builtins.toString settings.${key}}") (attrNames settings))) + "-n -S --clock --indicator"; -in - pkgs.symlinkJoin { - name = "swaylock-wrapped"; - paths = [pkgs.swaylock-effects]; - buildInputs = [pkgs.makeWrapper]; - postBuild = '' - wrapProgram $out/bin/swaylock --add-flags "${flags}" - ''; - }