mirror of
https://github.com/rywng/dotfiles.git
synced 2024-11-22 10:51:49 +08:00
Refractor
This commit is contained in:
parent
851557200a
commit
7c19cae6eb
@ -23,7 +23,9 @@ if test "$choice" = lock ; then
|
|||||||
bright=`light`
|
bright=`light`
|
||||||
|
|
||||||
swayidle -w \
|
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=$!
|
idlepid=$!
|
||||||
|
|
||||||
# swaylock -e -c 282828 --inside-color 00000003
|
# swaylock -e -c 282828 --inside-color 00000003
|
||||||
|
@ -6,8 +6,8 @@ standard_dialogs=gtk3
|
|||||||
style=Adwaita-Dark
|
style=Adwaita-Dark
|
||||||
|
|
||||||
[Fonts]
|
[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)
|
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\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\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]
|
[Interface]
|
||||||
activate_item_on_single_click=1
|
activate_item_on_single_click=1
|
||||||
|
@ -6,8 +6,8 @@ standard_dialogs=gtk3
|
|||||||
style=Adwaita
|
style=Adwaita
|
||||||
|
|
||||||
[Fonts]
|
[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)
|
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\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\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]
|
[Interface]
|
||||||
activate_item_on_single_click=1
|
activate_item_on_single_click=1
|
||||||
|
@ -6,8 +6,8 @@ standard_dialogs=gtk3
|
|||||||
style=Adwaita-Dark
|
style=Adwaita-Dark
|
||||||
|
|
||||||
[Fonts]
|
[Fonts]
|
||||||
fixed="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="Noto Sans,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]
|
[Interface]
|
||||||
activate_item_on_single_click=1
|
activate_item_on_single_click=1
|
||||||
|
@ -6,8 +6,8 @@ standard_dialogs=gtk3
|
|||||||
style=Adwaita
|
style=Adwaita
|
||||||
|
|
||||||
[Fonts]
|
[Fonts]
|
||||||
fixed="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="Noto Sans,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]
|
[Interface]
|
||||||
activate_item_on_single_click=1
|
activate_item_on_single_click=1
|
||||||
|
@ -1,17 +1,36 @@
|
|||||||
#!/bin/sh
|
#!/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
|
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`
|
bright=`light`
|
||||||
|
|
||||||
swayidle -w \
|
swayidle -w \
|
||||||
timeout 5 "light -S 1" resume "light -S $bright" \
|
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=$!
|
idlepid=$!
|
||||||
swaylock -e -c 282828 --inside-color 00000003
|
swaylock -e -c 282828 --inside-color 00000003
|
||||||
kill $idlepid
|
kill $idlepid
|
||||||
swaymsg "output * power on"
|
swaymsg "output * power on"
|
||||||
light -S $bright
|
light -S $bright
|
||||||
else
|
elif test -n "$choice"; then
|
||||||
loginctl $choice
|
systemctl $choice
|
||||||
fi
|
fi
|
||||||
|
@ -46,4 +46,4 @@ else
|
|||||||
ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper
|
ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sway reload
|
hyprctl reload
|
||||||
|
Loading…
Reference in New Issue
Block a user