Code Monkey home page Code Monkey logo

kdotool's Introduction

kdotool - a xdotool clone for KDE Wayland

Introduction

Wayland, for security concerns, removed most of the X11 APIs that xdotool uses to simulate user input and control windows. ydotool solves the input part by talking directly to the kernel input device. However, for the window control part, you have to use each Wayland compositor's own APIs.

This program uses KWin's scripting API to control windows. In each invocation, it generates a KWin script on-the-fly, loads it into KWin, runs it, and then deletes it, using KWin's DBus interface.

This program should work with both KDE 5 and the upcoming KDE 6. It should work with both Wayland and X11 sessions. (But you can use the original xdotool in X11, anyway. So this is mainly for Wayland.)

Not all xdotool commands are supported. Some are not available through the KWin API. Some might be not even possible in Wayland. See below for details.

Please note that the window id this program uses is KWin's internal window id, which looks like a UUID ({xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}). It's not a X11 window id.

Global Options

  • --help Show help.
  • --version Show version.

Options not in xdotool:

  • --dry-run Just print the generated KWin script. Don't run it.
  • --debug Print debug messages.
  • --shortcut _shortcut_ Specify a shortcut to run the generated KWin script. The shortcut must be in the format of modifier+key, e.g. Alt+Shift+X. The shortcut will be registered in KWin. The script is not run immediately. You must press the shortcut to run it.
    • --name _name_ Specify a name for the shortcut, So you can remove it later with --remove. This option is only valid with --shortcut.
  • --remove _name_ Remove a previously registered shortcut.

New Commands Not In xdotool

The following can be used in chained commands:

  • savewindowstack _name_ Save the current window stack to a variable
  • loadwindowstack _name_ Load a previously saved window stack
  • getwindowid Print the window id of a window in the window stack

Supported xdotool Commands

Window Queries

These commands generate a window stack that following window action commands can refer to.

  • search
    • MISSING:
      • --maxdepth
      • --onlyvisible
      • --sync
    • NOTE:
      • --screen (KDE 5 only)
  • getactivewindow
  • getmouselocation [--shell]
    • Window stack contains the topmost window under the mouse pointer.

Window Actions

These commands either take a window-id argument, or use the window stack.

  • getwindowname
  • getwindowclassname
  • getwindowpid
  • getwindowgeometry
    • MISSING: --shell
    • NOTE: shows screen number only in KDE 5
  • windowsize
    • MISSING:
      • --usehints
      • --sync
  • windowmove
    • MISSING:
      • --sync
  • windowminimize
    • MISSING: --sync
  • windowraise (KDE 6 only)
    • Use windowactivate instead?
  • windowactivate
    • MISSING: --sync
  • windowclose
  • set_desktop_for_window
  • get_desktop_for_window
  • windowstate
    • Supported properties:
      • above
      • below
      • skip_taskbar
      • skip_pager
      • fullscreen
      • shaded
      • demands_attention
    • MISSING:
      • modal
      • sticky
      • hidden
      • maximized_vert
      • maximized_horz

Global Actions

These actions aren't targeting a specific window, but the whole desktop.

  • set_desktop
    • MISSING: --relative
  • get_desktop
  • set_num_desktops (KDE 5 only)
  • get_num_desktops

Won't support

You can use ydotool, dotool, wtype, etc. for these:

  • Keyboard commands
  • Mouse commands

KWin doesn't have such functionality:

  • set_desktop_viewport
  • get_desktop_viewport

X11-specific:

  • windowreparent
  • windowmap
  • windowunmap

Unclear if we can support

  • behave window action command
  • exec
  • sleep
  • scripts

KWin has such functionality, but not exposed to the js API:

  • selectwindow
  • windowlower
  • windowquit
  • windowkill
  • getwindowfocus: use getactivewindow instead?
  • windowfocus: use windowactivate instead?
  • set_window

Troubleshooting

If anything fails to work, you can re-run the command with --debug option. It will print the generated KWin script, and the output of the script from KWin. If you think it's a bug, please create an issue in GitHub.

kdotool's People

Contributors

jinliu avatar musicinmybrain avatar luisbocanegra avatar kasper24 avatar

Stargazers

