mirror of
https://github.com/d3m0k1d/dots.git
synced 2026-03-15 02:12:43 +00:00
Add my dots
This commit is contained in:
11
.config/waybar/scripts/amixer-toggle.sh
Executable file
11
.config/waybar/scripts/amixer-toggle.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check the current state of the speaker
|
||||
state=$(amixer -D pulse sget Master | awk '/\[on\]/{print "unmute"; exit} /\[off\]/{print "mute"; exit}')
|
||||
|
||||
# Toggle the state of the speaker
|
||||
#
|
||||
if [ "$state" = "[on] "]; then
|
||||
amixer
|
||||
# amixer -D pulse sset Master "$state" > /dev/null
|
||||
|
||||
3
.config/waybar/scripts/brightness.sh
Normal file
3
.config/waybar/scripts/brightness.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
60
.config/waybar/scripts/colorpicker.sh
Executable file
60
.config/waybar/scripts/colorpicker.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
check() {
|
||||
command -v "$1" 1>/dev/null
|
||||
}
|
||||
|
||||
notify() {
|
||||
check notify-send && {
|
||||
notify-send -a "Color Picker" "$@"
|
||||
return
|
||||
}
|
||||
echo "$@"
|
||||
}
|
||||
|
||||
loc="$HOME/.cache/colorpicker"
|
||||
[ -d "$loc" ] || mkdir -p "$loc"
|
||||
[ -f "$loc/colors" ] || touch "$loc/colors"
|
||||
|
||||
limit=10
|
||||
|
||||
[[ $# -eq 1 && $1 = "-l" ]] && {
|
||||
cat "$loc/colors"
|
||||
exit
|
||||
}
|
||||
|
||||
[[ $# -eq 1 && $1 = "-j" ]] && {
|
||||
text="$(head -n 1 "$loc/colors")"
|
||||
|
||||
mapfile -t allcolors < <(tail -n +2 "$loc/colors")
|
||||
# allcolors=($(tail -n +2 "$loc/colors"))
|
||||
tooltip="<b> COLORS</b>\n\n"
|
||||
|
||||
tooltip+="-> <b>$text</b> <span color='$text'></span> \n"
|
||||
for i in "${allcolors[@]}"; do
|
||||
tooltip+=" <b>$i</b> <span color='$i'></span> \n"
|
||||
done
|
||||
|
||||
cat <<EOF
|
||||
{ "text":"<span color='$text'></span>", "tooltip":"$tooltip"}
|
||||
EOF
|
||||
|
||||
exit
|
||||
}
|
||||
|
||||
check hyprpicker || {
|
||||
notify "hyprpicker is not installed"
|
||||
exit
|
||||
}
|
||||
killall -q hyprpicker
|
||||
color=$(hyprpicker)
|
||||
|
||||
check wl-copy && {
|
||||
echo "$color" | sed -z 's/\n//g' | wl-copy
|
||||
}
|
||||
|
||||
prevColors=$(head -n $((limit - 1)) "$loc/colors")
|
||||
echo "$color" >"$loc/colors"
|
||||
echo "$prevColors" >>"$loc/colors"
|
||||
sed -i '/^$/d' "$loc/colors"
|
||||
pkill -RTMIN+1 waybar
|
||||
24
.config/waybar/scripts/myUpdates.sh
Executable file
24
.config/waybar/scripts/myUpdates.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
format() {
|
||||
if [ "$1" -eq 0 ]; then
|
||||
echo '-'
|
||||
else
|
||||
echo "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
if ! updates_arch="$(checkupdates | wc -l)"; then
|
||||
updates_arch=0
|
||||
fi
|
||||
|
||||
if ! updates_aur="$(yay -Qum 2>/dev/null | wc -l)"; then
|
||||
updates_aur=0
|
||||
fi
|
||||
|
||||
updates="$((updates_arch + updates_aur))"
|
||||
|
||||
if [ "$updates" -gt 0 ]; then
|
||||
echo " ($(format $updates_arch)/$(format $updates_aur))"
|
||||
else
|
||||
echo
|
||||
fia
|
||||
22
.config/waybar/scripts/myupdate.sh
Executable file
22
.config/waybar/scripts/myupdate.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
pkgmgr="pacman"
|
||||
hash paru 2>/dev/null && pkgmgr="paru"
|
||||
hash yay 2>/dev/null && pkgmgr="yay"
|
||||
|
||||
IFS=$'\n'$'\r'
|
||||
|
||||
updatesli=($($pkgmgr -Qu))
|
||||
text=${#updatesli[@]}
|
||||
icon=""
|
||||
[ $text -eq 0 ] && icon="" || icon="📦"
|
||||
|
||||
for i in ${updatesli[@]}
|
||||
do
|
||||
tooltip+="$i\n"
|
||||
done
|
||||
|
||||
cat << EOF
|
||||
{ "text":"$icon", "tooltip":"UPDATES: $text"}
|
||||
EOF
|
||||
|
||||
10
.config/waybar/scripts/powerdraw.sh
Executable file
10
.config/waybar/scripts/powerdraw.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f /sys/class/power_supply/BAT*/power_now ]; then
|
||||
powerDraw=" $(($(cat /sys/class/power_supply/BAT*/power_now)/1000000))w"
|
||||
fi
|
||||
|
||||
|
||||
cat << EOF
|
||||
{ "text":"$powerDraw", "tooltip":"power Draw $powerDraw"}
|
||||
EOF
|
||||
24
.config/waybar/scripts/weather.sh
Executable file
24
.config/waybar/scripts/weather.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
BSSIDS="$(nmcli device wifi list |
|
||||
awk 'NR>1 {if ($1 != "*") {print $1}}' |
|
||||
tr -d ":" |
|
||||
tr "\n" ",")"
|
||||
|
||||
LOC=""
|
||||
REQUEST_GEO="$(wget -qO - http://openwifi.su/api/v1/bssids/"$BSSIDS")"
|
||||
if [[ "$(jq ".count_results" <<< "$REQUEST_GEO")" -gt 0 ]] ; then
|
||||
LAT="$(jq ".lat" <<< "$REQUEST_GEO")"
|
||||
LON="$(jq ".lon" <<< "$REQUEST_GEO")"
|
||||
LOC="$LAT,$LON"
|
||||
fi
|
||||
|
||||
text="$(curl -s "https://wttr.in/$LOC?format=1" | sed 's/ //g')"
|
||||
tooltip="$(curl -s "https://wttr.in/$LOC?0QT" |
|
||||
sed 's/\\/\\\\/g' |
|
||||
sed ':a;N;$!ba;s/\n/\\n/g' |
|
||||
sed 's/"/\\"/g')"
|
||||
|
||||
if ! grep -q "Unknown location" <<< "$text"; then
|
||||
echo "{\"text\": \"$text\", \"tooltip\": \"<tt>$tooltip</tt>\", \"class\": \"weather\"}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user