summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2024-09-11 03:39:28 +0900
committerMitsuo Tokumori <[email protected]>2024-09-11 03:39:28 +0900
commitdca319b8d9d221f1aaf3a00ee457d202096c66ac (patch)
tree7450c668226aea29b02f8fd9bd36240d1b9d2d20
parent4bc0383c5745d5fbd7e83d7ae68f765a9b2024e3 (diff)
downloaddotfiles-dca319b8d9d221f1aaf3a00ee457d202096c66ac.tar.gz
dotfiles-dca319b8d9d221f1aaf3a00ee457d202096c66ac.tar.bz2
dotfiles-dca319b8d9d221f1aaf3a00ee457d202096c66ac.zip
Update custom bash scripts
-rwxr-xr-xlocal/bin/laptop-backup.sh2
-rwxr-xr-xlocal/bin/laptop-xrandr.sh3
-rwxr-xr-xlocal/bin/myfile-handler.sh7
3 files changed, 10 insertions, 2 deletions
diff --git a/local/bin/laptop-backup.sh b/local/bin/laptop-backup.sh
index dffaf96..a22c179 100755
--- a/local/bin/laptop-backup.sh
+++ b/local/bin/laptop-backup.sh
@@ -31,7 +31,7 @@ rsync $rsync_options /var /mnt/$name # <10G
rsync $rsync_options /home /mnt/$name # <900G
rsync $rsync_options /etc /mnt/$name # <20M
echo "Backup complete."
-df -h | grep -E "${name}|var|home|etc"
+df -h #| grep -E "${name}|var|home|etc"
umount /mnt/$name
cryptsetup close $name
diff --git a/local/bin/laptop-xrandr.sh b/local/bin/laptop-xrandr.sh
index 01b0c52..cbe9479 100755
--- a/local/bin/laptop-xrandr.sh
+++ b/local/bin/laptop-xrandr.sh
@@ -19,4 +19,5 @@ simple_2_monitor() {
# Thank you: https://www.maketecheasier.com/how-to-setup-dual-monitors-with-xrandr/
# xrandr --auto --output HDMI-A-0 --mode 1920x1080 --right-of eDP
-simple_2_monitor
+#simple_2_monitor
+xrandr --auto --output HDMI-A-0 --mode 1920x1080 --right-of eDP
diff --git a/local/bin/myfile-handler.sh b/local/bin/myfile-handler.sh
new file mode 100755
index 0000000..40360b8
--- /dev/null
+++ b/local/bin/myfile-handler.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+# A script to handle custom protocol
+url="$1"
+
+file_path="${url#myfile://}"
+file_path="${file_path/\~/$HOME}"
+xdg-open "$file_path"