Przeglądaj źródła

Add xpst_l() and xpst_la(), symlinking variants of xpst()

Alois Mahdal 2 miesięcy temu
rodzic
commit
629c553f48
1 zmienionych plików z 30 dodań i 0 usunięć
  1. 30
    0
      dotfiles/config/bashum/main.bashrc

+ 30
- 0
dotfiles/config/bashum/main.bashrc Wyświetl plik

654
         done
654
         done
655
 }
655
 }
656
 
656
 
657
+xpst_l() {
658
+    #
659
+    # Symlink paths from clipboard, with relative paths
660
+    #
661
+    { xop o; echo; } \
662
+      | while read -r path; do
663
+            echo "path='$path'" >&2
664
+            test -e "$path" || {
665
+                echo "does not exist: $path"
666
+                continue
667
+            }
668
+            ln -sr "$path" .
669
+        done
670
+}
671
+
672
+xpst_la() {
673
+    #
674
+    # Symlink paths from clipboard, with absolute paths
675
+    #
676
+    { xop o; echo; } \
677
+      | while read -r path; do
678
+            echo "path='$path'" >&2
679
+            test -e "$path" || {
680
+                echo "does not exist: $path"
681
+                continue
682
+            }
683
+            ln -s "$path" .
684
+        done
685
+}
686
+
657
 xvb() {
687
 xvb() {
658
     #
688
     #
659
     # Edit text in primary clipboard and run it using bash
689
     # Edit text in primary clipboard and run it using bash