mirror of
https://github.com/rywng/dotfiles.git
synced 2024-11-22 02:41:50 +08:00
Refractor
This commit is contained in:
parent
851557200a
commit
7c19cae6eb
@ -23,7 +23,9 @@ if test "$choice" = lock ; then
|
||||
bright=`light`
|
||||
|
||||
swayidle -w \
|
||||
timeout 5 "light -S 1" resume "light -S $bright" &
|
||||
timeout 5 "light -S 1" resume "light -S $bright" \
|
||||
timeout $sleep_time 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' \
|
||||
&
|
||||
idlepid=$!
|
||||
|
||||
# swaylock -e -c 282828 --inside-color 00000003
|
||||
|
@ -6,8 +6,8 @@ standard_dialogs=gtk3
|
||||
style=Adwaita-Dark
|
||||
|
||||
[Fonts]
|
||||
fixed=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||
general=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||
fixed=@Variant(\0\0\0@\0\0\0\x1a\0I\0\x42\0M\0 \0P\0l\0\x65\0x\0 \0M\0o\0n\0o@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||
general=@Variant(\0\0\0@\0\0\0\x1a\0I\0\x42\0M\0 \0P\0l\0\x65\0x\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||
|
||||
[Interface]
|
||||
activate_item_on_single_click=1
|
||||
|
@ -6,8 +6,8 @@ standard_dialogs=gtk3
|
||||
style=Adwaita
|
||||
|
||||
[Fonts]
|
||||
fixed=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||
general=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||
fixed=@Variant(\0\0\0@\0\0\0\x1a\0I\0\x42\0M\0 \0P\0l\0\x65\0x\0 \0M\0o\0n\0o@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||
general=@Variant(\0\0\0@\0\0\0\x1a\0I\0\x42\0M\0 \0P\0l\0\x65\0x\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||
|
||||
[Interface]
|
||||
activate_item_on_single_click=1
|
||||
|
@ -6,8 +6,8 @@ standard_dialogs=gtk3
|
||||
style=Adwaita-Dark
|
||||
|
||||
[Fonts]
|
||||
fixed="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
general="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
fixed="IBM Plex Mono,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
general="IBM Plex Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
|
||||
[Interface]
|
||||
activate_item_on_single_click=1
|
||||
|
@ -6,8 +6,8 @@ standard_dialogs=gtk3
|
||||
style=Adwaita
|
||||
|
||||
[Fonts]
|
||||
fixed="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
general="Noto Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
fixed="IBM Plex Mono,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
general="IBM Plex Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
|
||||
[Interface]
|
||||
activate_item_on_single_click=1
|
||||
|
@ -1,17 +1,36 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Modified from sway's locking script
|
||||
|
||||
|
||||
if [[ ! $(which swayidle 2> /dev/null) ]]; then
|
||||
notify-send "ERROR" "Swayidle not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
choice=$(echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt " Choose power option" -Oalphabetical)
|
||||
|
||||
|
||||
choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt " Choose power option" -Oalphabetical`
|
||||
if test "$choice" = lock ; then
|
||||
# sleep less when power on
|
||||
if acpi -a | grep -q on; then
|
||||
sleep_time=3600
|
||||
else
|
||||
sleep_time=10
|
||||
fi
|
||||
sleep 0.3
|
||||
|
||||
bright=`light`
|
||||
|
||||
swayidle -w \
|
||||
timeout 5 "light -S 1" resume "light -S $bright" \
|
||||
timeout 10 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
||||
timeout $sleep_time 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
||||
&
|
||||
idlepid=$!
|
||||
swaylock -e -c 282828 --inside-color 00000003
|
||||
kill $idlepid
|
||||
swaymsg "output * power on"
|
||||
light -S $bright
|
||||
else
|
||||
loginctl $choice
|
||||
elif test -n "$choice"; then
|
||||
systemctl $choice
|
||||
fi
|
||||
|
@ -46,4 +46,4 @@ else
|
||||
ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper
|
||||
fi
|
||||
|
||||
sway reload
|
||||
hyprctl reload
|
||||
|
Loading…
Reference in New Issue
Block a user