Implement presentation mode
This commit is contained in:
@@ -22,6 +22,7 @@ general {
|
|||||||
order += volume_status
|
order += volume_status
|
||||||
order += spotify
|
order += spotify
|
||||||
order += "wifi"
|
order += "wifi"
|
||||||
|
order += presentation_mode
|
||||||
order += online_status
|
order += online_status
|
||||||
order += "battery_level all"
|
order += "battery_level all"
|
||||||
order += "clock"
|
order += "clock"
|
||||||
@@ -60,6 +61,11 @@ spotify {
|
|||||||
on_click 2 = "exec $HOME/.i3/scripts/spotify-control next"
|
on_click 2 = "exec $HOME/.i3/scripts/spotify-control next"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async_script presentation_mode {
|
||||||
|
format = "{output}"
|
||||||
|
script = "$HOME/.i3/scripts/presentation-mode status"
|
||||||
|
}
|
||||||
|
|
||||||
online_status {
|
online_status {
|
||||||
format = " {icon} "
|
format = " {icon} "
|
||||||
}
|
}
|
||||||
|
|||||||
40
i3/scripts/presentation-mode
Executable file
40
i3/scripts/presentation-mode
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
_status_file="${RUNDIR}/presentation-mode-on"
|
||||||
|
_autostart="$HOME/.autostart.sh"
|
||||||
|
|
||||||
|
is_on() {
|
||||||
|
[[ -e "${_status_file}" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_on() {
|
||||||
|
touch "${_status_file}"
|
||||||
|
systemctl --user --no-block stop dunst_user
|
||||||
|
systemctl --user --no-block stop redshift
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_off() {
|
||||||
|
rm -f "${_status_file}"
|
||||||
|
"$_autostart" dunst_user redshift
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
status)
|
||||||
|
if is_on ; then
|
||||||
|
printf "on\n"
|
||||||
|
printf '#F4BF75'
|
||||||
|
else
|
||||||
|
printf "off\n"
|
||||||
|
# printf '#F4BF75'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
toggle)
|
||||||
|
if is_on ; then
|
||||||
|
switch_off
|
||||||
|
else
|
||||||
|
switch_on
|
||||||
|
fi
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user