Browse Source

Add xop() to apply fixnl to common clipboard-related annoyances

Alois Mahdal 8 years ago
parent
commit
579d55b303
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      dotfiles/bash/main.bashrc

+ 13
- 0
dotfiles/bash/main.bashrc View File

@@ -144,6 +144,19 @@ fixnl() {
144 144
     rm "$cache"
145 145
 }
146 146
 
147
+xop() {
148
+    #
149
+    # Common clipboard operations with fixnl() on top
150
+    #
151
+    local op=$1
152
+    case $op in
153
+        oo) xclip -selection clipboard -o    | fixnl ;;
154
+        o)  xclip -o                         | fixnl ;;
155
+        ii) fixnl -c | xclip -selection clipboard -i ;;
156
+        i)  fixnl -c | xclip -i                      ;;
157
+    esac
158
+}
159
+
147 160
 xod() {
148 161
     #
149 162
     # Like mktemp but get the content from clipboard