summaryrefslogtreecommitdiff
path: root/config/eww/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'config/eww/scripts')
-rwxr-xr-xconfig/eww/scripts/calendar.sh2
-rwxr-xr-xconfig/eww/scripts/day_format.sh14
-rwxr-xr-xconfig/eww/scripts/daytype.sh3
-rwxr-xr-xconfig/eww/scripts/month_format.sh3
-rwxr-xr-xconfig/eww/scripts/start.sh9
-rwxr-xr-xconfig/eww/scripts/year_format.sh3
6 files changed, 34 insertions, 0 deletions
diff --git a/config/eww/scripts/calendar.sh b/config/eww/scripts/calendar.sh
new file mode 100755
index 0000000..ada469a
--- /dev/null
+++ b/config/eww/scripts/calendar.sh
@@ -0,0 +1,2 @@
+#!bash
+cal -m
diff --git a/config/eww/scripts/day_format.sh b/config/eww/scripts/day_format.sh
new file mode 100755
index 0000000..a3e715a
--- /dev/null
+++ b/config/eww/scripts/day_format.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+day_of_month=$(date +"%d")
+day_of_month=$(echo $day_of_month | sed 's/^0*//')
+if [[ $day_of_month -ge 11 && $day_of_month -le 13 ]]; then
+ suffix="th"
+else
+ case $((day_of_month % 10)) in
+ 1) suffix="st" ;;
+ 2) suffix="nd" ;;
+ 3) suffix="rd" ;;
+ *) suffix="th" ;;
+ esac
+fi
+echo "${day_of_month}${suffix}"
diff --git a/config/eww/scripts/daytype.sh b/config/eww/scripts/daytype.sh
new file mode 100755
index 0000000..aad1cdc
--- /dev/null
+++ b/config/eww/scripts/daytype.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+day_type=$(date +"%a")
+echo "$day_type"
diff --git a/config/eww/scripts/month_format.sh b/config/eww/scripts/month_format.sh
new file mode 100755
index 0000000..2eecb3f
--- /dev/null
+++ b/config/eww/scripts/month_format.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+month=$(date +"%b")
+echo "$month"
diff --git a/config/eww/scripts/start.sh b/config/eww/scripts/start.sh
new file mode 100755
index 0000000..e032918
--- /dev/null
+++ b/config/eww/scripts/start.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Reload/Open eww
+eww kill
+eww daemon
+
+eww open year
+eww open month
+eww open day
diff --git a/config/eww/scripts/year_format.sh b/config/eww/scripts/year_format.sh
new file mode 100755
index 0000000..d8016be
--- /dev/null
+++ b/config/eww/scripts/year_format.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+year=$(date +"%Y")
+echo "$year"