Akai Omurbek uulu avatar Torsten Maehne avatar Ryze avatar  avatar Jayson Weslley Cezar Silva avatar Rudraksh Tripathi avatar  avatar Evelyn avatar Cristian Molina avatar Drew Naylor avatar  avatar Trent McPheron avatar Aleksei Taradin avatar  avatar dp avatar Jialei avatar Tatu Lahtela avatar  avatar Zachary Talis avatar  avatar i̶̗̯̫͓̠͠l̹͚͙͞l͕̠͕͕̤͈͍̞ņ̰̖̙̬̫̹̹e̸̴̲̻̟̗s̢̖̘̺̱͍ṣ̡̲̹̟͖̱͍̘̠e̼̱͜ avatar  avatar Rafael Gawenda avatar kyle s avatar Matías avatar  avatar  avatar Vlad M. avatar  avatar  avatar  avatar Vera Rei avatar  avatar Shayne Hartford avatar joh6nn avatar Radu Butoi avatar Ivan avatar Ricky Brent avatar VitalyR avatar tubbadu avatar Samuel Collins avatar Quentin Smith avatar Mario Awad avatar Techognito avatar  avatar  avatar  avatar orzogc avatar Andika Edo avatar OrbitZore avatar  avatar Toby Fox avatar Jean P avatar Brian Lu avatar Federico Damián Schonborn avatar Neal Gompa (ニール・ゴンパ) avatar Jon Che avatar Brandon Radtke avatar  avatar  avatar Athul Raj Kollareth avatar Kristoffer Plagborg Bak Sørensen avatar  avatar Oleg Pykhalov avatar Nicolas Morel avatar  avatar  avatar Ming-Long Huang avatar guojun avatar Tea avatar Kirikaze Chiyuki avatar  avatar Kay Gosho avatar  avatar Yifan Zhu avatar Sam Vo avatar Mark Kogan avatar David.Gao avatar Felipe Delgado avatar Harish Chandra Thuwal avatar Andy Kluger avatar Beacon Zhang avatar Ali Galal avatar Coelacanthus avatar Mauricio Uribe avatar Uri Herrera avatar  avatar Faheem Pervez avatar Konstantin Pereiaslov avatar  avatar Dennis Oehme avatar Yaroslav Sidlovsky avatar Natalie Clarius avatar  avatar Shadab Zafar avatar  avatar Arshad Hosein avatar  avatar github user avatar

Watchers

 avatar Dennis Oehme avatar  avatar Yaroslav Sidlovsky avatar Torsten Maehne avatar  avatar

kdotool's Issues

Commands generate KWin scripts but always return OS error 2

./kdotool --debug get_desktop

[2024-05-18T19:47:35Z DEBUG kdotool] ===== Generate KWin script =====
[2024-05-18T19:47:35Z DEBUG kdotool] Script:
print("kdotool-wEHTOJ START");

function output_debug(message) {
    print("kdotool-wEHTOJ DEBUG", message);
    callDBus(":1.399", "/", "", "debug", message.toString());
}

function output_error(message) {
    print("kdotool-wEHTOJ ERROR", message);
    callDBus(":1.399", "/", "", "error", message.toString());
}

function output_result(message) {
    if (message == null) {
        print("kdotool-wEHTOJ RESULT null");
        return;
    }
    print("kdotool-wEHTOJ RESULT", message);
    callDBus(":1.399", "/", "", "result", message.toString());
}

workspace_windowList                  = () => workspace.windowList();
workspace_activeWindow                = () => workspace.activeWindow;
workspace_setActiveWindow             = (window) => { workspace.activeWindow = window; };
workspace_raiseWindow                 = (window) => { workspace.raiseWindow(window); };
workspace_currentDesktop              = () => workspace.currentDesktop.x11DesktopNumber;
workspace_setCurrentDesktop           = (id) => {
    let d = workspace.desktops.find((d) => d.x11DesktopNumber == id);
    if (d) {
        workspace.currentDesktop = d;
    } else {
        output_error(`Invalid desktop number ${id}`);
    }
};
workspace_numDesktops                 = () => workspace.desktops.length;
workspace_setNumDesktops              = (n) => { output_error("`set_num_desktops` unsupported in KDE 6"); };
window_x11DesktopIds                  = (window) => window.desktops.map((d) => d.x11DesktopNumber);
window_setX11DesktopId                = (window, id) => {
    let d = workspace.desktops.find((d) => d.x11DesktopNumber == id);
    if (d) {
        window.desktops = [d];
    } else {
        output_error(`Invalid desktop number ${id}`);
    }
};
window_screen                         = (window) => { output_error("`search --screen` unsupported in KDE 6"); };

