diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-14 15:42:20 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-14 15:42:20 +1000 |
| commit | b5a91d3ca57d1369d0b7b502112c4b4c9849d26c (patch) | |
| tree | 8ea45e54e0b0c826f65f54ebf82e41cb68163221 /pip.fish | |
| parent | feat: impl pip subcommand (diff) | |
| download | caelestia-cli-b5a91d3ca57d1369d0b7b502112c4b4c9849d26c.tar.gz caelestia-cli-b5a91d3ca57d1369d0b7b502112c4b4c9849d26c.tar.bz2 caelestia-cli-b5a91d3ca57d1369d0b7b502112c4b4c9849d26c.zip | |
internal: remove all legacy fish scripts
Diffstat (limited to 'pip.fish')
| -rwxr-xr-x | pip.fish | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/pip.fish b/pip.fish deleted file mode 100755 index 08fda6d..0000000 --- a/pip.fish +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env fish - -argparse -n 'caelestia-pip' -X 0 \ - 'h/help' \ - 'd/daemon' \ - -- $argv -or exit - -if set -q _flag_h - echo 'Usage:' - echo ' caelestia pip ( -h | --help )' - echo ' caelestia pip [ -d | --daemon ]' - echo - echo 'Options:' - echo ' -h, --help Print this help message and exit' - echo ' -d, --daemon Run this script in daemon mode' - echo - echo 'Normal mode (no args):' - echo ' Move and resize the active window to picture in picture default geometry.' - echo - echo 'Daemon mode:' - echo ' Set all picture in picture window initial geometry to default.' - - exit -end - -. (dirname (status filename))/util.fish - -function handle-window -a address workspace - set -l monitor_id (hyprctl workspaces -j | jq '.[] | select(.name == "'$workspace'").monitorID') - set -l monitor_size (hyprctl monitors -j | jq -r '.[] | select(.id == '$monitor_id') | "\(.width)\n\(.height)"') - set -l window_size (hyprctl clients -j | jq '.[] | select(.address == "'$address'").size[]') - set -l scale_factor (math $monitor_size[2] / 4 / $window_size[2]) - set -l scaled_window_size (math -s 0 $window_size[1] x $scale_factor) (math -s 0 $window_size[2] x $scale_factor) - - hyprctl dispatch "resizewindowpixel exact $scaled_window_size,address:$address" > /dev/null - hyprctl dispatch "movewindowpixel exact $(math -s 0 $monitor_size[1] x 0.98 - $scaled_window_size[1]) $(math -s 0 $monitor_size[2] x 0.97 - $scaled_window_size[2]),address:$address" > /dev/null - log "Handled window at address $address" -end - -if set -q _flag_d - log 'Daemon started' - socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read line - switch $line - case 'openwindow*' - set -l window (string sub -s 13 $line | string split ',') - if string match -qr '^(Picture(-| )in(-| )[Pp]icture)$' $window[4] - handle-window 0x$window[1] $window[2] - end - end - end - - exit -end - -set -l active_window (hyprctl activewindow -j | jq -r '"\(.address)\n\(.workspace.name)\n\(.floating)"') -if test $active_window[3] = true - handle-window $active_window -else - warn 'Focused window is not floating, ignoring' -end |