summaryrefslogtreecommitdiff
path: root/arch/scripts/.local/bin
diff options
context:
space:
mode:
authorsteven-na <noreply.github@stvnc.dev>2026-05-01 03:42:24 -0700
committersteven-na <noreply.github@stvnc.dev>2026-05-01 03:42:24 -0700
commit3e4d5813f5e7122d400ec1afa154535ebc441fae (patch)
treeda21e4d1d23bebf1dbda6255eba328b8842bddcf /arch/scripts/.local/bin
parent2ef9b580fc0cbdbff93ae01caecf586df4d35894 (diff)
fix weather/nvim, copy script start
Diffstat (limited to 'arch/scripts/.local/bin')
-rwxr-xr-xarch/scripts/.local/bin/copythe30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/scripts/.local/bin/copythe b/arch/scripts/.local/bin/copythe
new file mode 100755
index 0000000..0ba1cc2
--- /dev/null
+++ b/arch/scripts/.local/bin/copythe
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+set -eo pipefail
+
+declare -A sources
+sources[date]="date"
+sources[ip]="ip"
+
+tocopy=""
+
+case "$1" in
+ ${sources[date]} )
+ tocopy=$(date --rfc-3339 date)
+ ;;
+ ${sources[ip]} )
+ tocopy=$(curl --silent ifconfig.me)
+ ;;
+ *)
+ args=""
+ for val in "${sources[@]}"; do
+ args+="|${val}"
+ done
+
+ echo "usage: $0 (${args#|})"
+ exit
+ ;;
+
+esac
+
+echo "Copying: ${tocopy:0:50}"
+wl-copy ${tocopy}