From 2aa43ba009bc07e8a539fff0086aa3c2223f4288 Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Sun, 25 May 2025 17:24:02 +0300 Subject: [PATCH] remove scripts --- bin/bluetooth_battery.sh | 19 ------------ bin/build-go | 6 ---- bin/clean-cache | 47 ---------------------------- bin/colorpick.sh | 12 -------- bin/control-brightness.sh | 19 ------------ bin/initial-mic-state.sh | 10 ------ bin/kill-port | 10 ------ bin/lock.sh | 19 ------------ bin/notify-on-volume | 27 ---------------- bin/set-wallpaper | 65 --------------------------------------- bin/sway-lid-watcher.sh | 9 ------ bin/swayidle.sh | 12 -------- bin/toggle-mic-mute.sh | 21 ------------- 13 files changed, 276 deletions(-) delete mode 100755 bin/bluetooth_battery.sh delete mode 100755 bin/build-go delete mode 100755 bin/clean-cache delete mode 100755 bin/colorpick.sh delete mode 100755 bin/control-brightness.sh delete mode 100755 bin/initial-mic-state.sh delete mode 100755 bin/kill-port delete mode 100755 bin/lock.sh delete mode 100755 bin/notify-on-volume delete mode 100755 bin/set-wallpaper delete mode 100755 bin/sway-lid-watcher.sh delete mode 100755 bin/swayidle.sh delete mode 100755 bin/toggle-mic-mute.sh diff --git a/bin/bluetooth_battery.sh b/bin/bluetooth_battery.sh deleted file mode 100755 index 02e044a..0000000 --- a/bin/bluetooth_battery.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/bash - -name="$1" -if [[ "$name" == "" ]]; then - echo "No name was provided" - exit 1 -fi - -model_line=$(upower -d | grep -n "$name" | cut -d ':' -f 1) -if [[ "$model_line" == "" ]]; then - exit 1 -fi - -idx=$(($model_line - 2)) -id=$(upower -d | sed "$idx!d" | awk '{print $2}') - -percentage=$(upower -i "$id" | grep "percentage: " | awk '{print $2}') - -echo "$percentage" diff --git a/bin/build-go b/bin/build-go deleted file mode 100755 index fab29bb..0000000 --- a/bin/build-go +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash - -GOOS=windows GOARCH=amd64 go build -o "$1_windows.exe" -GOOS=linux GOARCH=amd64 go build -o "$1_linux" -GOOS=darwin GOARCH=amd64 go build -o "$1_macos" -GOOS=darwin GOARCH=arm64 go build -o "$1_macos_arm" diff --git a/bin/clean-cache b/bin/clean-cache deleted file mode 100755 index 2136ad8..0000000 --- a/bin/clean-cache +++ /dev/null @@ -1,47 +0,0 @@ -#! /bin/bash - -args=("$@") - -usage() { - echo "Clean Cache utility: clean-cache [OPTIONS]" - echo - echo " --all cleans all cache" - echo " --npm cleans npm cache by running 'npm cache clean -f'" - echo " --yarn cleans yarn cache by running 'yarn cache clean'" - echo " --yay clean yay cache by simply deleting ~/.cache/yay content" -} - -if [ $# -eq 0 ] ; then - usage - exit -fi - -__clean_npm() { - npm cache clean -f &> /dev/null -} - -__clean_yarn() { - yarn cache clean &> /dev/null -} - -__clean_yay() { - rm -rf ~/.cache/yay -} - -if [[ "$args[@]" =~ "--all" ]] ; then - __clean_npm && __clean_yarn && __clean_yay - - exit -fi - -if [[ "${args[@]}" =~ "--npm" ]] ; then - __clean_npm -fi - -if [[ "${args[@]}" =~ "--yarn" ]] ; then - __clean_yarn -fi - -if [[ "${args[@]}" =~ "--yay" ]] ; then - __clean_yay -fi diff --git a/bin/colorpick.sh b/bin/colorpick.sh deleted file mode 100755 index 17ba724..0000000 --- a/bin/colorpick.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash - -color=$(hyprpicker) - -wl-copy "$color" - -status="$?" -if [[ "$status" == "0" ]]; then - notify-send "Color copied to clipboard" "$color" -else - notify-send "Some error happened while copying color" -fi diff --git a/bin/control-brightness.sh b/bin/control-brightness.sh deleted file mode 100755 index b2be9f7..0000000 --- a/bin/control-brightness.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/bash - -active_output=$(swaymsg -p -t get_outputs | grep '(focused)' | awk '{ printf $2 }') - -device="" -if [[ "$active_output" == "HDMI-A-1" ]]; then - device="ddcci5" -else - device="amdgpu_bl1" -fi - -param="" -if [[ "$1" == "up" ]]; then - param="+" -else - param="-" -fi - -brightnessctl -d "$device" set 5%$param diff --git a/bin/initial-mic-state.sh b/bin/initial-mic-state.sh deleted file mode 100755 index a13bca7..0000000 --- a/bin/initial-mic-state.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash - -pactl list sources | grep -qi "Mute: yes" -state="$?" - -if [[ "$state" == "0" ]]; then - brightnessctl -d "platform::micmute" s 1 -else - brightnessctl -d "platform::micmute" s 0 -fi diff --git a/bin/kill-port b/bin/kill-port deleted file mode 100755 index 54796aa..0000000 --- a/bin/kill-port +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash - -PORT="$1" - -if [[ "$PORT" == "" ]]; then - echo "Usage: kill-port {port}" - exit 1 -fi - -fuser -k "$PORT"/tcp diff --git a/bin/lock.sh b/bin/lock.sh deleted file mode 100755 index 0ed575d..0000000 --- a/bin/lock.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/bash - -__lock() { - gtklock -d -} - -if [[ "$1" == "just-lock" ]]; then - __lock - exit -fi - -amount_of_outputs=$(swaymsg -t get_outputs | grep -i name | wc -l) - -swaymsg output eDP-1 disable - -if [[ "$amount_of_outputs" == "1" ]]; then - playerctl pause - __lock -fi diff --git a/bin/notify-on-volume b/bin/notify-on-volume deleted file mode 100755 index 65ef27c..0000000 --- a/bin/notify-on-volume +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - -msgId="991049" - -volume=$(pamixer --get-volume) -mute=$(pamixer --get-mute) - -player_status=$(playerctl status) - -player_title="" -player_artist="" - -if [[ "$player_status" == "Playing" ]]; then - player_title=$(playerctl metadata title) - player_artist=$(playerctl metadata artist) -fi - -if [[ $volume == 0 || "$mute" == "true" ]]; then - dunstify -a "notify-on-volume" -u low -r "$msgId" "Volume muted" -else - body="" - if [[ "$player_title" != "" ]]; then - body="$player_artist - $player_title" - fi - - echo "$volume" >$XDG_RUNTIME_DIR/wob.sock -fi diff --git a/bin/set-wallpaper b/bin/set-wallpaper deleted file mode 100755 index c0d75c7..0000000 --- a/bin/set-wallpaper +++ /dev/null @@ -1,65 +0,0 @@ -#! /bin/bash - -arg=$1 - -if [[ "$arg" == "" ]] ; then - echo "Usage: set-wallpaper [--restore]|[/path/to/image/or/video]" - exit -fi - -__check_existence() { - local bin="$1" - - which "$bin" > /dev/null 2>> /dev/null && echo "true" || echo "false" -} - -__set_wallpaper() { - killall mpvpaper 2>> /dev/null - killall swaybg 2>> /dev/null - - mimeType=$(file --mime-type $1 | awk '{ print $2 }') - if [[ "$mimeType" == video* || "$mimeType" == audio* || "$mimeType" == "image/gif" ]] ; then - echo "Setting video wallpaper using mpvpaper" - - if [[ "$(__check_existence mpvpaper)" == "false" ]] ; then - echo "You need mpvpaper to use video wallpapers" - exit 1 - fi - - /sbin/mpvpaper -o "no-audio" VGA-1 $1 - - echo "Video wallpaper has been set" - elif [[ "$mimeType" == image* ]] ; then - if [[ "$(__check_existence swaybg)" == "true" && "$WAYLAND_DISPLAY" != "" ]] ; then - - echo "Setting image wallpaper using swaybg" - - /sbin/swaybg -i $1 -m fill & - elif [[ "$(__check_existence feh)" == "true" ]] ; then - echo "Setting image wallpaper using feh" - - feh --no-fehbg --bg-fill $1 - else - echo "I don't know what to use. No swaybg or feh" - exit 1 - fi - - - echo "Image wallpaper has been set" - fi -} - -if [[ "$arg" == "--restore" ]] ; then - path=$(cat $HOME/.wallpaper) - - __set_wallpaper $path -else - if [[ "$arg" == ./* ]] ; then - arg="$PWD/$arg" - fi - - echo "$arg" > $HOME/.wallpaper - - echo "Saved $arg as a wallpaper but you need to run 'set-wallpaper --restore'" -fi - diff --git a/bin/sway-lid-watcher.sh b/bin/sway-lid-watcher.sh deleted file mode 100755 index 6b2e7bf..0000000 --- a/bin/sway-lid-watcher.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/bash - -output="eDP-1" - -if grep -q open /proc/acpi/button/lid/LID/state; then - swaymsg output $output enable -else - swaymsg output $output disable -fi diff --git a/bin/swayidle.sh b/bin/swayidle.sh deleted file mode 100755 index b379d3e..0000000 --- a/bin/swayidle.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash - -killall swayidle - -lockCmd="$HOME/dotfiles/bin/lock.sh just-lock" - -swayidle -w \ - timeout 900 "$lockCmd" \ - timeout 900 'swaymsg "output * dpms off"' \ - resume 'swaymsg "output * dpms on"' \ - after-resume 'swaymsg "output * dpms on"' \ - before-sleep "$lockCmd" diff --git a/bin/toggle-mic-mute.sh b/bin/toggle-mic-mute.sh deleted file mode 100755 index d6fbdb2..0000000 --- a/bin/toggle-mic-mute.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/bash - -pactl list sources | grep -qi 'Mute: yes' -state="$?" - -id="991050" -appName="microphone-is-muted" - -if [[ "$state" == "0" ]]; then - # mic is muted - pactl set-source-mute @DEFAULT_SOURCE@ 0 - dunstify -a "$appName" -u low -t 1000 -r "$id" "Actived microphone" "It's not muted now" - - brightnessctl -d "platform::micmute" s 0 -else - # mic is not muted - pactl set-source-mute @DEFAULT_SOURCE@ 1 - dunstify -a "$appName" -u low -t 1000 -r "$id" "Disabled microphone" "It's muted now" - - brightnessctl -d "platform::micmute" s 1 -fi