function run() {
    var window_stack = [];

    output_debug("STEP get_desktop")
    output_result(workspace_currentDesktop());

}

run();

print("kdotool-wEHTOJ FINISH");

[2024-05-18T19:47:35Z DEBUG kdotool] ===== Load script into KWin =====
[2024-05-18T19:47:35Z DEBUG kdotool] Script ID: 0
[2024-05-18T19:47:35Z DEBUG kdotool] ===== Run script =====
[2024-05-18T19:47:35Z DEBUG kdotool] dbus message: Message { Type: MethodCall, Path: "/", Member: "debug", Sender: ":1.10", Destination: ":1.399", Serial: 3811, Args: ["STEP get_desktop"] }
[2024-05-18T19:47:35Z DEBUG kdotool] dbus message: Message { Type: MethodCall, Path: "/", Member: "result", Sender: ":1.10", Destination: ":1.399", Serial: 3812, Args: ["1"] }
Error: No such file or directory (os error 2)

search for name and square brackets

When searching for a window name containing square brackets I have to use 2 backslashes to quote the brackets with kdotool:

--name '(\\[Xconsolen\\])'

With xdotool one backslash is sufficient

--name '(\[Xconsolen\])'

Is this supposed to be correct?

Not working when called from a global shortcut

setup: latest KDE Neon with plasma 6

kdotool works fine when run from terminal, but doesn't when caled from a script assigned to a global shortcut.

For instance, from terminal:

kdotool search ""
{fc91d79b-4a4a-419c-96f7-fcb4667470d3}
{21712d9c-829e-4bfc-8d4b-5ab3c98404fd}

But when the same command is called from within a bash script assigned to a shortcut (Settings/Shortcuts/Add New/Command or Script...) the output of kdotool search "" inside the script is simply empty (same with --debug option).

Do you have any idea what is going wrong there ?

Accept "current" as value for set_desktop_for_window

It would be great to be able to do this:

kdotool search --name 'XXX' set_desktop_for_window current windowactivate

That would be the equivalent of kdotool search --name 'XXX' set_desktop_for_window $(kdotool get_desktop) windowactivate.

The goal is to be able to do something like this:

kdotool --shortcut Meta+something --name "pull XXX window" --name 'XXX' set_desktop_for_window current windowactivate because it does not work with the $() notation

Cannot build. Error: linking with `cc` failed

I tried to install it from AUR and from source. I get the same error.
rustc 1.78.0 (9b00956e5 2024-04-29) (Arch Linux rust 1:1.78.0-1)
cargo 1.78.0

Steps:
Git pull kdotool
cd kdotool
cargo build

Error:

