add sway, waybar and rofi config

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
2024-06-07 18:18:06 +05:30
parent 3a0c68b8d9
commit c946a5f4cf
10 changed files with 1200 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
output=$(wakatime --today)
# Extract hours and minutes using awk and sum the total
total_minutes=$(echo "$output" | awk -F' ' '
{
for (i=1; i<=NF; i++) {
if ($i == "hrs" || $i == "hr") total += $(i-1) * 60;
if ($i == "mins" || $i == "min") total += $(i-1);
}
} END {print total}')
# Calculate total hours and remaining minutes
total_hours=$((total_minutes / 60))
remaining_minutes=$((total_minutes % 60))
# Print the results
printf '{"text":"%02dh %02dm","tooltip":"%s","class":"wakatime"}' $total_hours $remaining_minutes "$output" | jq --unbuffered --compact-output