Added README and examples.
This commit is contained in:
parent
0b1f5429ba
commit
4562ff8d59
|
@ -0,0 +1,12 @@
|
|||
Calculates a date and types it into any program.
|
||||
|
||||
Call this tool from a script using [Rofi](https://github.com/davatorium/rofi), [Dmenu](https://tools.suckless.org/dmenu/) or similar.
|
||||
|
||||
Supported commands:
|
||||
today
|
||||
tomorrow
|
||||
yesterday
|
||||
daybeforeyesterday
|
||||
dayaftertomorrow
|
||||
next<weekday> (e.g. nextmonday)
|
||||
last<weekday> (e.g. lastsaturday)
|
|
@ -0,0 +1,67 @@
|
|||
#!/bin/sh
|
||||
|
||||
cmd="$HOME/scripts/blinddate/target/release/blinddate"
|
||||
|
||||
prompt="Tag"
|
||||
|
||||
today="heute"
|
||||
tomorrow="morgen"
|
||||
yesterday="gestern"
|
||||
daybeforeyesterday="vorgestern"
|
||||
dayaftertomorrow="übermorgen"
|
||||
nextmonday="nächsten Montag"
|
||||
nexttuesday="nächsten Dienstag"
|
||||
nextwednesday="nächsten Mittwoch"
|
||||
nextthursday="nächsten Donnerstag"
|
||||
nextfriday="nächsten Freitag"
|
||||
nextsaturday="nächsten Samstag"
|
||||
nextsunday="nächsten Sonntag"
|
||||
lastmonday="letzten Montag"
|
||||
lasttuesday="letzten Dienstag"
|
||||
lastwednesday="letzten Mittwoch"
|
||||
lastthursday="letzten Donnerstag"
|
||||
lastfriday="letzten Freitag"
|
||||
lastsaturday="letzten Samstag"
|
||||
lastsunday="letzten Sonntag"
|
||||
|
||||
day=$(echo "$today
|
||||
$tomorrow
|
||||
$yesterday
|
||||
$daybeforeyesterday
|
||||
$dayaftertomorrow
|
||||
$nextmonday
|
||||
$nexttuesday
|
||||
$nextwednesday
|
||||
$nextthursday
|
||||
$nextfriday
|
||||
$nextsaturday
|
||||
$nextsunday
|
||||
$lastmonday
|
||||
$lasttuesday
|
||||
$lastwednesday
|
||||
$lastthursday
|
||||
$lastfriday
|
||||
$lastsaturday
|
||||
$lastsunday" | rofi -dmenu -i -p "$prompt")
|
||||
|
||||
case $day in
|
||||
"$today") "$cmd" today;;
|
||||
"$tomorrow") "$cmd" tomorrow;;
|
||||
"$yesterday") "$cmd" yesterday;;
|
||||
"$daybeforeyesterday") "$cmd" daybeforeyesterday;;
|
||||
"$dayaftertomorrow") "$cmd" dayaftertomorrow;;
|
||||
"$nextmonday") "$cmd" nextmonday;;
|
||||
"$nexttuesday") "$cmd" nexttuesday;;
|
||||
"$nextwednesday") "$cmd" nextwednesday;;
|
||||
"$nextthursday") "$cmd" nextthursday;;
|
||||
"$nextfriday") "$cmd" nextfriday;;
|
||||
"$nextsaturday") "$cmd" nextsaturday;;
|
||||
"$nextsunday") "$cmd" nextsunday;;
|
||||
"$lastmonday") "$cmd" lastmonday;;
|
||||
"$lasttuesday") "$cmd" lasttuesday;;
|
||||
"$lastwednesday") "$cmd" lastwednesday;;
|
||||
"$lastthursday") "$cmd" lastthursday;;
|
||||
"$lastfriday") "$cmd" lastfriday;;
|
||||
"$lastsaturday") "$cmd" lastsaturday;;
|
||||
"$lastsunday") "$cmd" lastsunday;;
|
||||
esac
|
|
@ -0,0 +1,67 @@
|
|||
#!/bin/sh
|
||||
|
||||
cmd="$HOME/scripts/blinddate/target/release/blinddate"
|
||||
|
||||
prompt="Day"
|
||||
|
||||
today="today"
|
||||
tomorrow="tomorrow"
|
||||
yesterday="yesterday"
|
||||
daybeforeyesterday="day before yesterday"
|
||||
dayaftertomorrow="day after tomorrow"
|
||||
nextmonday="next Monday"
|
||||
nexttuesday="next Tuesday"
|
||||
nextwednesday="next Wednesday"
|
||||
nextthursday="next Thursday"
|
||||
nextfriday="next Friday"
|
||||
nextsaturday="next Saturday"
|
||||
nextsunday="next Sunday"
|
||||
lastmonday="last Monday"
|
||||
lasttuesday="last Tuesday"
|
||||
lastwednesday="last Wednesday"
|
||||
lastthursday="last Thursday"
|
||||
lastfriday="last Friday"
|
||||
lastsaturday="last Saturday"
|
||||
lastsunday="last Sunday"
|
||||
|
||||
day=$(echo "$today
|
||||
$tomorrow
|
||||
$yesterday
|
||||
$daybeforeyesterday
|
||||
$dayaftertomorrow
|
||||
$nextmonday
|
||||
$nexttuesday
|
||||
$nextwednesday
|
||||
$nextthursday
|
||||
$nextfriday
|
||||
$nextsaturday
|
||||
$nextsunday
|
||||
$lastmonday
|
||||
$lasttuesday
|
||||
$lastwednesday
|
||||
$lastthursday
|
||||
$lastfriday
|
||||
$lastsaturday
|
||||
$lastsunday" | rofi -dmenu -i -p "$prompt")
|
||||
|
||||
case $day in
|
||||
"$today") "$cmd" today;;
|
||||
"$tomorrow") "$cmd" tomorrow;;
|
||||
"$yesterday") "$cmd" yesterday;;
|
||||
"$daybeforeyesterday") "$cmd" daybeforeyesterday;;
|
||||
"$dayaftertomorrow") "$cmd" dayaftertomorrow;;
|
||||
"$nextmonday") "$cmd" nextmonday;;
|
||||
"$nexttuesday") "$cmd" nexttuesday;;
|
||||
"$nextwednesday") "$cmd" nextwednesday;;
|
||||
"$nextthursday") "$cmd" nextthursday;;
|
||||
"$nextfriday") "$cmd" nextfriday;;
|
||||
"$nextsaturday") "$cmd" nextsaturday;;
|
||||
"$nextsunday") "$cmd" nextsunday;;
|
||||
"$lastmonday") "$cmd" lastmonday;;
|
||||
"$lasttuesday") "$cmd" lasttuesday;;
|
||||
"$lastwednesday") "$cmd" lastwednesday;;
|
||||
"$lastthursday") "$cmd" lastthursday;;
|
||||
"$lastfriday") "$cmd" lastfriday;;
|
||||
"$lastsaturday") "$cmd" lastsaturday;;
|
||||
"$lastsunday") "$cmd" lastsunday;;
|
||||
esac
|
Loading…
Reference in New Issue