Merge branch 'x13'
# Conflicts: # .config/hypr/hyprland.conf # .config/hypr/hyprpaper.conf # .config/waybar/config # .gitignore # .zshrc # bin/alias # bin/brightness # bin/cycle_pactl.sh # bin/keep.sh # bin/lid_close.sh # bin/lid_open.sh # bin/startup.sh
This commit is contained in:
@@ -11,8 +11,8 @@ if test $action = up
|
||||
echo (math $current_value + $dvalue) > $backlight_device
|
||||
else if test $action = down
|
||||
set newVal (math $current_value - $dvalue)
|
||||
if test $newVal -lt 100
|
||||
set newVal 100
|
||||
if test $newVal -lt 2424
|
||||
set newVal 2424
|
||||
end
|
||||
echo New brightness value: $newVal
|
||||
echo $newVal > $backlight_device
|
||||
|
||||
@@ -4,13 +4,33 @@ set -e
|
||||
default_sink=$(pactl info | grep "Default Sink:" | cut '-d ' -f3)
|
||||
sinks=$(pactl list short sinks | cut -f2 | grep -v "^easyeffects_sink$")
|
||||
|
||||
# Only sinks that are available (not "not available")
|
||||
sinks=$(pactl list sinks | awk '
|
||||
$1=="Name:" {name=$2}
|
||||
$1=="State:" {state=$2}
|
||||
$1=="Availability:" {avail=$2}
|
||||
$1=="" {
|
||||
if (avail != "not") print name
|
||||
name=state=avail=""
|
||||
}
|
||||
' | grep -Ev '(^easyeffects_sink$|HDMI)')
|
||||
|
||||
sinks=$(pactl list short sinks | cut -f2 | grep -Ev '(^easyeffects_sink$|HDMI|skl_hda_dsp_generic)')
|
||||
|
||||
# for wrap-around
|
||||
sinks="$sinks
|
||||
$sinks"
|
||||
|
||||
next_sink=$(echo "$sinks" | awk "/$default_sink/{getline x;print x;exit;}")
|
||||
next_sink=$(echo "$sinks" | awk -v ds="$default_sink" '$0==ds {getline x; print x; exit}')
|
||||
|
||||
if [ -z "$next_sink" ]; then
|
||||
next_sink=$(echo "$sinks" | head -n 1)
|
||||
fi
|
||||
|
||||
echo "Setting output to $next_sink"
|
||||
pactl set-default-sink "$next_sink"
|
||||
|
||||
easyeffects_id=$(pactl list short sinks | awk '$2=="easyeffects_sink" {print $1; exit}')
|
||||
pactl list short sink-inputs | \
|
||||
cut -f1 | \
|
||||
xargs -I{} pactl move-sink-input {} "$next_sink"
|
||||
|
||||
@@ -3,24 +3,28 @@ set -euo pipefail
|
||||
|
||||
INTERNAL="eDP-1"
|
||||
|
||||
# Count non-internal monitors reported by Hyprland
|
||||
external_count=$(
|
||||
hyprctl monitors | awk -v internal="$INTERNAL" '
|
||||
$1 == "Monitor" {
|
||||
name = $2
|
||||
sub(":", "", name) # strip trailing colon
|
||||
if (name != internal) {
|
||||
print name
|
||||
}
|
||||
}
|
||||
' | wc -l
|
||||
sleep 0.2
|
||||
|
||||
external_on_count=$(
|
||||
hyprctl -j monitors | jq -r --arg internal "$INTERNAL" '
|
||||
[ .[]
|
||||
| select(.name != $internal)
|
||||
| select(.disabled != true)
|
||||
| select(.dpmsStatus == true)
|
||||
] | length
|
||||
'
|
||||
)
|
||||
|
||||
# Always turn off the laptop panel on lid close
|
||||
hyprctl keyword monitor "$INTERNAL, disable"
|
||||
if [ "$external_on_count" -eq 0 ]; then
|
||||
# no external screen, we sleep
|
||||
#systemctl hybrid-sleep
|
||||
#systemctl suspend-then-hibernate
|
||||
|
||||
# Only lock if there is NO external monitor
|
||||
if [ "$external_count" -eq 0 ]; then
|
||||
hyprlock
|
||||
systemctl suspend
|
||||
#debounce hyprlock
|
||||
pgrep -x hyprlock >/dev/null || hyprlock
|
||||
systemctl suspend-then-hibernatehyprctl
|
||||
else
|
||||
# docked, we turn off internal screen
|
||||
hyprctl keyword monitor "$INTERNAL, disable"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
hyprctl keyword monitor "eDP-1, preferred, 0x0, 1"
|
||||
swayosd-server &
|
||||
hyprpaper &
|
||||
set -euo pipefail
|
||||
|
||||
INTERNAL="eDP-1"
|
||||
|
||||
sleep 0.2
|
||||
hyprctl keyword monitor "$INTERNAL, preferred, 0x0, 1"
|
||||
|
||||
pgrep -x swayosd-server >/dev/null || swayosd-server &
|
||||
pgrep -x hyprpaper >/dev/null || hyprpaper &
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export TERMINAL=weztzerm
|
||||
|
||||
source /home/thierry/keepass.env
|
||||
source /home/thierry/bin/alias
|
||||
|
||||
@@ -10,23 +13,25 @@ killall xdg-desktop-portal
|
||||
sleep 2
|
||||
/usr/lib/xdg-desktop-portal &
|
||||
|
||||
nm-applet &
|
||||
|
||||
nextcloud --background &
|
||||
|
||||
|
||||
#jamesdsp -t &
|
||||
copyq --start-server &
|
||||
swayosd-server &
|
||||
#clight-gui --tray &
|
||||
blueman-tray &
|
||||
localsend --hidden &
|
||||
blueman-applet &
|
||||
mangohud steam -silent &
|
||||
#localsend --hidden &
|
||||
#jetbrains-toolbox &
|
||||
swaync &
|
||||
~/bin/keep.sh &
|
||||
hyprpaper &
|
||||
nm-applet &
|
||||
feishin &
|
||||
systemctl --user start hyprmarker.service &
|
||||
easyeffects -w &
|
||||
|
||||
~/bin/keep.sh &
|
||||
|
||||
blueman-tray &
|
||||
blueman-applet &
|
||||
copyq --start-server &
|
||||
easyeffects -w &
|
||||
feishin &
|
||||
hyprpaper &
|
||||
mangohud steam -silent &
|
||||
nextcloud --background &
|
||||
nm-applet &
|
||||
swaync &
|
||||
systemctl --user start hyprmarker.service &
|
||||
swayosd-server &
|
||||
28
bin/suspend.sh
Executable file
28
bin/suspend.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
pgrep -x hyprlock >/dev/null || hyprlock &
|
||||
systemctl suspend-then-hibernate
|
||||
|
||||
sleep 2
|
||||
|
||||
INTERNAL="eDP-1"
|
||||
|
||||
external_on_count=$(
|
||||
hyprctl -j monitors | jq -r --arg internal "$INTERNAL" '
|
||||
[ .[]
|
||||
| select(.name != $internal)
|
||||
| select(.disabled != true)
|
||||
| select(.dpmsStatus == true)
|
||||
] | length
|
||||
'
|
||||
)
|
||||
|
||||
if [ "$external_on_count" -eq 0 ]; then
|
||||
# no external screen, we enable internal screen
|
||||
hyprctl keyword monitor "$INTERNAL, 1920x1080@120, 0x0, 1"
|
||||
else
|
||||
# external monitor active, we turn off internal screen
|
||||
hyprctl keyword monitor "$INTERNAL, disable"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user