You are not logged in.

#1 2023-12-23 18:50:09

b42
Member
Registered: 2023-07-20
Posts: 203

[SOLVED] Cannot bind joplin CLI to keyboard shortcut

I installed joplin CLI on .local/share/joplin and made a link to my $PATH

From terminal, I can do joplin and it opens just fine but if I bind joplin to keyboard shortcut it does not work, nothing happens.

What is the cause and how do I fix this?

Last edited by b42 (2023-12-25 15:40:39)

Offline

#2 2023-12-23 21:10:37

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

b42 wrote:

made a link to my $PATH

What does this mean, exactly? Please share the name and full contents of the file(s) you edited.

Sounds like you've added to PATH in ~/.bashrc (or so), which would only be applied to that shell.


Jin, Jîyan, Azadî

Offline

#3 2023-12-23 21:40:55

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

I did

  NPM_CONFIG_PREFIX=~/.local/share/joplin npm install -g joplin 

and

sudo ln -s ~/.local/share/joplin/bin/joplin ~/.local/bin/joplin

as official joplin documentation explains here:

https://joplinapp.org/help/apps/terminal/

.local/bin has been added to my $PATH in .zprofile

Last edited by b42 (2023-12-23 21:42:02)

Offline

#4 2023-12-23 21:50:05

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

b42 wrote:

.local/bin has been added to my $PATH in .zprofile

I wrote:

Please share the [...] full contents of the file

Also: which desktop environment is this and how is it launched? Some display managers will ignore ~/.zprofile: https://bbs.archlinux.org/viewtopic.php?id=211162


Jin, Jîyan, Azadî

Offline

#5 2023-12-23 21:54:12

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

sorry I confused here a little bit.

I have not edited .zprofile, .local/bin is added to my $PATH by default.

DE - KDE Plasma

Offline

#6 2023-12-23 22:01:00

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

Looks like you might need to set PATH for Plasma in a .sh file under ~/.config/plasma-workspace/env/, as per https://userbase.kde.org/Session_Environment_Variables.

Disclaimer: I don't use Plasma (too many knobs).


Jin, Jîyan, Azadî

Offline

#7 2023-12-23 22:16:36

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

but the thing is that it is already in my $PATH:

/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Offline

#8 2023-12-23 22:20:33

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

But that's from your terminal, right? The desktop might not inherit that.

You could try using this from the desktop application launcher to test:

sh -c 'echo $PATH > ~/results.txt'

Then check the contents of ~/results.txt.


Jin, Jîyan, Azadî

Offline

#9 2023-12-23 22:22:36

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

How do I do that exactly from that desktop application launcher?

Offline

#10 2023-12-23 22:29:43

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

Just type it in. It works for me with dmenu/bemenu anyway. Not sure about the Plasma launcher.

Or just use the full path for the keyboard shortcut.


Jin, Jîyan, Azadî

Offline

#11 2023-12-23 22:39:23

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

output

/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Last edited by b42 (2023-12-23 22:40:09)

Offline

#12 2023-12-23 22:51:44

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

So does using the full path for the keyboard shortcut work?


Jin, Jîyan, Azadî

Offline

#13 2023-12-23 23:15:03

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

no, unfortunately it does not..

Offline

#14 2023-12-24 11:25:56

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

Missed this:

b42 wrote:
sudo ln -s ~/.local/share/joplin/bin/joplin ~/.local/bin/joplin

So the ~/.local/bin/joplin symlink is now root owned. Delete the symlink and run the `ln` command again without `sudo`.


Jin, Jîyan, Azadî

Offline

#15 2023-12-24 14:56:30

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

Did that, still does not work.

Offline

#16 2023-12-24 19:39:32

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

When you attempted to use the full path for the keybind did you use "~" or did you give the full directory names? It could be that the keybind application doesn't understand "~". Be sure to try both the original file location and the symlink location.

Last edited by Head_on_a_Stick (2023-12-24 19:40:13)


Jin, Jîyan, Azadî

Offline

#17 2023-12-25 11:29:44

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

I used joplin only because it is in my $PATH and it works from terminal.

But I changed it to full path /home/user/.local/bin/joplin and it still does not work.

Can it be because it is a strange package that was neither from package manager nor built from source but NPM_CONFIG_PREFIX (which I dont even have a clue what it is)?

Offline

#18 2023-12-25 11:34:04

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

FFS it's a terminal application, isn't it? Sorry, I should have checked, my fault entirely.

If you want to open it from a keybind then you will have to open a terminal with Joplin running inside it.

For example:

xterm -e joplin

Any reason why you're not using the AUR package?


Jin, Jîyan, Azadî

Offline

#19 2023-12-25 12:34:23

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

Yes, it is a terminal application.

xterm -e joplin

It works!! I just had to replace xterm with konsole since I use konsole on this device.

So for every terminal application to bind to keyboard shortcut I have to use

$TerminalAppName -e $AppIWantToRun

?

I just think that the original way to install that the developer provides is better and maybe 'more' open-source. I might be totally wrong, could you explain the difference between the method I installed and AUR?
Oh, another reason is I believe that if I want to migrate to another device I will take the app itself (which in this case lies in .local/bin/joplin) and config (.config/joplin) and will simply copy the files to another device with all my data and config settings.

Offline

#20 2023-12-25 12:59:24

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

The -e option is pretty common but not universal. Check the relevant man page, as usual.

Using packages is better because the software is easier to keep track of and remove cleanly. Always read the PKGBUILD before installing from the AUR though, it would be _very_ easy to upload malware to the AUR.


Jin, Jîyan, Azadî

Offline

#21 2023-12-25 13:25:11

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

has there been many instances with malware in AUR?

May I ask what DE you use?

Offline

#22 2023-12-25 13:30:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut


Jin, Jîyan, Azadî

Offline

#23 2023-12-25 15:40:27

b42
Member
Registered: 2023-07-20
Posts: 203

Re: [SOLVED] Cannot bind joplin CLI to keyboard shortcut

Thank you for your help!

Offline

Board footer

Powered by FluxBB