From 1b65ba7a838e422c9bf16ddcaf796a996fa51b6b Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Fri, 27 Dec 2024 08:45:34 +0100 Subject: refactor: introduce profiles --- nixos/profiles/workstation/scripts/deploy-dir | 16 ++++++++++++++++ nixos/profiles/workstation/scripts/reset-bg | 2 ++ nixos/profiles/workstation/scripts/set-bg | 3 +++ 3 files changed, 21 insertions(+) create mode 100755 nixos/profiles/workstation/scripts/deploy-dir create mode 100644 nixos/profiles/workstation/scripts/reset-bg create mode 100644 nixos/profiles/workstation/scripts/set-bg (limited to 'nixos/profiles/workstation/scripts') diff --git a/nixos/profiles/workstation/scripts/deploy-dir b/nixos/profiles/workstation/scripts/deploy-dir new file mode 100755 index 0000000..bb7dfdf --- /dev/null +++ b/nixos/profiles/workstation/scripts/deploy-dir @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 3 ]; then + echo "usage: $0 " + exit 1 +fi +printf -v remote_dir %q $3 + +cd $1 +tar cf - . | ssh $2 "set -xe +TEMP_DIR=\$(mktemp -d) +cd \$TEMP_DIR +tar xvf - +rm -rf $remote_dir +mv \$TEMP_DIR $remote_dir +" diff --git a/nixos/profiles/workstation/scripts/reset-bg b/nixos/profiles/workstation/scripts/reset-bg new file mode 100644 index 0000000..5aa20f6 --- /dev/null +++ b/nixos/profiles/workstation/scripts/reset-bg @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +echo -en "\033]111\007" diff --git a/nixos/profiles/workstation/scripts/set-bg b/nixos/profiles/workstation/scripts/set-bg new file mode 100644 index 0000000..e78afdc --- /dev/null +++ b/nixos/profiles/workstation/scripts/set-bg @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +rgb_with_slashes=$(echo "$1" | sed -r 's,(..)(..),\1/\2/,') +echo -en "\033]11;rgb:$rgb_with_slashes\007" -- cgit v1.2.3