bash: how get xsel -o to paste to focused window if command invoked by hotkey in fluxbox
NickName:user985675 Ask DateTime:2015-05-09T02:25:11

bash: how get xsel -o to paste to focused window if command invoked by hotkey in fluxbox

The trackpad on my laptop will not middle-mouse paste. I figured it should be easy to simulate, just focus the target app and invoke 'xsel -o' with a hotkey from fluxbox. But it won't work, that is, xsel -o operates, but its output does not go to the focussed app.

Man xsel states that the -o option sends the current selection to standard output, which I assumed would be the app with focus. Could someone explain why it does not do so in this situation, and how to achieve the desired result?

Copyright Notice:Content Author:「user985675」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30130492/bash-how-get-xsel-o-to-paste-to-focused-window-if-command-invoked-by-hotkey-in

Answers
Etan Reisner 2015-05-08T18:30:24

That's not what \"standard output\" means.\n\nStandard output is where commands like echo and printf send their output by default. It is the screen in a terminal. Run xsel -o in your terminal and you will see the output displayed.\n\nYou need a tool that actually simulates the middle click or simulates an X11 paste.\n\nI believe you can use xdotool to do this sort of thing (among other tools).",


More about “bash: how get xsel -o to paste to focused window if command invoked by hotkey in fluxbox” related questions

bash: how get xsel -o to paste to focused window if command invoked by hotkey in fluxbox

The trackpad on my laptop will not middle-mouse paste. I figured it should be easy to simulate, just focus the target app and invoke 'xsel -o' with a hotkey from fluxbox. But it won't work, that ...

Show Detail

xsel copying text to clipboard but trys to execute the string when I paste into terminal?

I want to copy some text I've constructed to the clipboard. I use xsel to this as follows: echo "my text" | xsel -b And now the string "my text" has been copied to my clipboard. However when I pa...

Show Detail

WPF NHotkey global hotkey only runs when window is focused

On my C# WPF project that runs in the background from the system tray I installed a package called NHotkey to try and turn my keyboard hotkey into a global hotkey that works even if the window isn'...

Show Detail

Fluxbox closing as soon as is opened on LXDE

I'm unable to get fluxbox working together with LXDE, I configured fluxbox to be its window manager, but fluxbox closes as soon as its launched (I can see fluxbox environment for a second) and LXDE...

Show Detail

Sending paste message to active window's focused control

I want to intercept a hot-key (specifically CTRL V) which will interact with my application in a certain way. I am able to globally register the hotkey using the RegisterHotKey method. When I press...

Show Detail

xsel -o equivalent for OS X

Is there an equivalent solution to grab selected text in OS X as 'xsel -o' works for Linux? Just need the current selection so I can use the text in shell script. Cheers, Erik

Show Detail

How to run command in last focused terminal window using bash?

How can I modify this function to open a new tab in the last focused terminal window, vs opening an entirely new terminal window? # Opens a new terminal tab and runs the file. run_in_terminal(){ ...

Show Detail

How do I get the selected text from the focused window using native Win32 API?

My app. will be running on the system try monitoring for a hotkey; when the user selects some text in any window and presses a hotkey, how do I obtain the selected text, when I get the WM_HOTKEY me...

Show Detail

Fluxbox compiling problems after making a change

I'm trying to make the change here: http://fluxbox-wiki.org/index.php?title=Howto_Make_dblclick_titlebar_maximize I am using the current git version of the fluxbox source. I assume that those

Show Detail

Switching focus in bash script

Please help me understand the source of a little issue I have when trying to make a windows loose focus in a Bash script invoked with a hotkey combination in Openbox on Linux. I have a couple of l...

Show Detail