Compiling proc-macro2 v1.0.69
Compiling unicode-ident v1.0.12
Compiling thiserror v1.0.50
Compiling memchr v2.6.4
Compiling rustix v0.38.25
Compiling ucd-trie v0.1.6
Compiling autocfg v1.1.0
Compiling rand_core v0.6.4
Compiling serde v1.0.193
Compiling pkg-config v0.3.27
Compiling siphasher v0.3.11
Compiling linux-raw-sys v0.4.11
Compiling once_cell v1.18.0
Compiling bitflags v2.4.1
Compiling serde_json v1.0.108
Compiling regex-syntax v0.8.2
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/lib64/rustlib/x86_64-unknown-linux-gnu/bin:/opt/anaconda/bin:/opt/anaconda/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" VSLANG="1033" "cc" "-m64" "/tmp/rustcEeeF3g/symbols.o" "/home/USER/Applications/Git/kdotool/target/release/build/serde_json-e4fabdb49c99c16b/build_script_build-e4fabdb49c99c16b.build_script_build.fd849e2c0d867dca-cgu.0.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/serde_json-e4fabdb49c99c16b/build_script_build-e4fabdb49c99c16b.1ihwxufqrldclr1s.rcgu.o" "-Wl,--as-needed" "-L" "/home/USER/Applications/Git/kdotool/target/release/deps" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-a8afbc4cf9b1568f.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libobject-77cc6f7c429fe363.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-19736dceaad0b4b8.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-70366cf8a4f39dc1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-bbacfd7894296f03.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a3439f757b34a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-b439bfdfd68e538e.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-dc44f8c1a4aafb0c.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-2d257aa2a0374ef9.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-18a62298ff3d223d.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libadler-e5ae4c0fbfb81efe.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e0fc4e09ba6e0f49.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-02feaffbaf78e9be.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-a8f848e0246562bb.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-1211ff2b03c68af1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b61ac6aa2015a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcore-fed87452ae4ab440.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3ce9c50abe6de474.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/USER/Applications/Git/kdotool/target/release/build/serde_json-e4fabdb49c99c16b/build_script_build-e4fabdb49c99c16b" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
= note: /opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::pal::unix::stack_overflow::imp::make_handler':
(.text._ZN3std3sys3pal4unix14stack_overflow3imp12make_handler17h91e0d6540b427591E+0x4a): undefined reference to `getauxval'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::sync::once::futex::Once::call':
(.text.unlikely._ZN3std3sys4sync4once5futex4Once4call17h38137446c5a39fd0E+0x124): undefined reference to `getauxval'
collect2: error: ld returned 1 exit status

= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile `serde_json` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/lib64/rustlib/x86_64-unknown-linux-gnu/bin:/opt/anaconda/bin:/opt/anaconda/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" VSLANG="1033" "cc" "-m64" "/tmp/rustcAoiEAd/symbols.o" "/home/USER/Applications/Git/kdotool/target/release/build/thiserror-9689b47947d5874c/build_script_build-9689b47947d5874c.build_script_build.6c49f905b8c5dd9f-cgu.0.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/thiserror-9689b47947d5874c/build_script_build-9689b47947d5874c.50f4rn7ig1zc4cte.rcgu.o" "-Wl,--as-needed" "-L" "/home/USER/Applications/Git/kdotool/target/release/deps" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-a8afbc4cf9b1568f.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libobject-77cc6f7c429fe363.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-19736dceaad0b4b8.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-70366cf8a4f39dc1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-bbacfd7894296f03.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a3439f757b34a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-b439bfdfd68e538e.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-dc44f8c1a4aafb0c.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-2d257aa2a0374ef9.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-18a62298ff3d223d.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libadler-e5ae4c0fbfb81efe.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e0fc4e09ba6e0f49.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-02feaffbaf78e9be.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-a8f848e0246562bb.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-1211ff2b03c68af1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b61ac6aa2015a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcore-fed87452ae4ab440.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3ce9c50abe6de474.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack""-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/USER/Applications/Git/kdotool/target/release/build/thiserror-9689b47947d5874c/build_script_build-9689b47947d5874c" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
= note: /opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::pal::unix::stack_overflow::imp::make_handler':
(.text._ZN3std3sys3pal4unix14stack_overflow3imp12make_handler17h91e0d6540b427591E+0x4a): undefined reference to `getauxval'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::sync::once::futex::Once::call':
(.text.unlikely._ZN3std3sys4sync4once5futex4Once4call17h38137446c5a39fd0E+0x124): undefined reference to `getauxval'
collect2: error: ld returned 1 exit status

= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile `thiserror` (build script) due to 1 previous error
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/lib64/rustlib/x86_64-unknown-linux-gnu/bin:/opt/anaconda/bin:/opt/anaconda/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" VSLANG="1033" "cc" "-m64" "/tmp/rustcZLPoBe/symbols.o" "/home/USER/Applications/Git/kdotool/target/release/build/serde-72f588f1cb60ec84/build_script_build-72f588f1cb60ec84.build_script_build.73763fbcc06ec303-cgu.0.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/serde-72f588f1cb60ec84/build_script_build-72f588f1cb60ec84.1jyivl2w9qr3yidw.rcgu.o" "-Wl,--as-needed" "-L" "/home/USER/Applications/Git/kdotool/target/release/deps" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-a8afbc4cf9b1568f.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libobject-77cc6f7c429fe363.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-19736dceaad0b4b8.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-70366cf8a4f39dc1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-bbacfd7894296f03.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a3439f757b34a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-b439bfdfd68e538e.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-dc44f8c1a4aafb0c.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-2d257aa2a0374ef9.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-18a62298ff3d223d.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libadler-e5ae4c0fbfb81efe.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e0fc4e09ba6e0f49.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-02feaffbaf78e9be.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-a8f848e0246562bb.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-1211ff2b03c68af1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b61ac6aa2015a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcore-fed87452ae4ab440.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3ce9c50abe6de474.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/USER/Applications/Git/kdotool/target/release/build/serde-72f588f1cb60ec84/build_script_build-72f588f1cb60ec84" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
= note: /opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::pal::unix::stack_overflow::imp::make_handler':
(.text._ZN3std3sys3pal4unix14stack_overflow3imp12make_handler17h91e0d6540b427591E+0x4a): undefined reference to `getauxval'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::sync::once::futex::Once::call':
(.text.unlikely._ZN3std3sys4sync4once5futex4Once4call17h38137446c5a39fd0E+0x124): undefined reference to `getauxval'
collect2: error: ld returned 1 exit status

= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile `serde` (build script) due to 1 previous error
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/lib64/rustlib/x86_64-unknown-linux-gnu/bin:/opt/anaconda/bin:/opt/anaconda/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" VSLANG="1033" "cc" "-m64" "/tmp/rustc7IR0u8/symbols.o" "/home/USER/Applications/Git/kdotool/target/release/build/proc-macro2-68940d75aa3e25a9/build_script_build-68940d75aa3e25a9.build_script_build.798b364b29163237-cgu.0.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/proc-macro2-68940d75aa3e25a9/build_script_build-68940d75aa3e25a9.build_script_build.798b364b29163237-cgu.1.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/proc-macro2-68940d75aa3e25a9/build_script_build-68940d75aa3e25a9.build_script_build.798b364b29163237-cgu.2.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/proc-macro2-68940d75aa3e25a9/build_script_build-68940d75aa3e25a9.252tbn51c6plk8e3.rcgu.o" "-Wl,--as-needed" "-L" "/home/USER/Applications/Git/kdotool/target/release/deps" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-a8afbc4cf9b1568f.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libobject-77cc6f7c429fe363.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-19736dceaad0b4b8.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-70366cf8a4f39dc1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-bbacfd7894296f03.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a3439f757b34a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-b439bfdfd68e538e.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-dc44f8c1a4aafb0c.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-2d257aa2a0374ef9.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-18a62298ff3d223d.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libadler-e5ae4c0fbfb81efe.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e0fc4e09ba6e0f49.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-02feaffbaf78e9be.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-a8f848e0246562bb.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-1211ff2b03c68af1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b61ac6aa2015a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcore-fed87452ae4ab440.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3ce9c50abe6de474.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/USER/Applications/Git/kdotool/target/release/build/proc-macro2-68940d75aa3e25a9/build_script_build-68940d75aa3e25a9" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
= note: /opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::pal::unix::stack_overflow::imp::make_handler':
(.text._ZN3std3sys3pal4unix14stack_overflow3imp12make_handler17h91e0d6540b427591E+0x4a): undefined reference to `getauxval'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::sync::once::futex::Once::call':
(.text.unlikely._ZN3std3sys4sync4once5futex4Once4call17h38137446c5a39fd0E+0x124): undefined reference to `getauxval'
collect2: error: ld returned 1 exit status

= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile `proc-macro2` (build script) due to 1 previous error
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/lib64/rustlib/x86_64-unknown-linux-gnu/bin:/opt/anaconda/bin:/opt/anaconda/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" VSLANG="1033" "cc" "-m64" "/tmp/rustcFKrkTT/symbols.o" "/home/USER/Applications/Git/kdotool/target/release/build/rustix-6f186bf4a9c2cad5/build_script_build-6f186bf4a9c2cad5.build_script_build.685e7621e1fa09fc-cgu.0.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/rustix-6f186bf4a9c2cad5/build_script_build-6f186bf4a9c2cad5.build_script_build.685e7621e1fa09fc-cgu.1.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/rustix-6f186bf4a9c2cad5/build_script_build-6f186bf4a9c2cad5.build_script_build.685e7621e1fa09fc-cgu.2.rcgu.o" "/home/USER/Applications/Git/kdotool/target/release/build/rustix-6f186bf4a9c2cad5/build_script_build-6f186bf4a9c2cad5.id6tx6rrrxg8rqb.rcgu.o" "-Wl,--as-needed" "-L" "/home/USER/Applications/Git/kdotool/target/release/deps" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-a8afbc4cf9b1568f.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libobject-77cc6f7c429fe363.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-19736dceaad0b4b8.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-70366cf8a4f39dc1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-bbacfd7894296f03.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a3439f757b34a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-b439bfdfd68e538e.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-dc44f8c1a4aafb0c.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-2d257aa2a0374ef9.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-18a62298ff3d223d.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libadler-e5ae4c0fbfb81efe.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e0fc4e09ba6e0f49.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-02feaffbaf78e9be.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-a8f848e0246562bb.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-1211ff2b03c68af1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b61ac6aa2015a5b2.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcore-fed87452ae4ab440.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3ce9c50abe6de474.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/USER/Applications/Git/kdotool/target/release/build/rustix-6f186bf4a9c2cad5/build_script_build-6f186bf4a9c2cad5" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
= note: /opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::pal::unix::stack_overflow::imp::make_handler':
(.text._ZN3std3sys3pal4unix14stack_overflow3imp12make_handler17h91e0d6540b427591E+0x4a): undefined reference to `getauxval'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-9b82c2917e0c85d4.rlib(std-9b82c2917e0c85d4.std.3003f94c16d405af-cgu.0.rcgu.o): in function `std::sys::sync::once::futex::Once::call':
(.text.unlikely._ZN3std3sys4sync4once5futex4Once4call17h38137446c5a39fd0E+0x124): undefined reference to `getauxval'
collect2: error: ld returned 1 exit status

= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile `rustix` (build script) due to 1 previous error

Can you add a command to show cursor coordinates in kde like in xdotool?

$ xdotool getwindowfocus getwindowname - shows x and y coordinates of the cursor on the display in x11

please add the similar command for kdotool as
$ kdotool getactivewindow getwindowname

ydotool requires root to run and there is no such function there

Here a code for the command:
workspace_mxy = () => "x=" + workspace.cursorPos.x + "\ny=" + workspace.cursorPos.y;

Error: "Object path was not valid: '/Scripting/Script-1'"

Hi, thanks for this great tool. It was working for me 30 minutes ago; then I wrote a few more kdotool commands, put them all in a script for startup, logged out and back in to test it, and suddenly I can't run kdotool at all:

ben@tp4 kdotool $ /home/ben/nxc/scripts/kdotool/target/debug/kdotool search
thread 'main' panicked at /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/strings.rs:187:1:
called `Result::unwrap()` on an `Err` value: "Object path was not valid: '/Scripting/Script-1'"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

ben@tp4 kdotool $ RUST_BACKTRACE=1 /home/ben/nxc/scripts/kdotool/target/debug/kdotool search
thread 'main' panicked at /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/strings.rs:187:1:
called `Result::unwrap()` on an `Err` value: "Object path was not valid: '/Scripting/Script-1'"
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result<T,E>::unwrap
             at /usr/src/debug/rust/rustc-1.76.0-src/library/core/src/result.rs:1073:23
   4: <dbus::strings::Path as core::convert::From<alloc::string::String>>::from
             at /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/strings.rs:101:67
   5: <T as core::convert::Into<U>>::into
             at /usr/src/debug/rust/rustc-1.76.0-src/library/core/src/convert/mod.rs:757:9
   6: dbus::blocking::Connection::with_proxy
             at /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dbus-0.9.7/src/blocking.rs:161:67
   7: kdotool::main
             at ./src/main.rs:676:24
   8: core::ops::function::FnOnce::call_once
             at /usr/src/debug/rust/rustc-1.76.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Any ideas? I'm using arch, with KDE 6, and wayland.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.