LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-17-2019, 10:45 AM   #1
Pasc
LQ Newbie
 
Registered: Dec 2018
Posts: 7

Rep: Reputation: Disabled
Num pad shortcuts and media commands


Hello,

I'm currently in Neon 5.15 and I have a keyboard with numpad. I want to use certain keys (2,4,5,6,8) for multimedia control and volume adjustments. I can easily define them in KDE settings->shortcuts so that when numlock is off I have 1=end 2=vol decrease, 3=pgdn, 4=prev song, 5=play/pause, 6=next song, 7=home 8=vol increase, 9=pgup. But when I do this when numlock is on I can only insert 1,3,7,9 meaning the keys I have not specified in the shortcut menu. The others do nothing. I also get some random numlock on/offs but this is for another post I guess...
I decided to use xbindkeys to try a workaround. But, I don't know the correct commands to assign to them. For Vol up/down I found "amixer sset Master 5%" but this does not have the exact same functionality as the Fn+left/right arrows which apart from adjusting the vol also gives a visual feedback (the bar with the vol percentage). For the prev, play/pause, next I found "qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.COMMAND" but this is only for Amarok and not for the other players and of course, doesn't provide the same functionality as the Settings->shortcuts with (I believe it uses Media Player which controls also firefox) which can choose the most recent player to apply the command.

So, can you please help me? The truth is I would prefer a solution for the first way (through KDE shortcuts). It's cleaner and easier to manage, without adding new daemons in the pipeline. But of course, a solution via xbindkeys or maybe another workaround would be appreciated as well.

P.S. do you think that creating events for acpi would be more efficient for the system?
 
Old 02-17-2019, 11:04 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,062
Blog Entries: 7

Rep: Reputation: 2794Reputation: 2794Reputation: 2794Reputation: 2794Reputation: 2794Reputation: 2794Reputation: 2794Reputation: 2794Reputation: 2794Reputation: 2794Reputation: 2794
i'm a little confused; are you asking for a solution for your "random" numlocks or something more?
there is a small X app called numlockx that will switch it off for sure; just add that to your startup applications.
 
Old 02-17-2019, 12:14 PM   #3
Pasc
LQ Newbie
 
Registered: Dec 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
I am sorry for confusing you but in my defense I said that this "random behavior" is for another post.
I am looking for a way to use numpad arrow-keys(2,4,6,8) and num-clear(5) for media control. As stated above when I do it from the KDE settings->shortcuts I have the expected functionality concerning the media control but I lose the ability to use those keys for inserting numbers (when I toggle numlock to number mode).
 
Old 02-19-2019, 07:39 AM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 current / Linux Mint / Debian / Void Linux
Posts: 8,151

Rep: Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682
Keyboard shortcuts (KBSC) are desktop / Window Manager dependent, if it works in KDE in how you've setup your KBSC, then in the desktop/WM you're presently using they too have their respective KBSC conf files, (some WM do not posses such control). You are going to have to give more tech specs, what DT/WM are you talking about?

2: some are not so giving in providing such diversity if [ true ] then ; else for KBSC.. not to my knowledge, but anything is possible with Linux/GNU.

Last edited by BW-userx; 02-19-2019 at 07:43 AM.
 
Old 02-23-2019, 06:12 AM   #5
Pasc
LQ Newbie
 
Registered: Dec 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
I am running KDE Neon 5.15, kwin --version = 5.15.1. how to find those configuration files?
 
Old 02-23-2019, 07:49 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 current / Linux Mint / Debian / Void Linux
Posts: 8,151

Rep: Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682
Code:
$ whereis kwin
kwin: /usr/bin/kwin
userx@slackcurdvd.net:~
$ whereis kde
kde: /etc/kde
then just 'ls' into them to see what you see. You should already know what /usr/bin is for. For user config files they are kept in the home dir of the user as hidden files. Either in ~/.config or there own dir outside of that dir. You can use 'find' on your own home using wildcards to see what you come up with. Open a file manager and select 'show hidden file'.

Last edited by BW-userx; 02-23-2019 at 07:53 AM.
 
Old 03-04-2019, 12:39 PM   #7
Pasc
LQ Newbie
 
Registered: Dec 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
But I don't understand how finding these config files would help me solve the problem. I don't think I can find the terminal command for play/pause or next/prev. Nor I believe there is a way to change the keys not working.
Is there something I m missing?
 
Old 03-04-2019, 01:04 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 current / Linux Mint / Debian / Void Linux
Posts: 8,151

Rep: Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682
you have to find a means to tie the keyboard keys to the device / application you are wanting to control. Not all keyboard that already have dedicated volume keys on the keyboard work in Linux, but that is not to say it cannot be done. I use mpv video player in their config I have keyboard shortcuts for volume and seek set to my liking.
Code:
MOUSE_BTN3 add volume 2
MOUSE_BTN4 add volume -2
#keyboard arrow keys
UP add volume 2
DOWN add volume -2
perhaps you might want to try the app that is using the sound to see if you can manipulate it there instead.

Last edited by BW-userx; 03-04-2019 at 01:07 PM.
 
  


Reply

Tags
kde kde5, media, num lock, num-lock, terminal


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Why does /media/cdrecorder pop up with "cd /media/ + tab" when I have /media/usb too? SharpyWarpy Fedora 6 11-22-2012 01:05 AM
how can grep from file (num num) (num num) ? DoME69 Programming 2 11-07-2011 06:56 AM
Media, media, and oh yeah......media. Morbid SUSE / openSUSE 2 03-11-2007 08:50 PM
Num-pad on keyboard stopped functioning? l0f33t Linux - Newbie 1 05-25-2003 11:17 AM
num pad wont work phoenix Linux - Hardware 2 01-20-2003 03:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration