update sdu config, add eww timer
This commit is contained in:
parent
78d924243c
commit
39a62b5845
8 changed files with 114 additions and 3 deletions
|
|
@ -5,6 +5,7 @@
|
|||
:stacking "foreground"
|
||||
:exclusive false
|
||||
:namespace "eww-bar"
|
||||
:focusable "ondemand"
|
||||
:geometry (geometry :x "0%"
|
||||
; :y "0%"
|
||||
:y "0px"
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
:halign "end"
|
||||
(idleinhibit)
|
||||
(utilities)
|
||||
(timer)
|
||||
(volume)
|
||||
(network)
|
||||
(vpn)
|
||||
|
|
@ -63,6 +64,7 @@
|
|||
;rightgroup
|
||||
(include "modules/bar/idle_inhibit.yuck")
|
||||
(include "modules/bar/utilities.yuck")
|
||||
(include "modules/bar/timer.yuck")
|
||||
(include "modules/bar/volume.yuck")
|
||||
(include "variables/bar/network-manager.yuck")
|
||||
(include "modules/bar/network.yuck")
|
||||
|
|
|
|||
51
wayland/config/eww/scripts/bar/timer/bash_timer.sh
Executable file
51
wayland/config/eww/scripts/bar/timer/bash_timer.sh
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
((hours = minutes = seconds = 0))
|
||||
|
||||
while getopts "h:m:s:" flag; do
|
||||
case "${flag}" in
|
||||
h) hours="${OPTARG}" ;;&
|
||||
m) minutes="${OPTARG}" ;;&
|
||||
s) seconds="${OPTARG}" ;;&
|
||||
h | m | s)
|
||||
re='^[0-9]+$'
|
||||
if ! [[ "${OPTARG}" =~ $re ]]; then
|
||||
printf 'Error: flag "-%s" expected an integer, instead found "%s"\n' "${flag}" "${OPTARG}"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf 'invalid flag: -%s\n' "${flag}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
tick() {
|
||||
if [[ "${1}" -ge 3600 ]]; then
|
||||
timer_display="$(date -d@"${1}" -u +%H:%M:%S)"
|
||||
else
|
||||
timer_display="$(date -d@"${1}" -u +%M:%S)"
|
||||
fi
|
||||
printf '%s\n' "${timer_display}"
|
||||
if [[ "${1}" -gt 0 ]]; then
|
||||
sleep 1
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
#hours=1
|
||||
#minutes=0
|
||||
#seconds=1
|
||||
|
||||
((total_s = original_time = $((seconds + (minutes * 60) + (hours * 3600)))))
|
||||
|
||||
#echo "${total_s}"
|
||||
|
||||
while tick "${total_s}"; do ((total_s--)); done
|
||||
notify-send --urgency=critical --icon=/usr/share/icons/Adwaita/symbolic/status/alarm-symbolic.svg 'Timer elapsed!' "Timer set for $(date -d@"${original_time}" -u +%H:%M:%S) has completed"
|
||||
if [[ -f "/usr/share/sounds/ocean/stereo/alarm-clock-elapsed.oga" ]]; then
|
||||
paplay /usr/share/sounds/ocean/stereo/alarm-clock-elapsed.oga
|
||||
fi
|
||||
34
wayland/config/eww/scripts/bar/timer/bash_timer_startup.sh
Executable file
34
wayland/config/eww/scripts/bar/timer/bash_timer_startup.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
((hours = minutes = seconds = 0))
|
||||
|
||||
while getopts "h:m:s:" flag; do
|
||||
case "${flag}" in
|
||||
h) hours="${OPTARG}" ;;&
|
||||
m) minutes="${OPTARG}" ;;&
|
||||
s) seconds="${OPTARG}" ;;&
|
||||
h | m | s)
|
||||
re='^[0-9]+$'
|
||||
if ! [[ "${OPTARG}" =~ $re ]]; then
|
||||
printf 'Error: flag "-%s" expected an integer, instead found "%s"\n' "${flag}" "${OPTARG}"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf 'invalid flag: -%s\n' "${flag}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
pkill -f 'bash_timer.sh'
|
||||
|
||||
tmpdir="${XDG_RUNTIME_DIR}/bashtimer/"
|
||||
trap "rm -r ${tmpdir}" EXIT
|
||||
|
||||
if [[ -d "${tmpdir}" ]]; then
|
||||
rm -r "${tmpdir}"
|
||||
fi
|
||||
|
||||
mkdir -p "${tmpdir}"
|
||||
~/.config/eww/scripts/bar/timer/bash_timer.sh -h "${hours}" -m "${minutes}" -s "${seconds}" >"$(mktemp "${tmpdir}"/tmp.XXXXXX)"
|
||||
5
wayland/config/eww/scripts/bar/timer/timer_tail.sh
Executable file
5
wayland/config/eww/scripts/bar/timer/timer_tail.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -d "${XDG_RUNTIME_DIR}/bashtimer/" ]]; then
|
||||
tail -n1 "$(ls -d -1 "${XDG_RUNTIME_DIR}/bashtimer/"* | head -n1)"
|
||||
fi
|
||||
|
|
@ -98,6 +98,7 @@ $transition-time: 0.3s;
|
|||
@import "./bar/window_title.scss";
|
||||
@import "./bar/idle-inhibitor.scss";
|
||||
@import "./bar/utilities.scss";
|
||||
@import "./bar/timer.scss";
|
||||
@import "./bar/volume.scss";
|
||||
@import "./bar/networking.scss";
|
||||
@import "./bar/bluetooth.scss";
|
||||
|
|
|
|||
14
wayland/config/eww/style/bar/timer.scss
Normal file
14
wayland/config/eww/style/bar/timer.scss
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
.timer {
|
||||
/* color: $primary;
|
||||
padding: 0px 10px;*/
|
||||
@import "./styles/revealer.scss";
|
||||
.timerticker {
|
||||
button {
|
||||
padding: 0px 2px;
|
||||
}
|
||||
button:hover {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -122,8 +122,9 @@ icon = ""
|
|||
[profiles.program_args]
|
||||
browser = ["Development", "--new-window", "https://hass.pogmom.me"]
|
||||
browser_newtab = ["Development", "--new-tab", "https://hass.pogmom.me"]
|
||||
browser_profile = ["Development"]
|
||||
filemanager = ["~/Development"]
|
||||
terminal = ["~/Development", "-e", "zellij"]
|
||||
terminal = ["~/Development"]
|
||||
[[profiles.scripts]]
|
||||
name = "SSH dell-7050sff"
|
||||
icon = ""
|
||||
|
|
@ -152,8 +153,9 @@ icon = ""
|
|||
[profiles.program_args]
|
||||
browser = ["Housing", "--new-window", "https://eugenesca.com"]
|
||||
browser_newtab = ["Housing", "--new-tab", "https://eugenesca.com"]
|
||||
filemanager = ["~/Documents/Housing/SCA/"]
|
||||
terminal = ["~/Documents/Housing/SCA/"]
|
||||
browser_profile = ["Housing"]
|
||||
filemanager = ["~/NextcloudSCA/"]
|
||||
terminal = ["~/NextcloudSCA/"]
|
||||
[[profiles.scripts]]
|
||||
name = "House Meeting Minutes"
|
||||
icon = ""
|
||||
|
|
@ -174,6 +176,7 @@ icon = ""
|
|||
[profiles.program_args]
|
||||
browser = ["Work", "--new-window", "https://lanecc.edu"]
|
||||
browser_newtab = ["Work", "--new-tab", "https://lanecc.edu"]
|
||||
browser_profile = ["Work"]
|
||||
filemanager = ["~/Documents/Work/LaneCC"]
|
||||
terminal = ["~/Documents/Work/LaneCC/"]
|
||||
[[profiles.scripts]]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue