remove scripts

This commit is contained in:
2025-05-25 17:24:02 +03:00
parent deafcf9a98
commit 2aa43ba009
13 changed files with 0 additions and 276 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1,10 +0,0 @@
#! /bin/bash
PORT="$1"
if [[ "$PORT" == "" ]]; then
echo "Usage: kill-port {port}"
exit 1
fi
fuser -k "$PORT"/tcp

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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