mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
worked on QML and other minor details
This commit is contained in:
@@ -202,6 +202,7 @@ in {
|
||||
"custom-mountkdrive"
|
||||
"waybar"
|
||||
"custom-gitnotify"
|
||||
"QS-notifycache" # builds the cache that will be used for the notification history
|
||||
|
||||
#########################
|
||||
# login autostart
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# creates and maintains cache file for the notification history
|
||||
{
|
||||
writeShellApplication,
|
||||
...
|
||||
}:
|
||||
writeShellApplication {
|
||||
name = "QS-notifycache";
|
||||
runtimeInputs = [
|
||||
];
|
||||
text = ''
|
||||
CACHE="$HOME/.cache/notify_history"
|
||||
# Create or erase existing cache
|
||||
mkdir -p "$(dirname "$CACHE")"
|
||||
: > "$CACHE" # truncate file
|
||||
echo "Notification history initialized at $(date)" >> "$CACHE"
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
writeShellApplication,
|
||||
...
|
||||
}:
|
||||
writeShellApplication {
|
||||
name = "QS-notifyhistory";
|
||||
runtimeInputs = [
|
||||
];
|
||||
text = ''
|
||||
app="$1"
|
||||
title="$2"
|
||||
body="$3"
|
||||
date="$(date +%T)"
|
||||
urgency="$4"
|
||||
|
||||
case "$urgency" in
|
||||
0) urgency_text="low";;
|
||||
1) urgency_text="normal";;
|
||||
2) urgency_text="critical";;
|
||||
*) urgency_text="unknown";;
|
||||
esac
|
||||
{
|
||||
echo "$app"
|
||||
echo "$title"
|
||||
echo "$body"
|
||||
echo "$date"
|
||||
echo "$urgency_text"
|
||||
|
||||
} >> "$HOME/.cache/notify_history"
|
||||
'';
|
||||
}
|
||||
@@ -47,7 +47,7 @@ for f in /sys/class/hwmon/hwmon*/fan*_input; do
|
||||
count=$((count + 1))
|
||||
fi
|
||||
done
|
||||
fan=$(( sum / count / 1000 ))
|
||||
fan=$(( sum / count ))
|
||||
fan=$(printf "%4s" "$fan")
|
||||
|
||||
mem=$(free | awk '/Mem:/ {printf("%.0f",$3/$2*100)}')
|
||||
|
||||
Reference in New Issue
Block a user