mirror of
https://github.com/rywng/dotfiles.git
synced 2024-11-22 19:01:50 +08:00
Compare commits
6 Commits
d1643efc5c
...
99a5fe023a
Author | SHA1 | Date | |
---|---|---|---|
|
99a5fe023a | ||
|
45765c1a72 | ||
|
947364f20f | ||
|
0618d4cd1d | ||
|
55ecd4440b | ||
|
02ce96b663 |
5
.bashrc
5
.bashrc
@ -16,8 +16,3 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
# Put your fun stuff here.
|
# Put your fun stuff here.
|
||||||
|
|
||||||
# https://wiki.gentoo.org/wiki/Fish#fish_as_a_default_shell_with_bash_as_the_login_shell
|
|
||||||
# Use nu in place of bash
|
|
||||||
# keep this line at the bottom of ~/.bashrc
|
|
||||||
# [ -x /bin/nu ] && SHELL=/bin/nu exec nu
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit fd3bdba06fa3bffe1f3465ef6963606e71ba5ff4
|
Subproject commit 4fd5fd0e0ceef326f1b569354449187c9323014e
|
@ -11,8 +11,8 @@ set $menu fuzzel
|
|||||||
# my keybinds
|
# my keybinds
|
||||||
|
|
||||||
# screenshot
|
# screenshot
|
||||||
bindsym $mod+Print exec grimshot --cursor copy area
|
bindsym $mod+Print exec grim -g "$(slurp -d)" - | wl-copy
|
||||||
bindsym $mod+Shift+s exec grimshot --cursor copy area
|
bindsym $mod+Shift+s exec grim -g "$(slurp -d)" - | wl-copy
|
||||||
# notification client
|
# notification client
|
||||||
bindsym $mod+m exec swaync-client -t -sw
|
bindsym $mod+m exec swaync-client -t -sw
|
||||||
# Logout
|
# Logout
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Modified from sway's locking script
|
# Modified from sway's locking script
|
||||||
|
# TODO: remove bashism
|
||||||
|
|
||||||
|
if [[ ! $(which swayidle 2>/dev/null) ]]; then
|
||||||
if [[ ! $(which swayidle 2> /dev/null) ]]; then
|
notify-send "ERROR" "Swayidle not found"
|
||||||
notify-send "ERROR" "Swayidle not found"
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
choices=("suspend" "poweroff" "reboot" "lock")
|
choices=("suspend" "poweroff" "reboot" "lock")
|
||||||
choice=$(printf "%s\n" "${choices[@]}" | fuzzel -d --prompt "🔌: ")
|
choice=$(printf "%s\n" "${choices[@]}" | fuzzel -d --prompt "🔌: ")
|
||||||
|
|
||||||
|
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
|
||||||
|
playerctl stop
|
||||||
|
|
||||||
if test "$choice" = lock ; then
|
bright=$(light)
|
||||||
# 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 $sleep_time 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
||||||
|
&
|
||||||
|
idlepid=$!
|
||||||
|
|
||||||
swayidle -w \
|
# swaylock -e -c 282828 --inside-color 00000003
|
||||||
timeout 5 "light -S 1" resume "light -S $bright" \
|
swaylock -S --effect-blur "12x12" --effect-greyscale --effect-vignette 0.5:0.5 --inside-color 28282860 \
|
||||||
timeout $sleep_time 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
-e --ring-color 00000000 --line-color 00000000 --indicator --clock --text-color ebdbb2
|
||||||
&
|
|
||||||
idlepid=$!
|
|
||||||
|
|
||||||
# swaylock -e -c 282828 --inside-color 00000003
|
kill $idlepid
|
||||||
swaylock -S --effect-blur "12x12" --effect-greyscale --effect-vignette 0.5:0.5 --inside-color 28282860 \
|
swaymsg "output * power on"
|
||||||
-e --ring-color 00000000 --line-color 00000000 --indicator --clock --text-color ebdbb2
|
light -S $bright
|
||||||
|
|
||||||
kill $idlepid
|
|
||||||
swaymsg "output * power on"
|
|
||||||
light -S $bright
|
|
||||||
elif test -n "$choice"; then
|
elif test -n "$choice"; then
|
||||||
systemctl $choice
|
systemctl $choice
|
||||||
fi
|
fi
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
"clock"
|
"clock"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"~/.config/waybar/sway-modules.json"
|
"~/.config/waybar/sway-modules.jsonc"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
@ -44,8 +44,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"clock": {
|
"clock": {
|
||||||
"format": "{: %H:%M}",
|
"format": "{: %H:%M %m-%d}",
|
||||||
"format-alt": "{: %m-%d}",
|
"format-alt": " {:%A, %B %d, %Y (%r)}",
|
||||||
"tooltip-format": "<tt><small>{calendar}</small></tt>",
|
"tooltip-format": "<tt><small>{calendar}</small></tt>",
|
||||||
"calendar": {
|
"calendar": {
|
||||||
"mode": "year",
|
"mode": "year",
|
||||||
@ -90,8 +90,7 @@
|
|||||||
},
|
},
|
||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"exec": "playerctl -a metadata --format '{\"text\": \"{{playerName}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{markup_escape(title)}} - {{markup_escape(album)}}\", \"class\": \"{{status}}\", \"alt\": \"{{status}}\" }' -F",
|
"exec": "playerctl -a metadata --format '{\"text\": \"{{playerName}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{markup_escape(title)}} - {{markup_escape(album)}}\", \"class\": \"{{status}}\", \"alt\": \"{{status}}\" }' -F",
|
||||||
"max-length": 40,
|
"max-length": 48,
|
||||||
"on-click": "playerctl play-pause",
|
"on-click": "playerctl play-pause"
|
||||||
"on-click-right": "pavucontrol"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
12
.zshrc
12
.zshrc
@ -34,14 +34,14 @@ zinit light zsh-users/zsh-history-substring-search
|
|||||||
|
|
||||||
# Software
|
# Software
|
||||||
if ! command -v bat &> /dev/null ; then
|
if ! command -v bat &> /dev/null ; then
|
||||||
zinit ice as"command" from"gh-r" mv"bat* -> bat" pick"bat/bat"
|
zinit ice as"command" from"gh-r" mv"bat* -> bat" pick"bat/bat"
|
||||||
zinit light sharkdp/bat
|
zinit light sharkdp/bat
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v direnv &> /dev/null; then
|
zinit from"gh-r" as"program" mv"direnv* -> direnv" \
|
||||||
zinit ice from"gh-r" as"program" mv"direnv* -> direnv"
|
atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' \
|
||||||
zinit light direnv/direnv
|
pick"direnv" src="zhook.zsh" for \
|
||||||
fi
|
direnv/direnv
|
||||||
|
|
||||||
autoload -Uz _zinit
|
autoload -Uz _zinit
|
||||||
(( ${+_comps} )) && _comps[zinit]=_zinit
|
(( ${+_comps} )) && _comps[zinit]=_zinit
|
||||||
|
Loading…
Reference in New Issue
Block a user