aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2022-03-01 21:38:50 -0800
committerGravatar Tom Willemse2022-03-01 21:43:31 -0800
commit1b3dad4212e6e6473ea13330cf0e43b98a0dff46 (patch)
tree34c2b25c5cf2291d686e1d9ad6ca4f11095947f9
parentc0deec6a74d0bfea6d212730fb128f7148493c31 (diff)
downloadnew-dotfiles-1b3dad4212e6e6473ea13330cf0e43b98a0dff46.tar.gz
new-dotfiles-1b3dad4212e6e6473ea13330cf0e43b98a0dff46.zip
Add script to connect to remote desktop
-rw-r--r--herbstluftwm/usr/share/scsh/herbstluft.scm14
-rwxr-xr-xwork/usr/bin/r-twillemse222324
-rw-r--r--zsh/profile.org8
3 files changed, 46 insertions, 0 deletions
diff --git a/herbstluftwm/usr/share/scsh/herbstluft.scm b/herbstluftwm/usr/share/scsh/herbstluft.scm
new file mode 100644
index 0000000..98dc6c0
--- /dev/null
+++ b/herbstluftwm/usr/share/scsh/herbstluft.scm
@@ -0,0 +1,14 @@
+(define-structure herbstluft (export hc hc-get-attr)
+ (open scheme-with-scsh
+ (subset srfi-13 (string-trim-both)))
+ (begin
+ (define-syntax hc
+ (syntax-rules ()
+ ((_ a ...)
+ (herbstclient `(a ...)))))
+
+ (define (herbstclient args)
+ (run (herbstclient ,@args)))
+
+ (define (hc-get-attr arg)
+ (string-trim-both (run/string (herbstclient attr ,arg))))))
diff --git a/work/usr/bin/r-twillemse2223 b/work/usr/bin/r-twillemse2223
new file mode 100755
index 0000000..a272043
--- /dev/null
+++ b/work/usr/bin/r-twillemse2223
@@ -0,0 +1,24 @@
+#!/usr/bin/env sh
+# -*- mode: scheme; -*-
+IFS=" "
+exec scsh -ll herbstluft.scm -o herbstluft -s "$0" "$@"
+!#
+
+(define tag-name "rdp")
+
+(dynamic-wind
+ (lambda () (hc add ,tag-name))
+ (lambda ()
+ (hc rule once class=xfreerdp floating=on ,(string-append "tag=" tag-name) switchtag=on)
+
+ (run (xfreerdp /u:WillemsenT /v:R-TWILLEMSE2223.re.sega.internal /f
+ /sound:sys:pulse +fonts "/floatbar:sticky:off,default:hidden"
+ -decorations /microphone:sys:pulse
+ ,(string-append "/p:" (run/string (secret-tool lookup service vpn host vpn.relic.com)))
+ -wallpaper -toggle-fullscreen)))
+ (lambda ()
+ (let ((current-tag (hc-get-attr 'tags.focus.name)))
+ (if (string= current-tag tag-name)
+ (hc use_previous)))
+ (hc merge_tag ,tag-name)))
+
diff --git a/zsh/profile.org b/zsh/profile.org
index 533abe8..98803b8 100644
--- a/zsh/profile.org
+++ b/zsh/profile.org
@@ -83,6 +83,14 @@ I don't want to send any telemetry to Microsoft about my usage of the ~dotnet~ t
export DOTNET_CLI_TELEMETRY_OPTOUT=1
#+end_src
+** SCSH
+
+Add a directory in my home to the list where scsh will try to load libraries from when using =-ll=. This variable is treated as a list of s-exps, so each element needs to be quoted. And =#f= means to insert the default list of directories there. scsh doesn't understand what =~/= means, so we need to use escaped quotes instead of wrapping everything in single quotes.
+
+#+begin_src sh
+ export SCSH_LIB_DIRS="#f \"${HOME}/usr/share/scsh/\""
+#+end_src
+
* Systemd
Import some variables into the systemd environment so that services