i3,polybar: Add bind and make calendar toggleable
This commit is contained in:
@@ -204,6 +204,7 @@ for_window [class="^$TERMINAL-256color$" title="^polybar-datetime-calendar$"] \
|
|||||||
border pixel 3, \
|
border pixel 3, \
|
||||||
resize set 378 300, \
|
resize set 378 300, \
|
||||||
move position 1411 32
|
move position 1411 32
|
||||||
|
bindsym $mod+c exec ~/.config/polybar/scripts/calendar.sh -t &
|
||||||
|
|
||||||
# screenshots
|
# screenshots
|
||||||
bindsym --release Print exec gnome-screenshot -i
|
bindsym --release Print exec gnome-screenshot -i
|
||||||
|
|||||||
@@ -3,13 +3,12 @@
|
|||||||
XDG_CONF="${XDG_CONFIG_HOME:-$HOME/.config}"
|
XDG_CONF="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
BASE_DIR="$XDG_CONF/polybar"
|
BASE_DIR="$XDG_CONF/polybar"
|
||||||
|
|
||||||
calendar_exec="st -A 0.45 -t polybar-datetime-calendar \"$BASE_DIR/scripts/calendar.sh\" &"
|
|
||||||
declare -A module_flags
|
declare -A module_flags
|
||||||
module_flags=(
|
module_flags=(
|
||||||
[battery]="$BASE_DIR/scripts/battery.sh"
|
[battery]="$BASE_DIR/scripts/battery.sh"
|
||||||
[bluetooth]="$BASE_DIR/scripts/bluetooth.sh"
|
[bluetooth]="$BASE_DIR/scripts/bluetooth.sh"
|
||||||
[bluetooth_click_left]="$BASE_DIR/scripts/bluetooth.sh --toggle &"
|
[bluetooth_click_left]="$BASE_DIR/scripts/bluetooth.sh --toggle &"
|
||||||
[datetime]="%{A1:$calendar_exec:} %date% - %time% %{A}"
|
[datetime]="%{A1:$BASE_DIR/scripts/calendar.sh -t &:} %date% - %time% %{A}"
|
||||||
[media]="$BASE_DIR/scripts/media.sh"
|
[media]="$BASE_DIR/scripts/media.sh"
|
||||||
[powermenu]="%{A1:$XDG_CONF/rofi/powermenu.sh &:}%{T2}...%{T-}%{A}"
|
[powermenu]="%{A1:$XDG_CONF/rofi/powermenu.sh &:}%{T2}...%{T-}%{A}"
|
||||||
[vpn]="$BASE_DIR/scripts/vpn.sh"
|
[vpn]="$BASE_DIR/scripts/vpn.sh"
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ if [[ $# -eq 0 ]]; then
|
|||||||
# Call fzf
|
# Call fzf
|
||||||
cal -wm | fzf "${FZF_ARGS[@]}"
|
cal -wm | fzf "${FZF_ARGS[@]}"
|
||||||
exit 0
|
exit 0
|
||||||
|
elif [[ $1 = "-t" ]]; then
|
||||||
|
TITLE=polybar-datetime-calendar
|
||||||
|
|
||||||
|
# Kill and exit if already running to achieve a toggle.
|
||||||
|
! pkill -f "$TITLE" || exit 0
|
||||||
|
|
||||||
|
exec st -A 0.45 -t "$TITLE" "$0"
|
||||||
else
|
else
|
||||||
# Backend
|
# Backend
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user