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

Newest KDE does not allow you to map 'Print' key to FlameShot #796

Closed
jeffangelion opened this issue Aug 8, 2020 · 28 comments
Closed

Newest KDE does not allow you to map 'Print' key to FlameShot #796

jeffangelion opened this issue Aug 8, 2020 · 28 comments
Labels
Help Wanted Issues that the main devs need some help from community. Similar to "Good first issue" but harder. High Priority Needs Investigation

Comments

@jeffangelion
Copy link

Hi, I'm writing it more like caution for others: now you cannot map 'Print' key to taking a screenshot via FlameShot. Tried in KDE Plasma 5.19.3
If anyone has a clue/hack to work it around ‒‒ please leave it in comments
I hope @33KK and @DrunkenPoney will notice this issue

@borgmanJeremy
Copy link
Contributor

How did you map it previously?

@33KK
Copy link
Contributor

33KK commented Aug 9, 2020

Did you import this file or added shortcut manually?

@jeffangelion
Copy link
Author

jeffangelion commented Aug 10, 2020

How did you map it previously?

Through global keymap settings

Did you import this file or added shortcut manually?

Import did not work for me nor manual adding

@LinuxOnTheDesktop
Copy link

Cf. #717, #773 and perhaps other reports on this tracker. Those others might include problems on Mint - which has its own problems with such basic things as keyboards shortcuts; see for instance here.

@wazlecracker
Copy link

What I did to work around this since flameshot hasn't worked properly with hotkeys since Plasma 5.19 is I created a custom shortcut in System Settings > Shortcuts > Custom Shortcuts. Create a new global shortcut based on command/URL, set the trigger to Print and the action as the command flameshot gui.

@nyanpasu64
Copy link

KDE Plasma 5.19.4. Importing didn't work, before or after unbinding Spectacle. But setting Print manually worked after unbinding Spectacle.

@Martin-Eckleben Martin-Eckleben added Help Wanted Issues that the main devs need some help from community. Similar to "Good first issue" but harder. High Priority Needs Investigation labels Sep 4, 2020
@mmahmoudian
Copy link
Member

mmahmoudian commented Sep 5, 2020

I have the same KDE and it works fine for me (I initially imported it from the flameshot-shortcuts-kde file.) :

image

@nyanpasu64 and @jeffangelion can you create a custom keyboard shortcut as you see in the screenshot and confirm if it works.

@marcozaccari
Copy link

Kubuntu 20.04, Plasma 5.18.5

In the KDE settings, Shortcuts section, the Remote application should be org.dharkael.Flameshot instead of org.flameshot.Flameshot.
Searching by D-Bus Browser confirms this settings.

@mmahmoudian
Copy link
Member

@marcozaccari is correct for the current version if Flameshot (version 0.6), but as it has been explained, in the upcoming version, the dbus name is changed to org.flameshot.Flameshot for the upcoming release and also for the git builds. Stay tuned for the new release as it has quite a few bug fixes and new features as they are for now briefly listed in #844

@borgmanJeremy
Copy link
Contributor

@mmahmoudian Can we close this issue or is there more work to do?

@mmahmoudian
Copy link
Member

mmahmoudian commented Sep 10, 2020

@borgmanJeremy there is one thing left to do which closes multiple issues. I discussed the bug with @ZetaoYang on Slack to make sure my understanding of it is correct.

At the moment many people are facing issues running Flameshot simply because flameshot gui fails if the Flameshot is not already open in the background (I personally tried it on 0.6 on Ubuntu 18.04, and on 0.8 Manjaro). For now the trick is to run a flameshot & and then run other subcommands of Flameshot such as flameshot gui or flameshot config. This is regardless of DE or WM, but because the shortcut if the thing that breaks, people think it is KDE or Xmonad's problem. In this issue imho, part of the problem is with application path, but part of it is because if this issue that I explained.

What needs to be done is that Flameshot always checks if a Flameshot instance is running in the background and if not, run one instance in the background first and the execute the subcommand.

Update: @hosiet created a related issue #879

@hosiet
Copy link
Member

hosiet commented Sep 10, 2020

Just as I said in #879 , I somehow disagree with the analysis above.

