Hi,
I run manjaro kde-plasma.
I would like to use a key combination to play/pause all my audio/media outputs.
In wine I run a program that I have to send F6 to to make it play/pause.
I think the best way is to write a script that looks if my wine app is active and then changes the media key to be sent as F6 to the program in wine.
I have a couple of questions:
1) blunt and simple: could someone help me create a scrip that does that or hint me in the direction on where I can find information on how to do that?
I have created a xdotool command that sends F6 to the wine program when executed in the terminal, but I have not been able to make it work reliably using xbindkeys.
here is my attempt in ~/.xbindkeysrc
Quote:
#Create a media key:
"xdotool key --clearmodifiers XF86AudioPlay"
Control + F5 + release
#send F6 to balabolka
"xdotool search --onlyvisible --name 'Balabolka.*' windowactivate key --window %@ F6"
XF86AudioPlay
|
2) Could you see what is wrong?
Also to get xbindkeys to start automatically I should place ‘xbindkeys’ in ~/.xinitrc before the line that starts my window manager or DE.
3) But where is that?
here is the file. I tried on line 12 but that screwed up my login screen:
Quote:
1 #!/bin/bash
2 #
3 # ~/.xinitrc
4 #
5 # Executed by startx (run your window manager from here)
6
7
8 userresources=$HOME/.Xresources
9 usermodmap=$HOME/.Xmodmap
10 sysresources=/etc/X11/xinit/.Xresources
11 sysmodmap=/etc/X11/xinit/.Xmodmap
12
13 DEFAULT_SESSION=startplasma-x11
14
15 # merge in defaults and keymaps
16
17 if [ -f $sysresources ]; then
18 xrdb -merge $sysresources
19 fi
20
21 if [ -f $sysmodmap ]; then
22 xmodmap $sysmodmap
23 fi
24
25 if [ -f "$userresources" ]; then
26 xrdb -merge "$userresources"
27 fi
28
29 if [ -f "$usermodmap" ]; then
30 xmodmap "$usermodmap"
31 fi
32
33 # start some nice programs
34
35 if [ -d /etc/X11/xinit/xinitrc.d ] ; then
36 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
37 [ -x "$f" ] && . "$f"
38 done
39 unset f
40 fi
41
42 get_session(){
43 local dbus_args=(--sh-syntax --exit-with-session)
44 case $1 in
45 awesome) dbus_args+=(awesome) ;;
46 bspwm) dbus_args+=(bspwm-session) ;;
47 budgie) dbus_args+=(budgie-desktop) ;;
48 cinnamon) dbus_args+=(cinnamon-session) ;;
49 deepin) dbus_args+=(startdde) ;;
50 enlightenment) dbus_args+=(enlightenment_start) ;;
51 fluxbox) dbus_args+=(startfluxbox) ;;
52 gnome) dbus_args+=(gnome-session) ;;
53 i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;;
54 jwm) dbus_args+=(jwm) ;;
55 kde) dbus_args+=(startplasma-x11) ;;
56 lxde) dbus_args+=(startlxde) ;;
57 lxqt) dbus_args+=(lxqt-session) ;;
58 mate) dbus_args+=(mate-session) ;;
59 xfce) dbus_args+=(xfce4-session) ;;
60 openbox) dbus_args+=(openbox-session) ;;
61 *) dbus_args+=($DEFAULT_SESSION) ;;
62 esac
63
64 echo "dbus-launch ${dbus_args[*]}"
65 }
66 nvidia-settings --load-config-only
67 exec $(get_session "$1")
|