Add script to connect to remote desktop

This commit is contained in:
Tom Willemse 2022-03-01 21:38:50 -08:00
parent c0deec6a74
commit 1b3dad4212
3 changed files with 46 additions and 0 deletions

View file

@ -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))))))

24
work/usr/bin/r-twillemse2223 Executable file
View file

@ -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)))

View file

@ -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 export DOTNET_CLI_TELEMETRY_OPTOUT=1
#+end_src #+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 * Systemd
Import some variables into the systemd environment so that services Import some variables into the systemd environment so that services