Xdotool Simulates Key Presses and Mouse Clicks
Вставка
- Опубліковано 24 сер 2022
- xdotool is a command line utility that is most often used to simulate key presses or mouse clicks. This is especially useful to those of us that use standalone window managers because sometimes you want to bind an action to a keyboard event or mouse event rather than a shell command.
REFERENCED:
► github.com/jordansissel/xdotool
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: ua-cam.com/users/redirect?even...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/stores/distrotube
DONATE CRYPTO:
💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ
DT ON THE WEB:
🕸️ Website: distrotube.com/
📁 GitLab: gitlab.com/dwt1
🗨️ Mastodon: fosstodon.org/@distrotube
👫 Reddit: / distrotube
📽️ LBRY/Odysee: odysee.com/@DistroTube:2
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🎵 Tenacity: github.com/tenacityteam/tenacity
💻 VirtualBox: www.virtualbox.org/
🗒️ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys! - Наука та технологія
Fun fact, if you're sitting on a toilet with a laptop, wearing headphones connected to your other PC, and you want to continue video playback on it so you can keep listening - xdotool over SSH is a viable way to shift X's window focus to that YT window and send it the space key to continue playback. Don't ask how i know that.
noice 😘
step 1: figure out friends password
step 2: have fun
You embody the spirit of a true nerd... and you probably have adhd.
I won't ask how you know that, but I will ask, what were you doing that you couldn't wait until you were out of the bathroom to do it?
@@anon_y_mousse I just didn't want to sit in silence while i *could* be keep listening to a podcast ^^"
Replaced xdotool for ydotool for my DIY-macro keyboard, since it works on wayland and tty as well.
I used it to automate a farm game since I seem to have a thing against computer mice. Plus I'm too impatient and lazy to wait for that corn to grow.
What an incredible discovery!
This seems incredibly useful even in a full desktop environment like KDE Plasma.
I've set it up in a shell script with a bunch of functions and with a couple custom keybindings,
I've added macros into Gimp! For automatically shrinking the selection for clean crops,
applying the same crop using quick mask to a bunch of photos, and even auto-cropping the subject!
Really awesome little tool! Made my universal macro dreams come true!
If only it could move your mouse cursor too, not just click.
I love xdotool, especially for managing macros on keyboards or mice with macro buttons that don't provide native configuration frontends (like my G300s; and yes, ratslap does exist, but it's clunky if you change options frequently): use xev to find the keycode of your non-standard button or key, add a custom keymap for that keycode (e.g. i3 uses the "bindcode" option) and execute your xdotool command. I've got it set up for all the ways of taking screenshots (i.e. [save to clipboard / file] * [the entire screen / the active window (using xdotool) / a custom selection]) so I don't have to remember if it's Shift+PrtScr or Ctrl+PrtScr to take a screenshot of the active window.
Is that because you haven't set the shortcuts yourself? Or because you use them infrequently?
@@anon_y_mousse Just because of the frequency, between the six options I get confused with what chord I assigned them to.
That said, if you've got a keyboard with multimedia buttons (like XF86HomePage or XF86Mail) those are also good candidates for remapping (unless you actually use them for their intended purpose)
@@LordHonkInc Totally relatable. I usually just hit PrtScr to bring up Spectacle because I forget what keys I assigned as well.
Thank you dt.
How come that you JUST publish this video when I discovered this tool myself TODAY?!? ;-)
Good video.
I would add a window manager some code to be able to read from named pipes. Though that would only work for the window manager.
I tried to make a script to use xdotool in awesomewm keybind I got it to select the window fine but it isn’t sending keystrokes for some reason. If I run the script in terminal it runs fine. But in the awesomewm config it only changes focus lol. I’m using it to play pause UA-cam video with xf86audioplay
Had a little play around with this, but can't seem to get "$ xdotool key super+Return" to work to open a terminal (in dwm).
"$ xdotool key super+KP_Enter" doesn't work either.
Anyone know what's going wrong here?
How does he get that tiling screen to work? Also hwo do you get xdotool to permanately listen for a certain key combination and then perform a script to do so ?
can xdotool theoretically trigger from MIDI information?
What I need to do is have a macro that I can select a point on the graphic desktop scene, MB#1 to select the point, then have the macro simulate a repeated MB#1 click there every 10 seconds. The screen should not change for the duration of this macro and if it does change drastically or I manually move the mouse - I need the macro to end.
So I guess in other words, I'm looking for a repeating mouse click every 10 seconds (or whatever I program into the script) after the initial 'locating click'...
Is this something XdoTool can DO ?
Derek seems to be a good soul
Just found about xdotool and here you made a video about it. I found about it when I wanted to restart the gnome shell in my script. What would I use as a replacement for Wayland?
There is ydotool for Wayland (though I never tried it because I don't use Wayland).
Afaik xdotool has partial support for wayland but since I dont use it, i dont know to what extent.
@@valizeth4073 Essentially not. It will only work in applications that run in Xorg on Wayland, i.e. through XWayland.
Can you do a tutorial on how to install GNOME 42 on FreeBSD 13.1 and FreeBSD 14.0? I jnever had any problems installing GNOME 3 on older versions of FreeBSD, but I've never been able to properly configure GNOME 41 or GNOME 42 on FreeBSD.
xbindkeys & xdotool is my macro jam ⌨
3:22 which tool you are using
I have xdotool seted so I can use Control + Alt + LeftClick and paste primary selection everywhere
What script are you using in your terminal when you type in for example clear command the colorful line graph above the prompt appears @DistroTube
dt shell colorscripts on his gitlab also in aur
@@josipbroztito5519 I already have that but that line graph is not there or am i just missing it.
@GeoMinesDiamonds If you mean that line graph specifically i don't but i have shell colorscript active when i open terminal it generates random script but not the one i was asking for.
@GeoMinesDiamonds Yea i know what -e flag does but my question was if someone knows what is that color script specifically that appears on his terminal when he enters clear command.
@@gornhunter look at his fishrc there is an alias of clear command use that to get clear command like his
Just realized one of the top tiered patrons is "why you bald, homie?"😂 #dtnotbald
which window manager is that on ur pc @DistroTube
if you talking bout WM at the video: it is xmonad wm and xmobar bar
@@Son0fBeelzebub thank u sir 🌻🌻🌻
@@srijalkc1975 youre welcome :)
👍👍
I believe keepass uses XDOTOOL for autotype user/pw
I think duct tape is an apt comparison, and truthfully, this should be one of those rarely used tools and not a quality of life enhancement. It's a pretty big failing of whatever system anyone is using that you'd need that to setup clickable buttons using that instead of some standard programmatic interface. I'd say that's an argument for continuing to use a DE.
Dt can you review plotinus
I used to use xdotool. I was trying to auto-login to gnome. It didnt work out.
I see 200k in your future
Is that an x11 tool ?
Yes
Now if only you could set this up to do the grindy/annoying parts of games so you can do something enjoyable while your character does the grinding for you.
Waylandsisters, I'm sorry....
I use it to close steam without killing it for a year
What command in Xdotool do you use to close window without killing it?
@@skarlok1
-- close client
awful.key({modkey}, "q",
function(c)
if(c.name == "Steam") then
awful.spawn.with_shell("xdotool windowunmap $(xdotool getactivewindow)")
else
c:kill()
end
end,
{description = "close", group = "client"}
),
I do this in awesome wm, you can use it in other way, you can use " xdotool windowunmap $(xdotool getactivewindow) " in the shell the $(xdotool getactivewindow) is to close the active window but you can enter manually the window you want to close
@@skarlok1 I just read the man page and found that I can use xdotool getactivewindow windowclose, it make more sense for what I want to do, I can change my code to look like
-- close client
awful.key({modkey}, "q",
function(c)
awful.spawn.with_shell("xdotool getactivewindow windowclose")
end,
{description = "close", group = "client"}
),
this is for awesome wm but you can do this on other window manager, I just call the shell command
-- Edit sorry when I use windowclose I'm not able to reopen steam, so I just stick to windowunmap I think
awful.spawn.with_shell("xdotool getactivewindow windowunmap") is the best way I found for my use
@@raphaeldrouin2934 Thanks, Will test that later.
kinda similar to pyautogui
fish is not a shell
I'm sorry Luke, you're wrong.
@@BurgerKingHarkinian you haven't heard of recursive backronyms, have you? :) FISH can easily stand for Fish Is Not a Shell just like GNU can also mean GNU's Not Unix
I have. But I've never heard if that one before.
@@csehszlovakze it's Fish Is SHell.
Or you can add a not like fish is not a shell.
Or I can make it fish is deeznutz shell.
Or you can put a use vim in there, it's flexible.
Linus Sebastian bought the linux foundation, what is your response? I thought it was fake news but it's real.
This is fraudulent.
does not work with wayland. thumbs down for that. tried to setup touchpad gestures with libinput gestures which depends on xdotool for keystroke simulation in x11. not everythings works. i especially tried to setup 2 finger pinch for zooming which should be available by default does not work in vlc for subtitle resizing (this gesture works flawlessly in windows). i will take wayland gestures on gnome and kde anyday over xdotool bullshit .
Calling something bullshit because it doesn't support wayland... Maybe you should fix your attitude before you worry about your computer gestures. Oh, and by the way, you could fork it and add all of those things if you want.
It's your fault for using wayland lol. Wayland is intentionally designed to work like that. You only have yourself to blame.
Xdotool uses an security risk exploit in Xorg which was there by design for 35 years ago - not something that could be fixed. Wayland did through fundamental design changes. There is Ydotool if the applications are written to use Ydotool keyboard server - outside of Wayland. I tried it a year ago and it was more trouble than it was worth. I would rather write my own capture feature in the application. Personally, I won't give up Wayland just to be able to use Xdotool.
@@paulsorensen8489 "not something that could be fixed" that's false, it was "fixed" 20 years ago with XACE but nobody cares about that because in the real world it doesn't matter. Never in those 35 years has anybody ever exploited that "security risk". Wayland "security" is a fix for a problem nobody had, while it just introduced more problems (in the real world). If you are really serious about security you would run every application in a separate virtual machine, in which case it doesn't matter if you use x11 or not.
GVDT.