Rofi_run script

I have been tinkering. Mostly with I3-wm. On this MacBookpro I3-wm will no longer start. Openbox will start but rofi seems to be gone.

F.ex running rofi in terminal (keys are “dead”)

rofi_run -d gives : Failed to get Keymap for current keyboard device. Connection has error.

I have checked .xprofile, ob-autostart, i3-config, but I can’t find any typos or what could be wrong. I am a bit tired. Helped my daughter to move today. Will sleep on it.

Here is my .xprofile

#!/bin/sh

# sourced at boot by ~/.xinitrc and most display managers

export QT_FONT_DPI=96 qbittorrent
export XDG_CONFIG_HOME="$HOME/.config"
export PATH="$HOME/.local/bin:$PATH"

# set sound functions #####################
start-pulseaudio-x11 & 
amixer -c 0 set Master playback 25% unmute &
pasystray &

# xsettings #####################
xsettingsd &
xset r rate 350 60 &
xsetroot -cursor_name left_ptr &
xset +fp ~/.local/share/fonts &
xset +fp ~/.fonts & 
xset +fp /usr/share/fonts & 
xset fp rehash & 
fc-cache -fv &

# touchpad toggle #####################
touchpad-indicator &

# Update notifier #####################
sleep 8 && sh -c "GDK_BACKEND=x11 pamac-tray" &

picom -b &
nm-applet &
volumeicon &
#nitrogen --restore &
~/fehbg &
bgchd -dir ~/Wallpaperspec -intv 7m -bcknd /etc/autobgch/scripts/feh &
/home/womp/wallpapersd &
xfce4-power-manager &
redshift-gtk &
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
gnome-keyring-daemon --start --components=pkcs11 &
ksuperkey -e 'Super_L=Alt_L|F1' &
ksuperkey -e 'Super_R=Alt_L|F1' &

/usr/lib/geoclue-2.0/demos/agent &
sxhkd -c ~/.config/sxhkd/base.conf &
udiskie --tray --automount --notify &
nitroshare &

Womp

This doesn’t really have anything to do with the rofi script, seems like you’ve been messing with system keyboard settings?

What do you get from

setxkbmap -print -verbose 10

Probably your rofi command should be in here:

sxhkd -c ~/.config/sxhkd/base.conf & 

Normally that is where I place the rofi keybinds because they are shared across window managers. Remember .xprofile is for x commands that are shared… sxhkd is for shared keybindings. Here’s an sxhkd rofi example…

# rofi menu   (2 options)
alt + @button1
	 rofi -modi drun,window,run -show drun -show-icons -sidebar-mode -location 0  -width 360

super + F1	 
	 rofi -modi drun,window,run -show drun -show-icons -sidebar-mode -location 0  -width 360

For details see:
https://wiki.archlinux.org/index.php/xprofile

Hi and thanks for answer!

setxkbmap -print -verbose 10 

Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      macbook79
layout:     se,us
variant:    mac_intl
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete+numpad(mac)
compat:     complete
symbols:    pc+macintosh_vndr/se+us:2+inet(evdev)
geometry:   macintosh(macbook79)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete+numpad(mac)"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+macintosh_vndr/se+us:2+inet(evdev)"	};
	xkb_geometry  { include "macintosh(macbook79)"	};
};



womp

1 Like

Actually sxhkd base.conf was the first place I looked! (thanks to @manyroads )
I have modified after my needs:

# rofi menu
super + d
	rofi_run -d 

womp

What do you have if you type the following from cmd line,

$rofi -show run

(process:113223): X11Helper-WARNING **: 19:16:05.300: Failed to get Keymap for current keyboard device.

(process:113223): Rofi-WARNING **: 19:16:05.300: Connection has error

The strange thing is I searched for hours but could not find anything similar to this! Not even in Arch-wiki.

womp

Try this,

$setxkbmap -model pc105 -layout us
$rofi -show run

Try this

setxkbmap -model macbook79 -layout us,se -variant mac_intl, -option grp:alt_shift_toggle

source: Xorg/Keyboard configuration - ArchWiki

This will set two keyboard layouts, se and us with the model as you had and a bind to switch between the two layouts using Alt+Shift

Now try as chroot said and run rofi, post the output.

That actually worked!! So it\s not rofi or i3-wm

womp

Your keymap is messed up. Try to follow @natemaia doc to reconfigure it.

Yes with your eminent help I am getting closer to the solution. It’s either mac_intl or macbook79 that is wrong.

I tried

setxkbmap -model pc105 -layout se 

That works! I will try out some combinations but I thank you very much for your help!!

womp

I only used that as it was in use originally from your output of setxkbmap -print -verbose 10

Personally I would just run pc104 (standard us keyboard layout), give it a shot with or without the -variant mac_intl as I don’t really know if it’s needed or not. Try everything as most layouts will be similar but some keys may not work as expected.

I have pc105 for a MBP. Works perfect. pc104 probable works, too.

2 Likes

@natemaia
@chroot
Yeah. That’s good idea! Will go with that!!
Thanks so much guys!!

womp

1 Like

I actually had to look up the difference.

pc105 have an extra key <>| like shown here on the lower left

pc104 is the standard us layout

I still get kinda confused by all the different variants. I don’t think it matters much as all the keys should send specific codes that get handled by the keymap and interpreted however needed.

1 Like

Yeah my old beat to shit iMac keyboard works with pc105.

1 Like

Great!
I have <> key down to the left! But configured with pc104 and <> key works like it should!?
If that is the difference why is <> key working? I do not understand this.
I am very happy anyway!! i3-wm boots without problems now!
It was my faulty xkbmap configuring!!

womp

1 Like

Yea that’s definitely a pc105, like I said before I’m not the most knowledgeable but AFAIK the keyboard will send specific bit patterns (codes) for each key pressed, layout won’t really matter as all keyboards send the same codes for any given character, the only difference being in the PCB layout and keyboard layout. When you press the <> key it will send the code for < or > depending on if shift is depressed. The OS sees this and say “I know that key code” and outputs the character.

You can test this by running xev (xorg-xev package) and change layouts, they should still output the same characters/codes for each keypress regardless of layout.

1 Like

Yeah, it doesn’t really matter. As long as the key code is right, it should work.

1 Like