Compare commits

...

2 Commits

Author SHA1 Message Date
Ryan e9b51b16db Better zsh 2023-12-28 22:02:02 +08:00
Ryan 7c19cae6eb Refractor 2023-12-15 13:57:38 +08:00
8 changed files with 43 additions and 18 deletions

View File

@ -12,9 +12,9 @@ choice=$(echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt
if test "$choice" = lock ; then
# sleep less when power on
# don't sleep when power on
if acpi -a | grep -q on; then
sleep_time=3600
sleep_time=86400
else
sleep_time=10
fi
@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -46,4 +46,4 @@ else
ln -s ~/Pictures/wall/sway/dark ~/.config/sway/Wallpaper
fi
sway reload
hyprctl reload

8
.zshrc
View File

@ -91,10 +91,14 @@ zstyle ':prompt:pure:git:stash' show yes
zstyle ':prompt:pure:prompt:success' color default
#edit in vim
autoload edit-command-line
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey '' edit-command-line
# better CTRL-w
autoload -Uz select-word-style
select-word-style bash
zmodload zsh/complist
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
@ -125,7 +129,7 @@ export MANROFFOPT="-c"
export BAT_THEME="ansi"
#local path
export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin"
export PATH="${PATH}:${HOME}/.local/bin:${HOME}/.scripts:${HOME}/cargo/bin:${HOME}/.cache/go/bin:${HOME}/.local/share/nvim/mason/bin}"
export MANPATH="${MANPATH}:${HOME}/.local/share/man"
#ccache support