Initial Commit

This commit is contained in:
klein panic
2024-08-08 15:30:46 -04:00
commit 7366e094a1
197 changed files with 44569 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
#!/bin/bash
icon_name="/usr/share/icons/Adwaita/16x16/status/display-brightness-symbolic.symbolic.png"
# Persistent loop to handle the system tray icon
while true
do
# Command to keep the icon in the systray and open the dialog on click
yad --notification --image="$icon_name" \
--command="bash -c '\
while : ; do \
current_brightness=\$(brightnessctl get 2>/dev/null); \
max_brightness=\$(brightnessctl max 2>/dev/null); \
brightness_percent=\$((current_brightness * 100 / max_brightness)); \
command_output=\$(yad --title \"Brightness Control\" --width=300 --height=150 --posx=810 --posy=575 \
--form --separator=\",\" --field=\"Set Brightness (0-100):NUM\" \"\$brightness_percent\"!0..100!1 \
--scale --value=\$brightness_percent --min-value=0 --max-value=100 --step=1 \
--button=\"Increase Brightness\":1 --button=\"Decrease Brightness\":2 --button=gtk-ok:0 --button=gtk-cancel:3 \
--fixed --undecorated --on-top --skip-taskbar --skip-pager 2>/dev/null); \
ret=\$?; \
case \$ret in \
0) \
new_brightness=\$(echo \$command_output | cut -d ',' -f 1); \
brightnessctl set \$new_brightness% > /dev/null 2>&1; \
break;; \
1) \
current_brightness=\$(brightnessctl get 2>/dev/null); \
max_brightness=\$(brightnessctl max 2>/dev/null); \
brightness_percent=\$((current_brightness * 100 / max_brightness)); \
new_brightness=\$((brightness_percent + 10)); \
[ \$new_brightness -gt 100 ] && new_brightness=100; \
brightnessctl set \$new_brightness% > /dev/null 2>&1; \
continue;; \
2) \
current_brightness=\$(brightnessctl get 2>/dev/null); \
max_brightness=\$(brightnessctl max 2>/dev/null); \
brightness_percent=\$((current_brightness * 100 / max_brightness)); \
new_brightness=\$((brightness_percent - 10)); \
[ \$new_brightness -lt 0 ] && new_brightness=0; \
brightnessctl set \$new_brightness% > /dev/null 2>&1; \
continue;; \
3) \
break;; \
*) \
break;; \
esac; \
done'"
# Sleep to ensure it doesn't respawn too quickly if closed
sleep 0.5
done

View File

@@ -0,0 +1,37 @@
#!/bin/bash
icon_name="/usr/share/icons/Adwaita/16x16/status/display-brightness-symbolic.symbolic.png"
# Persistent loop to handle the system tray icon
while true
do
# Command to keep the icon in the systray and open the dialog on click
yad --notification --image="$icon_name" \
--command="bash -c '\
while : ; do \
current_brightness=\$(brightnessctl get 2>/dev/null); \
max_brightness=\$(brightnessctl max 2>/dev/null); \
brightness_percent=\$((current_brightness * 100 / max_brightness)); \
command_output=\$(yad --title \"Brightness Control\" --width=300 --height=50 --posx=810 --posy=575 \
--form --separator=\",\" --field=\"Set Brightness (0-100):NUM\" \"\$brightness_percent\"!0..100!1 \
--button=\"Apply\":0 --button=\"Increase Brightness:1\" --button=\"Decrease Brightness:2\" --button=gtk-cancel:3 \
--fixed --undecorated --on-top --skip-taskbar --skip-pager 2>/dev/null); \
ret=\$?; \
case \$ret in \
0) \
new_brightness=\$(echo \$command_output | cut -d ',' -f 1); \
brightnessctl set \$new_brightness% > /dev/null 2>&1;; \
1) \
brightnessctl set +10% > /dev/null 2>&1;; \
2) \
brightnessctl set 10%- > /dev/null 2>&1;; \
3) \
break;; \
*) \
break;; \
esac; \
done'"
# Sleep to ensure it doesn't respawn too quickly if closed
sleep 0.5
done

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Icon path
icon_path="/usr/share/icons/Adwaita/16x16/devices/display-symbolic.symbolic.png"
# Persistent loop to handle the system tray icon
while true; do
yad --notification --image="$icon_path" \
--command="bash -c 'if pgrep -x conky > /dev/null; then killall conky; else conky & disown; fi'" &
# Wait for the tray icon to be closed
wait $!
# Sleep to ensure it doesn't respawn too quickly if closed
sleep 2
done

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# Icon path
icon_path="/usr/share/icons/Adwaita/16x16/devices/camera-photo-symbolic.symbolic.png"
# Directory to save screenshots
screenshot_dir="/home/klein/Pictures/screenshots"
export screenshot_dir # Export the directory path
# Ensure directory exists
mkdir -p "$screenshot_dir"
# Persistent loop to handle the system tray icon
while true; do
yad --notification --image="$icon_path" \
--command="bash -c '\
while :; do \
yad --title \"Screenshot Tool\" --width=300 --height=50 \
--button=\"Full Screen:0\" --button=\"Select Window:1\" --button=\"Cancel:2\" \
--center; \
ret=\$?; \
counter=1; \
while true; do \
file_path=\"\$screenshot_dir/Screenshot_\${counter}.png\"; \
if [[ ! -f \"\$file_path\" ]]; then \
break; \
fi; \
((counter++)); \
done; \
case \$ret in \
0) \
scrot \"\$file_path\"; \
break; ;; \
1) \
scrot -s \"\$file_path\"; \
break; ;; \
2|*) \
break; ;; \
esac; \
done'" \
# Sleep to ensure it doesn't respawn too quickly if closed
sleep 2
done

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
/home/klein/KleinWindowManagement/customstatusbar/systrays/screenshotsystray.sh &
/home/klein/KleinWindowManagement/customstatusbar/systrays/brightnesssystray2.sh &