Browse Source

Replace old xaa() with xop() usage copying its arguments to clipboard

Alois Mahdal 8 months ago
parent
commit
48f04b37c9
1 changed files with 12 additions and 7 deletions
  1. 12
    7
      dotfiles/config/bashum/main.bashrc

+ 12
- 7
dotfiles/config/bashum/main.bashrc View File

500
     # Common clipboard operations with fixnl() on top
500
     # Common clipboard operations with fixnl() on top
501
     #
501
     #
502
     local op=$1
502
     local op=$1
503
-    local file=${2:-/dev/stdin}
503
+    local arg=${2:-/dev/stdin}
504
     case $op in
504
     case $op in
505
-        oo) xclip -selection clipboard -o    | fixnl ;;
506
-        o)  xclip -o                         | fixnl ;;
507
-        ii) fixnl -c | xclip -selection clipboard -i ;;
508
-        i)  fixnl -c | xclip -i                      ;;
509
-    esac <"$file"
505
+        aa) <<<"$arg" fixnl -c | xclip -selection clipboard -i ;;
506
+        a)  <<<"$arg" fixnl -c | xclip -i                      ;;
507
+        ii) <"$arg"   fixnl -c | xclip -selection clipboard -i ;;
508
+        i)  <"$arg"   fixnl -c | xclip -i                      ;;
509
+        oo) <"$arg"   xclip -selection clipboard -o    | fixnl ;;
510
+        o)  <"$arg"   xclip -o                         | fixnl ;;
511
+        *)  return 2 ;;
512
+    esac
513
+}
510
 xdl() {
514
 xdl() {
511
     #
515
     #
512
     # Download URL from primary clipboard to path $1
516
     # Download URL from primary clipboard to path $1
799
 alias pstree='pstree -h'
803
 alias pstree='pstree -h'
800
 alias virsh='virsh --connect qemu:///system'
804
 alias virsh='virsh --connect qemu:///system'
801
 alias wttr='curl -s "wttr.in/?1&n&q"'
805
 alias wttr='curl -s "wttr.in/?1&n&q"'
802
-alias xaa='xclip -o | audit2allow'
803
 alias xi='xop i'
806
 alias xi='xop i'
804
 alias xii='xop ii'
807
 alias xii='xop ii'
808
+alias xa='xop a'
809
+alias xaa='xop aa'
805
 alias xo='xop o'
810
 alias xo='xop o'
806
 alias xoo='xop oo'
811
 alias xoo='xop oo'
807
 alias reboot="echo -n . ; sync ; echo -n . ; sync ; echo -n . ; systemctl reboot"
812
 alias reboot="echo -n . ; sync ; echo -n . ; sync ; echo -n . ; systemctl reboot"