Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key binding in i3wm will not make the rofi window to appear. #865

Closed
ghost opened this issue Oct 10, 2018 · 20 comments
Closed

Key binding in i3wm will not make the rofi window to appear. #865

ghost opened this issue Oct 10, 2018 · 20 comments

Comments

@ghost
Copy link

ghost commented Oct 10, 2018

Relevant system info

$ rofi -v
Version: 1.5.1

rofi configuration: https://gist.github.com/phfrohring/237f89df2b2e2a7f25e5a01bf2549729

$ i3 --version
i3 version 4.14.1 (2017-09-24) © 2009 Michael Stapelberg and contributors

relevant line of i3 config: bindsym --release $mod+d exec ~/bin/./trigger_rofi

content of ~/bin/./trigger_rofi:

#! /usr/bin/env bash
rofi -combi-modi window,drun,run,ssh -theme solarized -font 'hack 10' -show combi -modi combi

Steps to reproduce

typing $mod+d won't trigger rofi.

What behaviour you see

Nothing.

What behaviour you expect to see

The same behaviour as when I execute: $ ~/bin/./trigger_rofi i.e. rofi to show up.

@GladOSkar
Copy link

GladOSkar commented Oct 10, 2018

If it works from the shell, but not from i3, shouldn't this be an i3 issue?

Otherwise: Your shebang looks weird, shouldn't that be #!/usr/bin/env bash?

Did you try putting a notify-send test or a echo test > ~/testfile.txt into the script to see if it even runs?

@ghost
Copy link
Author

ghost commented Oct 10, 2018

If it works from the shell, but not from i3, shouldn't this be an i3 issue?

I don't know, will try there too.

Otherwise: Your shebang looks weird, shouldn't that be #!/usr/bin/env bash?

Yes, corrected.

Did you try putting a notify-send test or a echo test > ~/testfile.txt into the script to see if it even runs?

Yes.

@GladOSkar
Copy link

GladOSkar commented Oct 10, 2018

@phfrohring And did the test work?

@ghost
Copy link
Author

ghost commented Oct 10, 2018

Yes.

@ghost
Copy link
Author

ghost commented Oct 10, 2018

Will try to upgrade i3 to 4.15.
I will come back to close this issue if it works.
Thanks for your reactivity!

@GladOSkar
Copy link

I just reproduced your exact setup and it works for me, so i am out of ideas ^^ Hope the update fixes it

@GladOSkar
Copy link

GladOSkar commented Oct 10, 2018

But if the test worked it can't be an i3 issue...

Maybe it's your environment?

Put notify-send $(echo ~) into the script (or write it to a file) and see what it says

@ghost
Copy link
Author

ghost commented Oct 11, 2018

bindsym --release $mod+d exec notify-send $(echo ~) sends a notification with my home directory in it... so, it's correct.

The i3 logs are strange though:
i3 logfile

I hit $mod+d then I dump the log and the last line is:
10/11/2018 07:04:08 PM - ERROR: Another window manager seems to be running (X error 10)

I opened an issue on the i3 github also: i3/i3#3446 ...

@ghost
Copy link
Author

ghost commented Oct 11, 2018

So I installed i3wm 4.15 and created an other issue as a consequence since the other one was automatically closed by the i3 bot.

i3/i3#3450

@ghost
Copy link
Author

ghost commented Oct 13, 2018

Here's an updated with logs from i3. Same comment in the i3 github: i3/i3#3450 (comment)

So, with SHM logging:

Steps:

$ i3-msg shmlog on; i3-msg debuglog on
[{"success":true}]
[{"success":true}]

# type the keybinding that should trigger rofi

$ i3-dump-log >~/i3_logs/i3log-$(date +'%F-%k-%M-%S') 2>&1

$ i3-msg shmlog off; i3-msg debuglog off
[{"success":true}]
[{"success":true}]

log gist

Lines of the log that shows the executed command that does not work properly:

13/10/2018 11:04:54 - commands_parser.c:parse_command:265 - COMMAND: *exec ~/bin/./trigger_rofi*
13/10/2018 11:04:54 - commands.c:cmd_criteria_init:155 - Initializing criteria, current_match = 0x561b103e8100
13/10/2018 11:04:54 - commands.c:cmd_exec:1235 - should execute ~/bin/./trigger_rofi, no_startup_id = 0
13/10/2018 11:04:54 - startup id = i3/~|bin|.|trigger_rofi/1388-56-f02c_TIME27690841
13/10/2018 11:04:54 - executing: ~/bin/./trigger_rofi

