From ec4baba852d0ca569f13011ef076ce044dcd5417 Mon Sep 17 00:00:00 2001 From: Phantop Date: Sat, 22 Aug 2020 00:44:47 -0400 Subject: [PATCH] Move some more fish to bash and clean up funcs --- .config/fish/functions/72.fish | 5 ----- .config/fish/functions/addpath.fish | 8 -------- .config/fish/functions/cpugov.fish | 9 ++------- .config/fish/functions/listen.fish | 7 ------- .config/fish/functions/timer.fish | 7 ------- .config/fish/functions/wallo.fish | 1 - .config/fish/functions/wallp.fish | 3 +-- .local/bin/72 | 4 ++++ .local/bin/addpath | 2 ++ .local/bin/listen | 2 ++ 10 files changed, 11 insertions(+), 37 deletions(-) delete mode 100644 .config/fish/functions/72.fish delete mode 100644 .config/fish/functions/addpath.fish delete mode 100644 .config/fish/functions/listen.fish delete mode 100644 .config/fish/functions/timer.fish create mode 100755 .local/bin/72 create mode 100755 .local/bin/addpath create mode 100755 .local/bin/listen diff --git a/.config/fish/functions/72.fish b/.config/fish/functions/72.fish deleted file mode 100644 index f6e74de..0000000 --- a/.config/fish/functions/72.fish +++ /dev/null @@ -1,5 +0,0 @@ -function 72 - xrandr --newmode (cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2- | tr ' ' \n | awk '$1=$1') -xrandr --addmode (xrandr --listactivemonitors | tail -n1 | cut -d' ' -f5- | awk '$1=$1') (cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2) -xrandr --output (xrandr --listactivemonitors | tail -n1 | cut -d' ' -f5- | awk '$1=$1') --mode (cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2) -end diff --git a/.config/fish/functions/addpath.fish b/.config/fish/functions/addpath.fish deleted file mode 100644 index 52cd12a..0000000 --- a/.config/fish/functions/addpath.fish +++ /dev/null @@ -1,8 +0,0 @@ -# Defined in /tmp/fish.kGwYO8/addpath.fish @ line 1 -function addpath -w set - if test $argv - set PATH $argv $PATH - else - set PATH (pwd) $PATH - end -end diff --git a/.config/fish/functions/cpugov.fish b/.config/fish/functions/cpugov.fish index 9fae8fb..034a43a 100644 --- a/.config/fish/functions/cpugov.fish +++ b/.config/fish/functions/cpugov.fish @@ -1,9 +1,4 @@ +# Defined in /tmp/fish.YTcC09/cpugov.fish @ line 2 function cpugov - echo -e "The current state is "(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) - if [ (cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) != "performance" ] - s -i cpupower frequency-set -g performance >/dev/null - else - s cpupower frequency-set -g powersave >/dev/null - end - echo -e "The current state is "(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) + sudo cpupower frequency-set -g performance > /dev/null && echo Now in performance mode end diff --git a/.config/fish/functions/listen.fish b/.config/fish/functions/listen.fish deleted file mode 100644 index d6d539d..0000000 --- a/.config/fish/functions/listen.fish +++ /dev/null @@ -1,7 +0,0 @@ -function listen - if pactl list short modules | grep loopback - pactl unload-module module-loopback - else - pactl load-module module-loopback - end -end diff --git a/.config/fish/functions/timer.fish b/.config/fish/functions/timer.fish deleted file mode 100644 index 27a7f86..0000000 --- a/.config/fish/functions/timer.fish +++ /dev/null @@ -1,7 +0,0 @@ -function timer - tmux new -s 0 -d 'while true - countdown 20m - notify-send Time - zenity --info --text=Time & mpv ~/Music/.break - end' -end diff --git a/.config/fish/functions/wallo.fish b/.config/fish/functions/wallo.fish index 7703659..ab1ea16 100644 --- a/.config/fish/functions/wallo.fish +++ b/.config/fish/functions/wallo.fish @@ -1,4 +1,3 @@ function wallo -w convert - rm ~/.config/wall0 convert $argv -resize (xrandr | grep '*'| grep -o [0-9]\*x[0-9]\*) ~/.config/wall0 end diff --git a/.config/fish/functions/wallp.fish b/.config/fish/functions/wallp.fish index d875cfd..3952540 100644 --- a/.config/fish/functions/wallp.fish +++ b/.config/fish/functions/wallp.fish @@ -1,4 +1,3 @@ function wallp -w readlink - set -l i (readlink -f $argv) - gsettings set org.gnome.desktop.background picture-uri "file://$i" + gsettings set org.gnome.desktop.background picture-uri "file://(readlink -f $argv)" end diff --git a/.local/bin/72 b/.local/bin/72 new file mode 100755 index 0000000..3a5fb38 --- /dev/null +++ b/.local/bin/72 @@ -0,0 +1,4 @@ +#!/bin/bash +xrandr --newmode $(cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2- | tr ' ' \n | awk '$1=$1') +xrandr --addmode $(xrandr --listactivemonitors | tail -n1 | cut -d' ' -f5- | awk '$1=$1') $(cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2) +xrandr --output $(xrandr --listactivemonitors | tail -n1 | cut -d' ' -f5- | awk '$1=$1') --mode $(cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2) diff --git a/.local/bin/addpath b/.local/bin/addpath new file mode 100755 index 0000000..f5432e0 --- /dev/null +++ b/.local/bin/addpath @@ -0,0 +1,2 @@ +#!/bin/bash +[[ "$#" -ge 1 ]] && export PATH=$@:$PATH || export PATH=$@:$PWD diff --git a/.local/bin/listen b/.local/bin/listen new file mode 100755 index 0000000..03a25bb --- /dev/null +++ b/.local/bin/listen @@ -0,0 +1,2 @@ +#!/bin/bash +pactl list short modules | grep loopback && pactl unload-module module-loopback || pactl load-module module-loopback