initial commit

This commit is contained in:
daniel fusser
2026-06-21 15:35:58 +02:00
committed by dafu
parent ce5bbf3916
commit 49462fb909
49 changed files with 2269 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/bash
# Change brightness level with `light`.
# You can call this script like this:
# brightness.sh [up|down]
function get_brightness {
var=$(brightnessctl get)
echo "${var##* }" | sed 's/[^0-9][^.]*//g'
}
function send_notification {
DIR=$(dirname "$0")
brightness=$(get_brightness)
icon_name="${HOME}/.config/rice_assets/Icons/b.png"
# Send the notification
dunstify "Brightness: $brightness%" -h int:value:$brightness -i /usr/share/icons/Adwaita/96x96/status/display-brightness-symbolic.symbolic.png -t 1000 --replace=555 -u low
}
case $1 in
up)
swayosd-client --brightness +2
# brightnessctl set +1%
# send_notification
;;
down)
swayosd-client --brightness -2
# brightnessctl set 1%-
# send_notification
;;
esac
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# 获取mango命令输出并清理格式
output=$(mango -p 2>&1 | sed -r '
s/\x1b\[[0-9;]*[a-zA-Z]//g # 移除ANSI颜色代码
s/ ╰─/ ╰─/g # 压缩多余空格
s/^[[:space:]]*// # 删除行首空格
s/[[:space:]]*$// # 删除行尾空格
')
# 设置通知图标
icon="$HOME/.config/mango/wallpaper/mango.png"
# 如果没有输出或输出为空,则退出
if [[ -z "$output" ]]; then
exit 0
fi
# 发送通知
notify-send --urgency=critical --icon="$icon" "Mango Status" "$output"
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/bash
ps aux | grep -v grep |grep dimland | grep -v idle | awk '{print $2}' | xargs kill
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/bash
startd=$(pgrep waybar)
if [ -n "$startd" ]; then
pkill waybar
else
waybar -c ~/.config/mango/waybar/config.jsonc -s ~/.config/mango/waybar/style.css
fi
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/bash
#swayidle -w \
# timeout 1800 'swaylock -f -c 000000' \
# timeout 1800 'hyprctl dispatch dpms off' \
# resume 'hyprctl dispatch dpms on && ~/.config/hypr/scripts/restart_wlsunset.sh' \
# timeout 300 'bash $HOME/.config/hypr/scripts/lightresume.sh dark' \
# resume 'bash $HOME/.config/hypr/scripts/lightresume.sh resume' \
# timeout 3600 'systemctl suspend'
swayidle \
timeout 1800 'wlr-dpms off' \
resume 'wlr-dpms on && ~/.config/mango/scripts/restart_wlsunset.sh' \
timeout 300 'dimland -a 0.3' \
resume 'bash ~/.config/mango/scripts/exitdim.sh'
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/bash
enable=$(wlr-randr --json | jq --arg name "eDP-1" '.[] | select(.name == $name) | .enabled')
if [ $enable == "true" ]; then
wlr-randr --output eDP-1 --off
else
wlr-randr --output eDP-1 --on
fi
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/bash
set +e
ps aux | grep wlsunset | grep -v swayidle | grep -v restart | grep -v grep | awk '{print $2}' | xargs sudo kill
nohup wlsunset -T 3501 -t 3500 >> /dev/null 2<&1 &
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
# Function to find the first HEADLESS-* display
find_headless_display() {
wlr-randr --json | jq -r '.[] | select(.name | startswith("HEADLESS-")) | .name' | head -n 1
}
# Get the first HEADLESS display
HEADLESS_DISPLAY=$(find_headless_display)
if [ -z "$HEADLESS_DISPLAY" ]; then
mmsg -d create_virtual_output
notify-send "Creating virtual monitor"
HEADLESS_DISPLAY=$(find_headless_display)
# wlr-randr --output "$HEADLESS_DISPLAY" --pos 1926,0 --scale 1 --custom-mode 1920x1080@60Hz --on
# wlr-randr --output eDP-1 --pos 0,0 --scale 1
notify-send "Starting sunshine"
sunshine &
notify-send "Sunshine on"
exit 0
fi
# Now check and toggle status
enable=$(wlr-randr --json | jq --arg name "$HEADLESS_DISPLAY" '.[] | select(.name == $name) | .enabled')
if [ "$enable" == "true" ]; then
wlr-randr --output "$HEADLESS_DISPLAY" --off
pkill sunshine
notify-send "Sunshine off"
mmsg -d destroy_all_virtual_output
notify-send "Removed virtual monitor"
wlr-randr --output eDP-1 --pos 0,0 --scale 1
else
wlr-randr --output "$HEADLESS_DISPLAY" --on
sunshine &
notify-send "Sunshine on"
fi
+75
View File
@@ -0,0 +1,75 @@
#!/usr/bin/bash
# Changes de volume of the default sink
# Warning: This script offers no cap for volume,
# I'd advice to not go above 150% (which is the standard cap).
# You can call this script like this:
# volume.sh [up|down|mute]
function get_volume {
pactl get-sink-volume @DEFAULT_SINK@ | awk '{printf $5}' | cut -d '%' -f 1
}
function is_mute {
pactl get-sink-mute @DEFAULT_SINK@
}
function send_notification {
overvolume=`get_volume`
[[ $overvolume -gt 100 ]] && volume=100 || volume=$overvolume
#Set correct icon
if [[ $volume -eq 0 ]]
then
icon_name="${HOME}/.config/rice_assets/Icons/nov.png"
elif [[ $volume -lt 35 ]]
then
icon_name="${HOME}/.config/rice_assets/Icons/vlow.png"
elif [[ $volume -lt 70 ]]
then
icon_name="${HOME}/.config/rice_assets/Icons/vmid.png"
elif [[ $volume -lt 100 ]]
then
icon_name="${HOME}/.config/rice_assets/Icons/vhigh.png"
else
icon_name="${HOME}/.config/rice_assets/Icons/vthigh.png"
fi;
#bn=$(( (volume + 5) / 5 ))
#bar=$(seq -s "" $bn | sed 's/[0-9]//g')
# Send the notification
dunstify "Volume: $overvolume%" -h int:value:$volume -i /usr/share/icons/Adwaita/96x96/status/audio-volume-medium-symbolic.symbolic.png -t 1000 --replace=555 -u normal
}
case $1 in
up)
swayosd-client --output-volume 5
# # Set the volume on (if it was muted)
# pactl set-sink-mute @DEFAULT_SINK@ 0 > /dev/null
# # Up the volume (+ 5%)
# curvol=`get_volume`
# rem=$(( (curvol + 5) % 5 ))
# inc="+$(( 5 - rem ))%"
# pactl set-sink-volume @DEFAULT_SINK@ $inc > /dev/null
# send_notification
;;
down)
swayosd-client --output-volume -5
# pactl set-sink-mute @DEFAULT_SINK@ 0 > /dev/null
# curvol=`get_volume`
# rem=$(( (curvol - 5) % 5 ))
# inc="-$(( 5 + rem ))%"
# pactl set-sink-volume @DEFAULT_SINK@ $inc > /dev/null
# send_notification
;;
mute)
# Toggle mute
pactl set-sink-mute @DEFAULT_SINK@ toggle > /dev/null
if [[ `is_mute` == "Mute: yes" ]] ; then
dunstify -i "${HOME}/.config/rice_assets/Icons/mute.png" --replace=555 -u normal "Volume: Mute" -t 1000 -u critical
else
send_notification
fi
;;
esac