Skip to content

Commit ab938e6

Browse files
committed
Remove zsh -i flag for memo & weather-latvia
1 parent 158c9f7 commit ab938e6

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

memo

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
#!/bin/zsh -i
1+
#!/bin/zsh
22

33
# In God We Trust †
44
#
55
# A.D. MMXXV
66

7-
# Note: -i is for interactive terminal, to make `xc` alias available here.
8-
97
TMPDIR=${TMPDIR:-/tmp}
108
memo=${DOCS:-~/Documents}/memo
119

@@ -34,11 +32,17 @@ join_by() { local IFS="$1"; shift; echo "$*"; }
3432

3533
_copy() {
3634
echo
37-
read -q ans?"Copy to clipboard? "
35+
read -q ans\?"Copy to clipboard? "
3836
_cleanup
3937
[ "$ans" = n ] && return 0
40-
command -v xc &>/dev/null || return 1
41-
printf "${1:gs/%/%%}" | xc && echo "Copied!"
38+
printf "${1:gs/%/%%}" | (
39+
wl-copy &>/dev/null \
40+
|| termux-clipboard-set &>/dev/null \
41+
|| xclip -selection clipboard &>/dev/null \
42+
|| pbcopy &>/dev/null \
43+
|| exit 1
44+
) && echo "Copied!" \
45+
|| return 1
4246
}
4347

4448
show() {
@@ -105,7 +109,7 @@ _memo_edit() {
105109
)
106110

107111
local pass
108-
read -s pass?"GPG password: "
112+
read -s pass\?"GPG password: "
109113
echo
110114

111115
gpg --batch --passphrase $pass -o $temp --yes -qd $memo

weather-latvia

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/bin/zsh -i
1+
#!/bin/zsh
22

33
# In God We Trust †
44
#
5-
# A.D. MMXXIV
5+
# A.D. MMXXV
66

77
ID="P269"
88
NAME="Rīga, Rīgas pilsēta"
@@ -30,7 +30,7 @@ fi
3030
echo "$NAME"
3131

3232
HOUR_AGO=`date +%Y%m%d%H00 -d '-1 hour'`
33-
curl -s $API/weather_forecast_for_location_hourly?punkts=$ID \
33+
curl -s "$API/weather_forecast_for_location_hourly?punkts=$ID" \
3434
| jq -r '
3535
def fmt_temp_with_padding:
3636
.temperatura | tonumber | round

0 commit comments

Comments
 (0)