The reason behind having to run a plain "flameshot" first before running subcommands is fundamentally because the activation of flameshot via D-Bus somehow failed. There could be multiple reasons:

  1. An invocation of "flameshot gui" will send a message on D-Bus telling the user session to do a "flameshot gui" thing and have itself immediately exits. ← be aware of this behavior
  2. If there is already a flameshot instance running in background, that flameshot instance will receive the message through D-Bus and execute it.
  3. If there was no flameshot running in background, this D-Bus message will bring up a background flameshot running instance and send the request to the new instance. This is called D-Bus Activation ( https://specifications.freedesktop.org/desktop-entry-spec/1.1/ar01s07.html ).

As said in #879 , this marks an uncommon dependency on a working user D-Bus session. Things could go really wrong if that D-Bus environment is not properly working. For example:

  • If the D-Bus activation could not find the proper binary to start. This happens to the flameshot v0.6.0 .deb package for Ubuntu on current GitHub release page due to hard coding nonexistent /usr/local/bin/flameshot and was never fixed.
  • If there are no user D-bus sessions available. This applies to some bug reports of WM users.

I agree that the extensive use of D-Bus is problematic in some cases, but such design is agnostic to whether there are any flameshot instances running. If we fall back to manual detection, sending messages via D-Bus would be meaningless.

My point is that we need careful consideration about redesign of this part (detection, subcommand and D-Bus activation).

@Nisc3d
Copy link

Nisc3d commented Sep 22, 2020

After the Update to 0.8 yesterday my shortcut also stopped working. I removed the shortcut file and readded it. But still nothing.
Then I manually made a shortcut that starts flameshot gui and that worked.
Flameshot was always running in the Background.
I have Plasma 5.19.5 on Arch Linux.

@mmahmoudian
Copy link
Member

@Nisc3d can you post a screenshot here from your keyboard shortcut window to demo how you have manually set it.

@Nisc3d
Copy link

Nisc3d commented Sep 22, 2020

grafik
grafik
I hope this helps.

@mmahmoudian
Copy link
Member

@Nisc3d yours does not run D-Bus but the flameshot-shortcuts-kde correctly sets the D-Bus:

image

@Nisc3d
Copy link

Nisc3d commented Sep 22, 2020

Yes and this doesn't work for me.

@maksymov
Copy link

maksymov commented Oct 7, 2020

any news with this?

@borgmanJeremy
Copy link
Contributor

No, I am unable to replicate it on arch / KDE.

@mmahmoudian
Copy link
Member

@maksymov I have a hunch that this situation is related to #960. Please try the steps I mentioned here and let us know if it fixes the issue.

@ManosGEM
Copy link

ManosGEM commented Oct 19, 2020

Kubuntu 20.04, Plasma 5.18.5

In the KDE settings, Shortcuts section, the Remote application should be org.dharkael.Flameshot instead of org.flameshot.Flameshot.
Searching by D-Bus Browser confirms this settings.

Using org.dharkael.Flameshot solved the issue for me. I'm using KDE Plasma 5 on Debian 10.
Thanks @marcozaccari

@borgmanJeremy
Copy link
Contributor

Are you on a pre 0.8.x release?

@dude1phoenix
Copy link

Kubuntu 20.04, Plasma 5.18.5

In the KDE settings, Shortcuts section, the Remote application should be org.dharkael.Flameshot instead of org.flameshot.Flameshot.
Searching by D-Bus Browser confirms this settings.

That stiil work for KDE Plasma 5.18.5 \ Flameshot 0.6.0

@mmahmoudian
Copy link
Member

@dude1phoenix your Flameshot version is very old. Please consider updating to the latest version. You can use Snap, Flatpak or AppImage if your distribution doesn't have the latest Flameshot version in their repo. Alternatively you can build from source.

For further information please visit https://flameshot.org/guide/installation/installation-linux/

@sep2
Copy link

sep2 commented Feb 9, 2022

For anyone in Arch/KDE new to this, please import the latest file (Feb 7, 2022).

See instruction here.

@woodsleaf
Copy link

woodsleaf commented Apr 2, 2022

@Nisc3d
It help me in KDE Plasma 5.20.5.
Thanks for example.

@woodsleaf
Copy link

woodsleaf commented Apr 2, 2022

Official decision
Console command example

In Cyrillic localization it looks like this:

Создать каталог для Скриншотов
mkdir -p ~/Изображения/Screenshots

Загрузить конфигурационный файл
cd ~/Загрузки; wget https://raw.githubusercontent.com/flameshot-org/flameshot/master/docs/shortcuts-config/flameshot-shortcuts-kde.khotkeys

Открыть Параметры системы → Комбинации клавиш → Специальные комбинации клавиш.
Нажать Edit → Import..., Выбрать каталог ~/Загрузки
Выбрать конфигурационный файл flameshot-shortcuts-kde.khotkeys.
Нажать [Применить].

! Третий элемент требует модификации команды:
flameshot full -p ~/Изображения/Screenshots

Проверить что сочетания клавиш не конфликтуют с другими программами, сочетания могут не установиться при импорте если уже задействованы.

Prt Sc Start the Flameshot screenshot tool and take a screenshot
Ctrl + Prt Sc Wait for 3 seconds, then start the Flameshot screenshot tool and take a screenshot
Shift + Prt Sc Take a full-screen (all monitors) screenshot and save it
Ctrl + Shift + Prt Sc Take a full-screen (all monitors) screenshot and copy it to the clipboard

2022-04-02_22-55

P.S.: KDE Plasma 5.20.5. Flameshot 0.9.0+ds1-2 (Debian) Compiled with Qt 5.15.2

@marufmax
Copy link

+1 not working for me also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Issues that the main devs need some help from community. Similar to "Good first issue" but harder. High Priority Needs Investigation
Projects
None yet
Development

No branches or pull requests