diff options
| author | Pavel Egorov <[email protected]> | 2025-06-17 20:48:45 +0300 |
|---|---|---|
| committer | Pavel Egorov <[email protected]> | 2025-06-17 20:48:45 +0300 |
| commit | bc32e2126cf37aea1606f6626758860ca7eb561a (patch) | |
| tree | 8f1d1181bfc11c011324c0447f8aea2f80b59403 /.config/fish/conf.d | |
| parent | aacec34425446aa2a0455cbd292de1d0b69c9de1 (diff) | |
| download | dotfiles-bc32e2126cf37aea1606f6626758860ca7eb561a.tar.gz dotfiles-bc32e2126cf37aea1606f6626758860ca7eb561a.zip | |
[fish] run jq once to parse shadowsocks config
Diffstat (limited to '.config/fish/conf.d')
| -rw-r--r-- | .config/fish/conf.d/abbr.fish | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/.config/fish/conf.d/abbr.fish b/.config/fish/conf.d/abbr.fish index c37aa2a..2f3b72c 100644 --- a/.config/fish/conf.d/abbr.fish +++ b/.config/fish/conf.d/abbr.fish | |||
| @@ -8,7 +8,8 @@ abbr --add gco "git checkout" | |||
| 8 | 8 | ||
| 9 | # Added proxy flags | 9 | # Added proxy flags |
| 10 | set -l ssconfig "/etc/shadowsocks-rust/config.json" | 10 | set -l ssconfig "/etc/shadowsocks-rust/config.json" |
| 11 | set -l SSPROXY "socks5://$(jq -r .local_address $ssconfig):$(jq -r .local_port $ssconfig)" | 11 | set -l parsed_config (jq -r .local_address,.local_port $ssconfig) |
| 12 | set -l SSPROXY "socks5://$parsed_config[1]:$parsed_config[2]" | ||
| 12 | abbr --add curlss "curl --proxy=$SSPROXY" | 13 | abbr --add curlss "curl --proxy=$SSPROXY" |
| 13 | abbr --add ytdlpss "yt-dlp --proxy=$SSPROXY" | 14 | abbr --add ytdlpss "yt-dlp --proxy=$SSPROXY" |
| 14 | 15 | ||
