diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-01-07 13:39:33 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-01-07 13:39:33 +0200 |
| commit | a169838f2b1852bfd6feb38970d9324650d93b74 (patch) | |
| tree | fa12024a7e68da2c85cb2ebc7a40e7dd5dba24f0 /.local/bin | |
| parent | 6e225ef11b251ee7477a87f9ad42da81a776e08e (diff) | |
| download | dotfiles-a169838f2b1852bfd6feb38970d9324650d93b74.tar.gz dotfiles-a169838f2b1852bfd6feb38970d9324650d93b74.zip | |
Removed synced files since git subtrees does not have desired effect
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/scripts/Heads-Up-Display | 13 | ||||
| -rw-r--r-- | .local/bin/scripts/README.md | 1 | ||||
| -rwxr-xr-x | .local/bin/scripts/bspwm_resize.sh | 67 | ||||
| -rwxr-xr-x | .local/bin/scripts/cryptocheck | 31 | ||||
| -rwxr-xr-x | .local/bin/scripts/cryptonotify | 19 | ||||
| -rwxr-xr-x | .local/bin/scripts/layer.sh | 24 | ||||
| -rwxr-xr-x | .local/bin/scripts/opacity-change.sh | 34 | ||||
| -rwxr-xr-x | .local/bin/scripts/powermenu | 38 | ||||
| -rwxr-xr-x | .local/bin/scripts/scratchpad | 30 |
9 files changed, 0 insertions, 257 deletions
diff --git a/.local/bin/scripts/Heads-Up-Display b/.local/bin/scripts/Heads-Up-Display deleted file mode 100755 index cac8681..0000000 --- a/.local/bin/scripts/Heads-Up-Display +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -id=$(xdotool search --class Heads-Up-Display); -if [ -z "$id" ]; then - st -c Heads-Up-Display -e tmux attach -t HUD || tmux new -s HUD; -else - if [ ! -f /tmp/hide_hud ]; then - touch /tmp/hide_hud && xdo hide "$id" - elif [ -f /tmp/hide_hud ]; then - rm /tmp/hide_hud && xdo show "$id" - fi -fi - diff --git a/.local/bin/scripts/README.md b/.local/bin/scripts/README.md deleted file mode 100644 index 458b3cc..0000000 --- a/.local/bin/scripts/README.md +++ /dev/null @@ -1 +0,0 @@ -# scripts diff --git a/.local/bin/scripts/bspwm_resize.sh b/.local/bin/scripts/bspwm_resize.sh deleted file mode 100755 index 29ab5cf..0000000 --- a/.local/bin/scripts/bspwm_resize.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -size=${2:-'10'} -dir=$1 - -# Find current window mode -is_tiled() { -bspc query -T -n | grep -q '"state":"tiled"' -} -# If the window is floating, move it -if ! is_tiled; then -#only parse input if window is floating,tiled windows accept input as is - case "$dir" in - west) switch="-w" - sign="-" - ;; - east) switch="-w" - sign="+" - ;; - north) switch="-h" - sign="-" - ;; - south) switch="-h" - sign="+" - ;; - esac - xdo resize ${switch} ${sign}${size} - -# Otherwise, window is tiled: switch with window in given direction -else - case "$dir" in - west) bspc node @west -r -$size || bspc node @east -r -${size} - ;; - east) bspc node @west -r +$size || bspc node @east -r +${size} - ;; - north) bspc node @south -r -$size || bspc node @north -r -${size} - ;; - south) bspc node @south -r +$size || bspc node @north -r +${size} - ;; - esac -fi - -##!/bin/bash -# -#[ "$#" -eq 3 ] || { echo "Needs exactly three arguments."; exit 1; } -# -#motion="$1" -#direction="$2" -#size="$3" -# -#if [ "$motion" = 'expand' ]; then -# # These expand the window's given side -# case "$direction" in -# north) bspc node -z top 0 -"$size" ;; -# east) bspc node -z right "$size" 0 ;; -# south) bspc node -z bottom 0 "$size" ;; -# west) bspc node -z left -"$size" 0 ;; -# esac -#else -# # These contract the window's given side -# case "$direction" in -# north) bspc node -z top 0 "$size" ;; -# east) bspc node -z right -"$size" 0 ;; -# south) bspc node -z bottom 0 -"$size" ;; -# west) bspc node -z left "$size" 0 ;; -# esac -#fi diff --git a/.local/bin/scripts/cryptocheck b/.local/bin/scripts/cryptocheck deleted file mode 100755 index 02ba42d..0000000 --- a/.local/bin/scripts/cryptocheck +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -if [ ! -d ~/.cache/crypto ]; then - mkdir ~/.cache/crypto -fi -ticker=(BTC ETH ADA DOT SOL XMR) - -for currency in "${ticker[@]}"; do - echo "$currency" -done | while read coin - do - price=$(curl rate.sx/1$coin) - if [ $coin = "BTC" ]; then - icon= - elif [ $coin = "ETH" ]; then - icon= - elif [ $coin = "ADA" ]; then - icon= - elif [ $coin = "DOT" ]; then - icon= - elif [ $coin = "SOL" ]; then - icon= - elif [ $coin = "XMR" ]; then - icon= - fi - - echo "$icon $coin: $price" > ~/.cache/crypto/$coin - - done - -date > ~/.cache/crypto/time - diff --git a/.local/bin/scripts/cryptonotify b/.local/bin/scripts/cryptonotify deleted file mode 100755 index 47883c3..0000000 --- a/.local/bin/scripts/cryptonotify +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -source cryptocheck -Output= -for file in ~/.cache/crypto/* -do - if [ ! -z "$Output" ]; then - if [ ! $(basename $file) = "time" ]; then - Output="$Output\n$(cat $file)" - fi - else - if [ ! $(basename $file) = "time" ]; then - Output="$Output$(cat $file)" - fi - fi - -done - -Output="$Output\n$(cat ~/.cache/crypto/time)" -notify-send "Crypto Prices" "$Output" diff --git a/.local/bin/scripts/layer.sh b/.local/bin/scripts/layer.sh deleted file mode 100755 index 4b17ed1..0000000 --- a/.local/bin/scripts/layer.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -current_layer="$(bspc query -T -n | jq -r '.client.layer')" -case $1 in - +|-) - declare -A _layers=( [below]=0 [normal]=1 [above]=2 ) - layers=( below normal above ) - maxl=$(( ${#layers[@]} - 1 )) - current_layer="$(bspc query -T -n | jq -r '.client.layer')" - i=$(( ${_layers[$current_layer]} $1 1 )) - if [[ $i -lt 0 ]]; then - i=0 - elif [[ $i -gt $maxl ]]; then - i=$maxl - fi - #cycle? nah - #i=$(( (${_layers[$current_layer]} + ${#layers[@]} ${1} 1) % ${#layers[@]} )) - new_layer="${layers[$i]}" - ;; - *) - new_layer="$(bspc query -T -n | jq -r '.client.lastLayer')" - ;; -esac -[[ "$current_layer" != "$new_layer" ]] && bspc node -l "$new_layer" diff --git a/.local/bin/scripts/opacity-change.sh b/.local/bin/scripts/opacity-change.sh deleted file mode 100755 index b509936..0000000 --- a/.local/bin/scripts/opacity-change.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -set -eu -[[ -n ${DEBUG:-} ]] && set -x - -#### Example alacritty.yml usage -#key_bindings: -# - { key: N, mods: Control|Shift, action: SpawnNewInstance } -# - { key: O, mods: Control|Shift, command: { program: "opacity-change.sh", args: ["-"] } } -# - { key: P, mods: Control|Shift, command: { program: "opacity-change.sh", args: ["+"] } } - - -operation="${1:-}${2:-}" # Arg #1 & #2 (in case the user misinterpreted a space in the usage), Default '' -step="${operation:1}" # Substring from char index 1 -step="${step:-1}" # Default '1' -operation="${operation:0:1}" # Substring from char index 0 length of 1 -config_file="$HOME/.config/alacritty/alacritty.yml" -config_field="opacity" -tmp_file="/tmp/$(basename $config_file).$(date +%s)" -current_value=$(sed 's/#.*//g; /\b'"$config_field"':/!d; s/.*: \?//' < "$config_file") - -case $operation in -"-") - verb="Decreasing" ;; -"+") - verb="Increasing" ;; -*) - echo "Usage: ${BASH_SOURCE[0]} (-|+)[int]"; exit 255 ;; -esac - -new_value="$(awk '{n=$1+$2/10; print (n<0 ? 0 : n>1 ? 1 : n)}' <<<"$current_value $operation$step")" -echo "$verb $config_field from $current_value to $new_value" >&2 -cp "$config_file" "$tmp_file" -sed "s/\b$config_field:.*/$config_field: $new_value/" "$tmp_file" > "$config_file" - diff --git a/.local/bin/scripts/powermenu b/.local/bin/scripts/powermenu deleted file mode 100755 index 7bd913e..0000000 --- a/.local/bin/scripts/powermenu +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# display a power menu to: shutdown, reboot, -# lock, logout, and suspend. This script can be -# executed by clicking on the polybar powermenu module -# or with a keyboard shortcut - -# options to be displayed -shutdown=" Shutdown" -reboot=" Reboot" -lock=" Lock" -logout=" Logout" -suspend=" Suspend" - -uptime=$(uptime -p | sed -e 's/up //g') - -# options passed into variable -options="$shutdown\n$reboot\n$lock\n$logout\n$suspend" - -chosen="$(echo -e "$options" | rofi -theme ~/.config/rofi/styles/powermenu.rasi -lines 5 -dmenu -p "$uptime")" - -case $chosen in -$shutdown) - systemctl poweroff - ;; -$reboot) - systemctl reboot - ;; -$lock) - betterlockscreen --lock dimblur - ;; -$logout) - bspc quit - ;; -$suspend) - systemctl suspend - ;; -esac diff --git a/.local/bin/scripts/scratchpad b/.local/bin/scripts/scratchpad deleted file mode 100755 index 331f8a2..0000000 --- a/.local/bin/scripts/scratchpad +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -#sid=$(wmctrl -lx | grep scratch.scratchpad| cut -d' ' -f1| head -1) \ -#&& [ -z "$(echo $sid)" ] \ -# && alacritty -t scratchpad --class scratch,scratchpad -e tmux new-session -A -s scratchpad -# & sleep 1 \ -# && sid=$(wmctrl -lx | grep scratch.scratchpad| cut -d' ' -f1| head -1) \ -# && echo "$sid" > /tmp/scratchID ; -if id="$(xdo id -N scratch)" - then bspc node "$id" -g hidden -f - else alacritty --class scratch,scratchpad -e tmux new-session -A -s scratch -e bash > /dev/null 2>&1 & - #else alacritty --class scratch,scratchpad -e tmux new-session -A -s scratch -e bash > /dev/null 2>&1 & -fi - -#id=$(xdotool search --class scratchpad); -#if [ -z "$id" ]; then -# alacritty --class scratch,scratchpad -e tmux new-session -A -s scratch; -#else -# if [ ! -f /tmp/hide_scratch ]; then -# touch /tmp/hide_scratch && xdo hide "$id" -# elif [ -f /tmp/hide_scratch ]; then -# rm /tmp/hide_scratch && xdo show "$id" -# fi -#fi - -# alacritty -t scratchpad --class scratch,scratchpad -e zsh -c "zsh tmux attach -t scratch || tmux new -s scratch"; -# st -c scratchy -e tmux attach -t scratchy || tmux new -s scratchy; -# && alacritty -t scratchpad --class scratch,scratchpad -e zsh -c "zsh tmux attach -t scratch || tmux new -s scratch"\ -# alacritty --class scratch,scratchpad -e tmux attach -t scratch || tmux new -s scratch; - |
