greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.88k stars 475 forks source link

v0.30: Screenshot example does not work. #1689

Open ZackMitkin opened 1 year ago

ZackMitkin commented 1 year ago

My setup:

  1. Installed with yay -S i3status-rust-git, which uses version i3status-rust-git-0.30.0.r2848.gf2642f03-1

  2. I coppied the examples/screenshot.sh and modified it to just be this:

    # ~/screenshot.sh
    
    # open screenshot tool
    scrot -s -q 100 -o ~/Pictures/screenshot.png
    # copy to clipboard
    xclip -sel clip -t image/png -i ~/Pictures/screenshot.png

    Running sh ~/screenshot.sh from terminal works as expected. I can select the portion of screen I want to capture and it's saved to clipboard.

  3. I have this block set in ~/.config/i3status-rust

    [[block]]
    block = "custom"
    command = "echo ' \uf030 '" # assumes fontawesome icons
    interval = "once"
    shell = "bash"
    [[block.click]]
    button = "left"
    cmd = "sh ~/screenshot.sh"

    and it shows up fine: image

But, on click it does nothing. I couldn't find a way to see any logs with this or debug further.

A couple things I have tried is to just put touch ~/test in the screenshot script, clicking on the icon does create the empty test. I've also tried to just put the scrot command directly into the cmd = "..." section, which also doesn't work.

I'm wondering if there's any other way to debug why scrot isn't running? Any help will be greaty appreciated!

MaxVerevkin commented 1 year ago

I don't use X11, so the only idea I have is to capture the output of that script and see if there are any errors:

[[block]]
block = "custom"
command = "echo ' \uf030 '" # assumes fontawesome icons
interval = "once"
shell = "bash"
[[block.click]]
button = "left"
cmd = "sh ~/screenshot.sh 2>/tmp/custom_block.log"