From 7c5104b52f8005ca0053dade72184c0a6735ac18 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 20 Mar 2021 14:55:27 -0400 Subject: [PATCH] ENH remove weird systemd mount thingies --- dot_bin/executable_with_gpg_mount | 25 +++---------------- dot_config/systemd/user/mbsync.service | 2 -- dot_config/systemd/user/mount-sshfs@.service | 7 ------ .../mount-sshfs@Music.service.d/mount.conf | 7 ------ .../mount-sshfs@Videos.service.d/mount.conf | 7 ------ .../systemd/user/mount-veracrypt@.service | 7 ------ .../mount.conf | 4 --- .../mount-veracrypt@ssh.service.d/mount.conf | 4 --- 8 files changed, 3 insertions(+), 60 deletions(-) delete mode 100644 dot_config/systemd/user/mount-sshfs@.service delete mode 100644 dot_config/systemd/user/mount-sshfs@Music.service.d/mount.conf delete mode 100644 dot_config/systemd/user/mount-sshfs@Videos.service.d/mount.conf delete mode 100644 dot_config/systemd/user/mount-veracrypt@.service delete mode 100644 dot_config/systemd/user/mount-veracrypt@gnupg.service.d/mount.conf delete mode 100644 dot_config/systemd/user/mount-veracrypt@ssh.service.d/mount.conf diff --git a/dot_bin/executable_with_gpg_mount b/dot_bin/executable_with_gpg_mount index a530991..f0a5b57 100644 --- a/dot_bin/executable_with_gpg_mount +++ b/dot_bin/executable_with_gpg_mount @@ -5,26 +5,7 @@ bin="$1" shift -## TODO most of this stuff could be more easily done in the rofi-extras -## haskell code where many of the edge cases that this is hoping to avoid are -## already strictly/brutally snuffed out by GHC's iron fist +alias="gnupg" -notify_error () { - notify-send --icon=dialog-error-symbolic "$1" -} - -notify_info () { - notify-send --icon=dialog-information-symbolic "$1" -} - -if ! systemctl --user is-active --quiet mount-veracrypt@gnupg.service; then - if systemctl --user --quiet start mount-veracrypt@gnupg.service; then - notify_info "Mounted $GNUPGHOME" - "$bin" "$@" - else - notify_error "Could not mount gnupg directory" - exit 1 - fi -else - "$bin" "$@" -fi +rofi-dev -c "$XDG_CONFIG_HOME/rofi/devices.yml" -m "$alias" \ + && "$bin" "$@" || echo "Could not mount $alias" diff --git a/dot_config/systemd/user/mbsync.service b/dot_config/systemd/user/mbsync.service index 1e4a343..5da4289 100644 --- a/dot_config/systemd/user/mbsync.service +++ b/dot_config/systemd/user/mbsync.service @@ -1,8 +1,6 @@ [Unit] Description=Mailbox synchronization service After=network.target network-online.target dbus.socket mount-veracrypt@gnupg.service -# we need gpg keys which are stored in a Veracrypt volume -Requires=mount-veracrypt@gnupg.service [Service] Type=oneshot diff --git a/dot_config/systemd/user/mount-sshfs@.service b/dot_config/systemd/user/mount-sshfs@.service deleted file mode 100644 index 938ca01..0000000 --- a/dot_config/systemd/user/mount-sshfs@.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Mount sshfs directory for %i - -[Service] -Type=forking -ExecStart=/usr/bin/sshfs ${TARGET} ${MOUNTPOINT} -ExecStop=/usr/bin/fusermount -u ${MOUNTPOINT} \ No newline at end of file diff --git a/dot_config/systemd/user/mount-sshfs@Music.service.d/mount.conf b/dot_config/systemd/user/mount-sshfs@Music.service.d/mount.conf deleted file mode 100644 index d82238c..0000000 --- a/dot_config/systemd/user/mount-sshfs@Music.service.d/mount.conf +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Requires=mount-veracrypt@ssh.service -After=mount-veracrypt@ssh.service - -[Service] -Environment="TARGET=portnoy4prez:/mnt/data/home/Music" -Environment="MOUNTPOINT=/mnt/data/Music" \ No newline at end of file diff --git a/dot_config/systemd/user/mount-sshfs@Videos.service.d/mount.conf b/dot_config/systemd/user/mount-sshfs@Videos.service.d/mount.conf deleted file mode 100644 index c4034de..0000000 --- a/dot_config/systemd/user/mount-sshfs@Videos.service.d/mount.conf +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Requires=mount-veracrypt@ssh.service -After=mount-veracrypt@ssh.service - -[Service] -Environment="TARGET=portnoy4prez:/mnt/data/home/Videos" -Environment="MOUNTPOINT=/mnt/data/Videos" diff --git a/dot_config/systemd/user/mount-veracrypt@.service b/dot_config/systemd/user/mount-veracrypt@.service deleted file mode 100644 index 7d0c7c5..0000000 --- a/dot_config/systemd/user/mount-veracrypt@.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Mount veracrypt volume for %i - -[Service] -Type=forking -ExecStart=%h/.bin/mount.veracrypt ${BW_NAME} ${VOLUME} ${MOUNTPOINT} -ExecStop=%h/.bin/umount.veracrypt ${MOUNTPOINT} \ No newline at end of file diff --git a/dot_config/systemd/user/mount-veracrypt@gnupg.service.d/mount.conf b/dot_config/systemd/user/mount-veracrypt@gnupg.service.d/mount.conf deleted file mode 100644 index e9766c5..0000000 --- a/dot_config/systemd/user/mount-veracrypt@gnupg.service.d/mount.conf +++ /dev/null @@ -1,4 +0,0 @@ -[Service] -Environment="BW_NAME=Veracrypt (gpg)" -Environment="VOLUME=/mnt/data/Documents/crypt/gnupg" -Environment="MOUNTPOINT=$GNUPGHOME" \ No newline at end of file diff --git a/dot_config/systemd/user/mount-veracrypt@ssh.service.d/mount.conf b/dot_config/systemd/user/mount-veracrypt@ssh.service.d/mount.conf deleted file mode 100644 index 1ea70c4..0000000 --- a/dot_config/systemd/user/mount-veracrypt@ssh.service.d/mount.conf +++ /dev/null @@ -1,4 +0,0 @@ -[Service] -Environment="BW_NAME=Veracrypt (ssh)" -Environment="VOLUME=/mnt/data/Documents/crypt/ssh-config" -Environment="MOUNTPOINT=%h/.ssh" \ No newline at end of file