Add old dotfiles
This commit is contained in:
commit
1cace80e48
192 files changed
+13538
No files matched your search
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
function get_brightness {
|
||||
cntb=$(brightnessctl g)
|
||||
maxb=$(brightnessctl m)
|
||||
|
||||
echo $(( ($cntb * 100) / $maxb ))
|
||||
}
|
||||
|
||||
# Function to get the icon based on the brightness level
|
||||
function get_brightness_icon {
|
||||
brightness_level=$1
|
||||
if [ $brightness_level -le 33 ]; then
|
||||
echo ""
|
||||
elif [ $brightness_level -le 66 ]; then
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to set the contents of "/tmp/brightness_status" to the current brightness level
|
||||
function set_tmp_brightness_status {
|
||||
brightness_level=$(get_brightness)
|
||||
icon=$(get_brightness_icon $brightness_level)
|
||||
echo "$icon $brightness_level%" > /tmp/brightness_status
|
||||
}
|
||||
|
||||
function send_notification {
|
||||
brightness_level=$(get_brightness)
|
||||
icon=$(get_brightness_icon $brightness_level)
|
||||
# Make the bar with the special character ─ (it's not dash -)
|
||||
# https://en.wikipedia.org/wiki/Box-drawing_character
|
||||
bar=$(seq -s "─" $(($brightness_level / 5)) | sed 's/[0-9]//g')
|
||||
# Send the notification
|
||||
dunstify -i display-brightness-symbolic -t 2500 -r 2593 -u normal " $bar"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
up)
|
||||
# Set the brightness level up (+ 5%)
|
||||
brightnessctl s 5%+
|
||||
send_notification
|
||||
set_tmp_brightness_status
|
||||
;;
|
||||
down)
|
||||
# Set the brightness level down (- 5%)
|
||||
brightnessctl s 5%-
|
||||
send_notification
|
||||
set_tmp_brightness_status
|
||||
;;
|
||||
esac
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
i3status | (read line; echo "$line"; read line ; echo "$line" ; read line ; echo "$line" ; while true
|
||||
do
|
||||
read line
|
||||
json_array="$(echo $line | sed -e 's/^,//')"
|
||||
echo ",$json_array"
|
||||
done)
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
j4-dmenu-desktop --dmenu="dmenu -fn 'ZedMono Nerd Font-12' -i -b -nb '#000000' -nf '#ffffff' -sb '#b299db' -sf '#000000' -p 'drun>'"
|
||||
Executable
+66
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
|
||||
function set_profile {
|
||||
case $1 in
|
||||
performance)
|
||||
powerprofilesctl set performance
|
||||
;;
|
||||
balanced)
|
||||
powerprofilesctl set balanced
|
||||
;;
|
||||
power-saver)
|
||||
powerprofilesctl set power-saver
|
||||
;;
|
||||
*)
|
||||
echo "Invalid profile. Please use 'performance', 'balanced', or 'power-saver'."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function get_profile {
|
||||
powerprofilesctl get
|
||||
}
|
||||
|
||||
function get_nficon {
|
||||
profile=$1
|
||||
case $profile in
|
||||
performance)
|
||||
echo ""
|
||||
;;
|
||||
balanced)
|
||||
echo ""
|
||||
;;
|
||||
power-saver)
|
||||
echo ""
|
||||
;;
|
||||
*)
|
||||
echo "Invalid profile"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function send_notification {
|
||||
profile=$(get_profile)
|
||||
icon="power-profile-$profile-symbolic"
|
||||
# Send the notification
|
||||
dunstify -i $icon -t 2500 -r 2593 -u normal "Power Profile: $profile"
|
||||
}
|
||||
|
||||
# Function to set the contents of "/tmp/powerprofile" to the current profile
|
||||
function set_tmp_powerprofile {
|
||||
profile=$(get_profile)
|
||||
nficon=$(get_nficon $profile)
|
||||
echo "$nficon $profile" > /tmp/powerprofile
|
||||
}
|
||||
|
||||
case $1 in
|
||||
performance|balanced|power-saver)
|
||||
set_profile $1
|
||||
send_notification
|
||||
set_tmp_powerprofile
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {performance|balanced|power-saver}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Executable
+78
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
|
||||
function get_volume {
|
||||
pactl get-sink-volume @DEFAULT_SINK@ | awk '/Volume:/ {print $5}' | cut -d '/' -f 1 | sed 's/%//g'
|
||||
}
|
||||
|
||||
function is_mute {
|
||||
#amixer get Master | grep '%' | grep -oE '[^ ]+$' | grep off > /dev/null
|
||||
pactl list sinks | grep -A 10 'State: ' | grep -q 'Mute: yes'
|
||||
}
|
||||
|
||||
function is_mic_mute {
|
||||
pactl list sources | grep -A 10 'State: ' | grep -q 'Mute: yes'
|
||||
}
|
||||
|
||||
function get_icon {
|
||||
volume=$(get_volume)
|
||||
if is_mute; then
|
||||
echo "audio-volume-muted-symbolic"
|
||||
elif (( volume <= 39 )); then
|
||||
echo "audio-volume-low-symbolic"
|
||||
elif (( volume <= 74 )); then
|
||||
echo "audio-volume-medium-symbolic"
|
||||
elif (( volume <= 100 )); then
|
||||
echo "audio-volume-high-symbolic"
|
||||
else
|
||||
echo "audio-volume-overamplified-symbolic"
|
||||
fi
|
||||
}
|
||||
|
||||
function send_notification {
|
||||
volume=$(get_volume)
|
||||
icon=$(get_icon)
|
||||
# Make the bar with the special character ─ (it's not dash -)
|
||||
# https://en.wikipedia.org/wiki/Box-drawing_character
|
||||
bar=$(seq -s "─" $(($volume / 5)) | sed 's/[0-9]//g')
|
||||
# Send the notification
|
||||
dunstify -i "$icon" -t 2500 -r 2593 -u normal " $bar"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
up)
|
||||
# Set the volume on (if it was muted)
|
||||
#amixer -D pulse set Master on > /dev/null
|
||||
# Up the volume (+ 5%)
|
||||
# amixer -D pu lse sset Master 5%+ > /dev/null
|
||||
volume=$(get_volume)
|
||||
if [[ $volume -le 99 ]]; then
|
||||
pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
else
|
||||
pactl set-sink-volume @DEFAULT_SINK@ 100%
|
||||
fi
|
||||
send_notification
|
||||
;;
|
||||
down)
|
||||
# amixer -D pulse set Master on > /dev/null
|
||||
# amixer -D pulse sset Master 5%- > /dev/null
|
||||
pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
send_notification
|
||||
;;
|
||||
mute)
|
||||
# Toggle mute
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
if is_mute ; then
|
||||
dunstify -i audio-volume-muted -t 2500 -r 2593 -u normal "Mute"
|
||||
else
|
||||
send_notification
|
||||
fi
|
||||
;;
|
||||
mute-mic)
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
if is_mic_mute ; then
|
||||
dunstify -i microphone-sensitivity-muted-symbolic -t 2500 -r 2593 -u normal "Microphone Muted"
|
||||
else
|
||||
dunstify -i microphone-sensitivity-high-symbolic -t 2500 -r 2593 -u normal "Microphone Unmuted"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user