I hope a few of you might understand what's going on and what/how to fix this!

@ghost
Copy link
Author

ghost commented Oct 13, 2018

Not much new info here, the script is executed by i3. Redirect all its output to a file to see if there is any error message from rofi.

I executed:

# /usr/bin/env bash
rofi -combi-modi window,drun,run,ssh -theme solarized -font 'hack 10' -show combi -modi combi &> ~/rofi_logs

Both, from the terminal and from $mod+d and the ~/rofi_logs is empty ...

@ghost
Copy link
Author

ghost commented Oct 13, 2018

As said in https://github.com/DaveDavenport/rofi/wiki/Debugging-Rofi and pointed at by @orestisf1993, I added G_MESSAGES_DEBUG=all hoping to see so logs from rofi:

$ G_MESSAGES_DEBUG=all; rofi -combi-modi window,drun,run,ssh -theme solarized -font 'hack 10' -show combi -modi combi &> ~/rofi_logs

w/o success... ~/rofi_logs is empty.

@DaveDavenport
Copy link
Collaborator

You did not set G_MESSAGES_DEBUG=all for rofi. (; should not be after it).

@ghost
Copy link
Author

ghost commented Oct 13, 2018

Ok thanks!

$ G_MESSAGES_DEBUG=all rofi <a few options> -show combi &> ~/rofi_logs/rofi_$(date +'%F-%k-%M-%S') gave this log (from the command line):

https://gist.github.com/phfrohring/d54326b9ac585233ddeb3f3818752736

From the i3 bindings it gives:

$ cat rofi_logs/rofi_2018-10-13-12-22-38 
/home/phf/bin/./trigger_rofi: line 2: rofi: command not found
$ /home/phf/bin/./trigger_rofi
#! /usr/bin/env bash
G_MESSAGES_DEBUG=all rofi -combi-modi window,drun,run,ssh -theme solarized -font 'hack 10' -show combi -modi combi &> ~/rofi_logs/rofi_$(date +'%F-%k-%M-%S')

Then I did:

$ which rofi
/home/phf/.guix-profile/bin/rofi

Updated the called script to:

$ /home/phf/bin/./trigger_rofi
#! /usr/bin/env bash
G_MESSAGES_DEBUG=all /home/phf/.guix-profile/bin/rofi -combi-modi window,drun,run,ssh -theme solarized -font 'hack 10' -show combi -modi combi &> ~/rofi_logs/rofi_$(date +'%F-%k-%M-%S')

which still does not work and gives this log:

(process:9906): Rofi-WARNING **: 12:29:07.563: Failed to set locale.

@DaveDavenport
Copy link
Collaborator

Setup your locale correctly?

It feels like your environment is pretty broken.

(p.s. there should not be a space after !.)

@ghost
Copy link
Author

ghost commented Oct 13, 2018

Setup your locale correctly?

It feels like your environment is pretty broken.

(p.s. there should not be a space after !.)

my locales:

    export LANG="en_US.UTF-8"
    export LC_CTYPE="en_US.UTF-8"
    export LC_NUMERIC="en_US.UTF-8"
    export LC_TIME="en_US.UTF-8"
    export LC_COLLATE="en_US.UTF-8"
    export LC_MONETARY="en_US.UTF-8"
    export LC_MESSAGES="en_US.UTF-8"
    export LC_ALL="en_US.UTF-8"

I uninstalled rofi with: $ guix package -r rofi then installed it using $ sudo apt install rofi and it's working just fine...

Apprently, installing with guix ($ guix package -i rofi) messes with export LC_ALL=... and the likes...

Thank you.

@ghost ghost closed this as completed Oct 13, 2018
@DaveDavenport
Copy link
Collaborator

weird.

@ghost
Copy link
Author

ghost commented Oct 13, 2018

weird.

Apparently, when I start Emacs using drun i.e. using a .desktop entry, then it does not find commands in the guix profile but when I start Emacs from a terminal, it does.

It seems that the problem is neither i3 nor Rofi but the fact that whatever is installed using Guix does not show up as expected in applications' concepts of $PATH i.e. where they expect to find programs pointed at by names...

Guix does not seem to manage environments as expected...

Well, will ask the Guix guys about this issue... Thanks!

@GladOSkar
Copy link

@phfohring did you try putting 'exec export PATH=$PATH:$HOME/.guix-profile/bin' into your i3 config?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants