Does this work

This commit is contained in:
2026-05-18 16:36:44 +05:30
parent b370921034
commit 2692a446ed
17 changed files with 167 additions and 62 deletions
+10
View File
@@ -0,0 +1,10 @@
{
"workspace": {
"library": [
"/usr/share/hypr/stubs"
]
},
"diagnostics": {
"globals": ["hl"]
}
}
+25 -5
View File
@@ -1,7 +1,7 @@
#!/bin/sh
remind() {
notify-send -e -i "$icon_dir/battery-010.svg" -h "string:x-canonical-private-synchronous:${0##*/}" "$1 % Battery $2, Please Plugin Charger!!" -u "$2"
notify() {
notify-send -e -i "$icon_dir/$1" -h "string:x-canonical-private-synchronous:${0##*/}" "$2" -u "${3:-normal}"
}
print_sleep() {
@@ -12,9 +12,29 @@ print_sleep() {
#declaration
battery="BAT0" #change accordingly
dir="/sys/class/power_supply/$battery/"
icon_dir="/usr/share/icons/Papirus/22x22/panel/" #change accordingly
icon_dir="/usr/share/icons/Papirus-Dark/22x22/panel/" #change accordingly
i=0
status="normal"
charge=$(cat "$dir"/capacity)
power_status=$(cat "$dir"/status)
case "$1" in
ac)
notify "battery-$(( charge / 10))0-charging.svg" "Power: AC Mode ($charge % $power_status)"
hyprctl keyword decoration:blur:enabled true
hyprctl keyword decoration:shadow:enabled true
exit 0
;;
battery)
notify "battery-$(( charge / 10))0.svg" "Power: Battery Mode ($charge % $power_status)"
hyprctl keyword decoration:blur:enabled false
hyprctl keyword decoration:shadow:enabled false
exit 0
;;
*) ;;
esac
#infinite loop
while charge=$(cat "$dir"/capacity); do
@@ -41,7 +61,7 @@ while charge=$(cat "$dir"/capacity); do
esac
# remind appropriately
[ "$status" != "normal" ] && remind "$charge" "$status"
[ "$status" != "normal" ] && notify "battery-010.svg" "$charge % Battery $status, Please Plugin Charger!!" "$status"
fi
print_sleep "$i" "$charge" "$status" "$1" #pass 'log' as argument to print logs
print_sleep "$i" "$charge" "$status" "$2" #pass 'log' as argument to print logs
done
+2 -2
View File
@@ -4,7 +4,7 @@ notify() {
notify-send -e "$1" -h "string:x-canonical-private-synchronous:${0##*/}" -i "$2" -u "${3:-normal}"
}
download_emoji_file(){
download_emoji_file() {
etag_file="$1.etag"
notify "Syncing Emoji Database..." "downloader"
curl -sL "https://unicode.org/Public/emoji/latest/emoji-test.txt" --etag-compare "$etag_file" --etag-save "$etag_file" -o "$1"
@@ -21,7 +21,7 @@ emoji=$(sed -nE 's|.*fully-qualified.*# (.*)|\1|p' "$emoji_file" | bemenu --fn '
# validation
[ -z "$emoji" ] && notify "No Emoji Selected" "" "critical" && exit 1
# copy to clipboard
# copy to clipboard
printf "%s" "$emoji" | wl-copy && notify "Copied: $emoji" "lol"
# enter in text
+4 -6
View File
@@ -1,10 +1,10 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitorv2 {
output = eDP-1
mode = highrr
mode = preferred
position = auto
scale = 1.5
vrr = 1
vrr = 2
bitdepth = 10
}
@@ -107,7 +107,6 @@ animations {
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
force_split=2
}
@@ -120,7 +119,6 @@ gestures {
misc {
force_default_wallpaper = 0
vfr = 1
}
xwayland {
@@ -140,7 +138,7 @@ bind = $mainMod, W, killactive,
bind = $mainMod, M, fullscreen,
bind = $mainMod, F, togglefloating,
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod, J, layoutmsg,togglesplit
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
@@ -300,6 +298,6 @@ exec-once = hypridle
exec-once = ssh-agent
exec-once = systemctl --user start hyprpolkitagent
exec-once = swaybg -i $HOME/.config/wall/1.png -m fill
exec-once = $hypr_dir/workspace 'focus'
exec-once = $hypr_dir/workspace focus
exec-once = $hypr_dir/battery
exec-once = $hypr_dir/themes
+4 -4
View File
@@ -1,19 +1,19 @@
#!/bin/sh
top -ibn5 -d1 | while read -r line;do
top -ibn5 -d1 | while read -r line; do
new_cpu=$(printf "%s" "$line" | sed -nE 's_%Cpu\(s\):[[:space:]]*(.*) us,.*_\1 %_p')
new_mem=$(printf "%s" "$line" | sed -nE 's_MiB Mem :[[:space:]]*(.*) total,.*,[[:space:]]*(.*) used,.*_\2 MB / \1 MB_p')
cpu=${new_cpu:-$cpu}
mem=${new_mem:-$mem}
[ -f "/tmp/yt-music/current" ] && . /tmp/yt-music/current
if [ -n "$new_mem" ];then
if [ -n "$new_mem" ]; then
temp=$(cat /sys/class/thermal/thermal_zone0/temp)
: $((temp /= 1000))
bat_stats=$(cat /sys/class/power_supply/BAT0/status)
vol_stats=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
charge=$(cat /sys/class/power_supply/BAT0/capacity)
[ "$bat_stats" = "Discharging" ] && { [ "$charge" -lt 20 ] && bat_icon=🪫 || bat_icon=🔋 ;} || bat_icon=🔌
[ "$bat_stats" = "Discharging" ] && { [ "$charge" -lt 20 ] && bat_icon=🪫 || bat_icon=🔋; } || bat_icon=🔌
printf '%s' "$vol_stats" | grep -q 'MUTED' && vol_icon=🔇 || vol_icon=🔊
notify-send -e -i "lol" "<----------(STATS)---------->" "🧠 CPU usage : $cpu\n🌡️ Cpu Temp : $temp °C\n🔳 RAM : $mem\n$bat_icon Battery : $charge (${bat_stats})\n☀️ Brightness : $("$(dirname "$0")"/brightness s)%\n$vol_icon Volume : $(printf '%s' "$vol_stats" | tr -cd '[0-9]' | sed 's|^0||g')%\n🎵 $SONG - $ARTIST" -h "string:x-canonical-private-synchronous:${0##*/}" -t 1500 &
fi
+2 -3
View File
@@ -3,14 +3,14 @@
tmp_file="/tmp/screenshot.png"
[ -f "$tmp_file" ] && rm -f "$tmp_file"
killall grim slurp
message="Screenshot copied to clipboard."
message="Screenshot copied to clipboard."
urgency="normal"
case "$1" in
fullclip)
grim - | tee "$tmp_file" | wl-copy -t image/png
;;
fullsave)
fullsave)
pics_dir="${XDG_PICTURES_DIR:-$HOME/pics}"
[ -d "$pics_dir" ] || mkdir -p "$pics_dir"
tmp_file="$pics_dir/$(date -u "+%Y-%m-%d_%H-%M-%S").png"
@@ -27,4 +27,3 @@ case "$1" in
esac
notify-send -e -h "string:x-canonical-private-synchronous:${0##*/}" -u "$urgency" -i "$tmp_file" "$message"
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
load() {
device=$(adb devices | sed '/^\*/d;/^List of devices/d;/^$/d' | cut -f1 | fzf -1)
[ -z "$device" ] && printf "Unable to detect Android using ADB" && exit 1
RES=$(adb -s "$device" shell dumpsys display | sed -nE 's|^[[:space:]]*DisplayModeRecord.*width=([0-9]*), height=([0-9]*), fps=([0-9\.]*).*|\2x\1@\3|p' | fzf --prompt="Select Resolution > " -1)
position=$(printf 'auto\nauto-left' | fzf --prompt="Which position? >")
if ! hyprctl monitors | grep -q "$HEADLESS"; then
hyprctl output create headless "$HEADLESS" | grep -q 'ok' && printf '\n\nCreate Headless Display: %s' "$HEADLESS"
fi
[ -z "$HEADLESS" ] && printf "Something went wrong\n" && return 1
hyprctl keyword monitor "$HEADLESS","$RES","$position",'1'
adb shell svc usb setFunctions rndis
printf "Sleep 2 seconds for USB tethering Interface to be UP and connected/"
sleep 2
# show ip
ip r
# start sunshine
sunshine > /dev/null
}
unload() {
hyprctl output remove "$HEADLESS"
}
HEADLESS="HEADLESS-ANDROID"
trap 'unload' INT HUP
# run the function
[ -z "$1" ] && help "$@"
$1 "$2"
+1 -1
View File
@@ -2,7 +2,7 @@
#shellcheck disable=SC2068
wpctl $@
vol=$(wpctl get-volume @DEFAULT_SINK@)
vol=$(wpctl get-volume @DEFAULT_SINK@)
vol_int=$(printf '%s' "$vol" | tr -cd '[:digit:]')
vol_icon="low"
[ "$vol_int" -gt 33 ] && vol_icon="medium"
+5 -6
View File
@@ -1,6 +1,5 @@
#!/bin/sh
# Wifi wrapper using iwctl
# config
@@ -8,7 +7,7 @@ adapter="wlan0"
divider="--------------------"
#menu
menu () {
menu() {
bemenu -R 20 --fn 'IBM Plex Sans 15' -i -c -W 0.5 -B 3 -p "$1" -l 26 -I "${2:-0}" -P ">>" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT" -x "$3"
}
@@ -36,19 +35,19 @@ connect() {
output=$?
fi
while iwctl station $adapter show | grep -q connecting;do
while iwctl station $adapter show | grep -q connecting; do
notify "Connecting to $wifi_name"
sleep 1
done
if [ "$output" -ne 0 ]; then
if [ "$output" -ne 0 ]; then
notify "Unable to connect to $wifi_name, try again later."
return 0
fi
notify "Connected: $wifi_name"
}
if iwctl device $adapter show | grep -q 'Powered.*off';then
if iwctl device $adapter show | grep -q 'Powered.*off'; then
option=$(printf 'Turn On' | menu '[iwd]')
[ -z "$option" ] && exit 0
iwctl device $adapter set-property Powered on
@@ -67,7 +66,7 @@ while option=$(printf 'Scan\nDisconnect\nTurn Off\nExit\n%s\n%s' "$divider" "$(s
;;
Scan)
iwctl station $adapter scan
while iwctl station wlan0 show | grep -q 'Scanning.*yes';do
while iwctl station wlan0 show | grep -q 'Scanning.*yes'; do
notify "Scanning For Networks"
sleep 1
done