diff --git a/de/home/.config/eww/modules/home.yuck b/de/home/.config/eww/modules/home.yuck index 8204f4a..05b1e11 100644 --- a/de/home/.config/eww/modules/home.yuck +++ b/de/home/.config/eww/modules/home.yuck @@ -8,10 +8,12 @@ (weather :json weather_status) (shortcuts) (notes :json {jq(notes_list,'.notes')}) + (softwareupdates :json {software_list}) (reminders :json {jq(reminders_list,'.reminders')}))) (include "modules/home/rat.yuck") (include "modules/home/weather.yuck") (include "modules/home/shortcuts.yuck") (include "modules/home/notes.yuck") +(include "modules/home/softwareupdates.yuck") (include "modules/home/reminders.yuck") diff --git a/de/home/.config/eww/modules/home/notes.yuck b/de/home/.config/eww/modules/home/notes.yuck index 91f38cc..4b72cb3 100644 --- a/de/home/.config/eww/modules/home/notes.yuck +++ b/de/home/.config/eww/modules/home/notes.yuck @@ -2,6 +2,7 @@ 'scripts/home/notes') (defwidget notes [json] (box + :visible {jq(workspacesArray, '.[]\|select(.focused==true).num') <= 9} :class "notes" :orientation "v" :halign "baseline" diff --git a/de/home/.config/eww/modules/home/softwareupdates.yuck b/de/home/.config/eww/modules/home/softwareupdates.yuck new file mode 100644 index 0000000..eb4cc0d --- /dev/null +++ b/de/home/.config/eww/modules/home/softwareupdates.yuck @@ -0,0 +1,25 @@ +(defpoll software_list :interval "43200s" + 'software-release-monitor') +(defwidget softwareupdates [json] + (box + :visible {(jq(workspacesArray, '.[]\|select(.focused==true).num') <= 19) && (jq(workspacesArray, '.[]\|select(.focused==true).num') >= 10)} + :class "notes" + :orientation "v" + :halign "baseline" + :width 300 + :height 150 + :space-evenly true + (for note in json + (button :onclick "kate -n '${note.filepath}'" + (box + :orientation "v" + (label + :xalign 0 + :wrap false + :truncate true + :text "${replace(note.filepath,"${get_env("HOME")}/Documents/Notes/",'')}") + (label + :xalign 0.5 + :class "timestamp" + :text "${formattime("${note.date}","%F %R")}")))) + )) diff --git a/de/home/.config/software-release-monitor/config.json b/de/home/.config/software-release-monitor/config.json new file mode 100644 index 0000000..58a3558 --- /dev/null +++ b/de/home/.config/software-release-monitor/config.json @@ -0,0 +1,10 @@ +[ + { + "packageName":"eww", + "upstreamURL":"https://github.com/elkowar/eww" + }, + { + "packageName":"swayfx", + "upstreamURL":"https://github.com/WillPower3309/swayfx" + } +] diff --git a/de/home/.local/bin/software-release-monitor b/de/home/.local/bin/software-release-monitor new file mode 100755 index 0000000..9c82fe7 --- /dev/null +++ b/de/home/.local/bin/software-release-monitor @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +source ${HOME}/.secrets +function get_package_info(){ + packages_array=() + + while read i; do + echo "${i}" + package_name=$(jq -r '.packageName' <<<"${i}") + upstream_url=$(jq -r '.upstreamURL' <<<"${i}") + package_version=$(dpkg-query -W -f='${Version}' "${package_name}") + upstream_version=$(lastversion "${upstream_url}") + if [[ "${package_version}" == *"${upstream_version}"* ]]; then + up_to_date='true' + else + up_to_date='false' + fi + package_json=$( jq -n --arg name "${package_name}" --arg pkgver "${package_version}" --arg upstreamver "${upstream_version}" --arg uptodate "${up_to_date}" '{package_name: $name, package_version: $pkgver, upstream_version: $upstreamver, up_to_date: $uptodate}' ) + packages_array+=("${package_json}") + done < <(jq -c '.[]' "${HOME}/.config/software-release-monitor/config.json") +packages_json=$(printf '%s\n' "${packages_array[@]}" | jq -s .) +echo "${packages_json}" + +#echo "${package_array_item}" +#echo "${package_array[@]}" +} + +get_package_info + +#printf '%s\n' "${package_array[@]}" | jq -s . + + +#dpkg-query -W -f='${Version}' swayfx diff --git a/de/include b/de/include index c130a8c..cd19a89 100644 --- a/de/include +++ b/de/include @@ -45,3 +45,5 @@ .config/katerc .local/share/applications/SuperColliderIDE.desktop .local/bin/noise +.local/bin/software-release-monitor +.config/software-release-monitor/config.json