Change back to /bin/sh from /usr/bin/env sh
This commit is contained in:
parent
52f41ba6e7
commit
33d9dc616a
7 changed files with 71 additions and 23 deletions
|
|
@ -1,18 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
battery=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
battery=/sys/class/power_supply/BAT0
|
||||
capacity=$(cat $battery/capacity)
|
||||
bstatus=$(cat $battery/status)
|
||||
|
||||
if [ $battery -gt 80 ]; then
|
||||
if [ "$bstatus" = "Charging" ]; then
|
||||
symbol=
|
||||
elif [ $capacity -gt 80 ]; then
|
||||
symbol=
|
||||
elif [ $battery -gt 60 ]; then
|
||||
elif [ $capacity -gt 60 ]; then
|
||||
symbol=
|
||||
elif [ $battery -gt 40 ]; then
|
||||
elif [ $capacity -gt 40 ]; then
|
||||
symbol=
|
||||
elif [ $battery -gt 20 ]; then
|
||||
elif [ $capacity -gt 20 ]; then
|
||||
symbol=
|
||||
else
|
||||
symbol=
|
||||
fi
|
||||
|
||||
echo "${symbol} ${battery}%"
|
||||
echo "${symbol} ${capacity}%"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
# This is a script aimed at replicating the functionality of DWM where
|
||||
# there are 9 workspaces per monitor.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,46 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
increase=0
|
||||
if [ "$1" != "-i" ] && [ "$1" != "-d" ] || [ -z "$2" ]; then
|
||||
echo "Wrong number of arguments"
|
||||
exit 1
|
||||
else
|
||||
[ "$1" = "-i" ] && increase=1
|
||||
fi
|
||||
|
||||
# Reading from config
|
||||
config="$HOME/.config/hypr/hyprland.conf"
|
||||
def_gaps_out="$(grep "^\s*gaps_out" $config | awk '{print $3}')"
|
||||
[ -z "$def_gaps_out" ] && def_gaps_out=12
|
||||
def_gaps_in="$(grep "^\s*gaps_in" $config | awk '{print $3}')"
|
||||
[ -z "$def_gaps_in" ] && def_gaps_in=12
|
||||
def_rounding="$(grep "^\s*rounding" $config | awk '{print $3}')"
|
||||
[ -z "$def_rounding" ] && def_rounding=10
|
||||
|
||||
case $1 in
|
||||
-i)
|
||||
increase=1
|
||||
;;
|
||||
-d)
|
||||
increase=0
|
||||
;;
|
||||
-r)
|
||||
hyprctl keyword general:gaps_out $def_gaps_out
|
||||
hyprctl keyword general:gaps_in $def_gaps_in
|
||||
hyprctl keyword decoration:rounding $def_rounding
|
||||
exit 0
|
||||
;;
|
||||
-t)
|
||||
gaps_out="$(hyprctl getoption general:gaps_out | grep "int" | awk '{print $2}')"
|
||||
if [ $gaps_out = 0 ]; then
|
||||
hyprctl keyword general:gaps_out $def_gaps_out
|
||||
hyprctl keyword general:gaps_in $def_gaps_in
|
||||
hyprctl keyword decoration:rounding $def_rounding
|
||||
else
|
||||
hyprctl keyword general:gaps_out 0
|
||||
hyprctl keyword general:gaps_in 0
|
||||
hyprctl keyword decoration:rounding 0
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
amount="$2"
|
||||
curr_out="$(hyprctl -j getoption general:gaps_out | jq '.int')"
|
||||
|
|
@ -19,11 +53,20 @@ fi
|
|||
|
||||
new_in="$(($new_out / 2))"
|
||||
|
||||
if [ $new_out -lt 0 ] || [ $new_in -lt 0 ]; then
|
||||
if [ $new_out -le 0 ] || [ $new_in -le 0 ]; then
|
||||
new_out=0
|
||||
new_in=0
|
||||
fi
|
||||
|
||||
# Handing smooth rounding transition
|
||||
notify-send "$max_rounding"
|
||||
if [ $new_in -gt $def_rounding ]; then
|
||||
new_rounding=$def_rounding
|
||||
else
|
||||
new_rounding=$new_in
|
||||
fi
|
||||
hyprctl keyword decoration:rounding "$new_rounding"
|
||||
|
||||
hyprctl keyword general:gaps_out "$new_out"
|
||||
hyprctl keyword general:gaps_in "$new_in"
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ yellow
|
|||
blue
|
||||
purple
|
||||
cyan
|
||||
white" | rofi -no-fixed-num-lines -dmenu -p "Choose an accent color:")
|
||||
white" | fuzzel --dmenu -l 8 -p "Choose an accent color:")
|
||||
[ -z "$accent" ] && exit 0
|
||||
echo "$accent" > ~/.config/colors/accent
|
||||
source ~/.config/zsh/.zshrc
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
layout=`autorandr | rofi -dmenu -i -p "Select layout:" | awk '{print $1}'`
|
||||
layout=`autorandr | fuzzel --dmenu -i -p "Select layout:" | awk '{print $1}'`
|
||||
autorandr $layout
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
sel="$(man -k . | rofi -dmenu -i -p "Man page:")"
|
||||
[ "$sel" = "" ] && exite # Exit on no selection
|
||||
sel="$(man -k . | fuzzel --dmenu -i -p "Man page:")"
|
||||
[ "$sel" = "" ] && exit # Exit on no selection
|
||||
|
||||
# Selection comes in the form of:
|
||||
# $program ($num) - $desc
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
# Simple rofi script for changing default audio sink
|
||||
|
||||
audio_info="$(wpctl status \
|
||||
|
|
@ -27,7 +27,8 @@ devices="$(echo "$devices_and_numbers" \
|
|||
| awk -F'[' '{print $1}' \
|
||||
| cut -c 2-)"
|
||||
|
||||
chosen="$(echo "$devices" | rofi -no-fixed-num-lines -dmenu -p "Select audio $1:" -i)"
|
||||
lines="$(echo "$devices" | wc -l)"
|
||||
chosen="$(echo "$devices" | fuzzel -l $lines --dmenu -p "Select audio $1:" -i)"
|
||||
if [ -z "$chosen" ]; then
|
||||
# Exited without selecting
|
||||
exit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue