Questions tagged [xsel]
xsel is a command line tool for manipulating the 'clipboard' in an X Window System environment.
21
questions
0
votes
2
answers
40
views
how to get file path without the filename itself
im trying to find my .csv files then cd into their directory:
find Documents/notes -type f -name "*.csv" | head -1 | xsel -b
this copies the first file dir into my clipboard and i'd like to ...
0
votes
1
answer
36
views
xsel not outputing to file in bash script
I am currently learning French, and in order to streamline my study process, I would like to have a script that allows me to look up words on Wiktionary and keep a record of my searches for later ...
1
vote
1
answer
59
views
How to run command when user push ctrl+c?
User selects any text and push ctrl+c. How to autorun command after this action?
I need solutions for:
How to get notification/check about the state of the clipboard
After notification/check will ...
2
votes
0
answers
285
views
How to paste selection from vi-mode to clipboard
I want to access the content of what I copied in the buffer with the vi-mode of the clipboard via the command ctrl + v or ctrl + shift + v in the terminal.
I copied in my .zshrc the following: (from ...
3
votes
2
answers
956
views
Linux clipboards, including with WSL consoles
It occurred to me that there are multiple clipboards on any given Linux console:
First is the bash clipboard, this can be invoked by Ctrl-U / K, cut all line before (U) or after (K) cursor into ...
0
votes
2
answers
1k
views
How do I copy a file to the clipboard with the terminal?
I'm aware of how to copy the contents of file:
xsel -b < myfile.txt
But this is not what I want.
I would like something like this:
./file2clip.sh myfile.txt
Which would copy myfile.txt to the ...
1
vote
1
answer
281
views
How to avoid xsel sending text to clipboard with space/Enter at the end
I am trying to answer this other question: Command/script to start a terminal, enter text but don't execute.... I want to start the terminal and add specific text to it without executing, thus ...
3
votes
1
answer
716
views
Copying text with Ctrl + C when the Zsh line editor is active
I've added some keyboard shortcuts in my Zsh to enable selecting words.
In order for the selection to do something, I would like to use Ctrl + C to copy it. However I would also like to use Ctrl + C ...
2
votes
1
answer
1k
views
zsh - optimize copy, cut, paste using ctrl+c, ctrl+x, ctrl+v
I am using the following config in my .zshrc.
if [[ -t 0 && $- = *i* ]]
then
# change Ctrl+C to Ctrl+I
stty start ''
stty stop ''
stty quit ''
stty erase ''
stty kill ''
stty eof '' # Ctrl + D
...
0
votes
1
answer
96
views
Yank trimmed string in tmux copy mode
I am trying to yank string without trailing and heading spaces using this keybinding:
bind-key -T copy-mode-vi z send-keys -X \
copy-pipe 'sed "s/^[[:blank:]]\+//;s/[[:blank:]]\+$//" | xsel -ib'
...
9
votes
3
answers
16k
views
xsel: Can't open display: (null)
I want to copy a long file into clipboard with xsel,in my local pc ,just input:
cat /usr/bin/mysql_secure_installation|xsel -b
The file mysql_secure_installation located in my local os was copied ...
1
vote
1
answer
218
views
How to get clipboard as input file name to Vim on bash?
I install xclip to access system clipboard, my setting and some operations as below:
➜ ~ cat .zshrc | grep xclip
alias c="xclip -selection c"
alias v="xclip -selection c -o"
➜ ~ which dict | c
➜ ~ ...
18
votes
2
answers
6k
views
`tee` for commands
tee can redirect the piped standard input into the standard output and file.
echo Hello, World! | tee greeting.txt
The command above would display the greeting on the terminal screen and save it in ...
3
votes
1
answer
154
views
Piping search term from clipboard (not filename) to grep to search a folder
I am trying to use xsel clipboard to pipe search term to grep to search in folder full of txt files. Can anybody suggest a method to do it.
8
votes
2
answers
1k
views
To which stream does xsel print the no newline warning?
xsel is a program with which you can access system clipboard from command line. If there is no newline at the end of copied content, it prints a warning after the clipboard content like this:
$ xsel -...
9
votes
2
answers
1k
views
xsel and xclip hang
My objective is to make a text on my remote machine (CentOS 7.2) available to seamlessly paste on my local machine (OS X 10.12.2) with the standard ⌘V shortcut. My setup connects to the remote ...
-3
votes
1
answer
1k
views
Do xsel and xclip work only for copy and not for paste?
The usages of xsel and xclip seem to me all about the copy operation, whether it is primary or clipboard selection.
When I perform the paste operation, is it only by using mouse or trackpad, not via ...
4
votes
1
answer
300
views
xbindkeys Paste Script is Failing to Work
I'm trying to bind control + i to load the contents of file.txt to the clipboard (so that I can use ctrl + v to paste the contents of file.txt into windows like my browser).
The following command ...
1
vote
2
answers
318
views
Can I pipe clipboard content to browser for viewing?
Here is the situation.
I often have to read chunks of information from large plain text files. I am planning to use Readability extension for formating the content to make it readable on screen.
4
votes
3
answers
4k
views
Copy vim selected text to system clipboard
My vim is not compiled with clipboard feature. So, i use xsel as suggested by Gilles to copy/paste the contents.
I use :.w !xsel -b for selecting the current line and, :w !xsel -b to select the ...
3
votes
0
answers
174
views
xsel not deleting selected text
I have been trying to get xsel --delete to work to ultimately implement a script to move selected material from one editor to another.
According to the description:
Delete the contents of the ...