You are not logged in.

#1 2005-01-11 14:40:48

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

the usefullness of xbindkeys

xbindkeys i run for longtime with accumulating nice helpfull key-combinations that help do things faster ...

here examples of the "classical" uses of xbindkeys i have in ~/.xbindkeysrc :

1 - xkill:

"xkill"
  control+mod1+q

even if not handeled by WM used, i am able to run xkill (this saves time restarting X if in trouble)

2 - mpc/mpd:

"mpc next"
  control+mod1+n

"mpc > /tmp/mpc_now && osd_cat -p bottom -A center -u black -O 4 -f '-bitstream-bitstream vera sans mono-medium-r-normal-*-36-*-*-*-m-*-iso8859-1' /tmp/mpc_now"
  control+mod1+i

the first key-combination changes to the next song. the second shows the currently playing using xosd

feel free to share your nice key-combinations, that make the work easier


The impossible missions are the only ones which succeed.

Offline

#2 2005-01-11 17:13:51

Greycloack
Member
Registered: 2004-03-05
Posts: 166

Re: the usefullness of xbindkeys

I'm using a laptop so obviously I wanted to use all the multimedia keys and such.
I used 'xev' and some googling to find the key codes for my comp (gateway 200x)

I binded the volume keys to aumix

"aumix -w +5 &"
    c:176
"aumix -w -5 &"
    c:174

So now I can use them to volume up and down (they're binded to the PCM channel so I can use both headphones and speakers)

oh and this can come in handy sometimes :
"fbrun &"
    control + shift + r
to run occasional programs

and
"aterm &"
    control + shift + t

Offline

#3 2005-01-11 17:42:53

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: the usefullness of xbindkeys

Greycloack wrote:

I binded the volume keys to aumix

"aumix -w +5 &"
 c:176
"aumix -w -5 &"
 c:174

good idea!


The impossible missions are the only ones which succeed.

Offline

#4 2005-01-11 17:49:47

kakabaratruskia
Member
From: Santiago, Chile
Registered: 2003-08-24
Posts: 596

Re: the usefullness of xbindkeys

dp wrote:

1 - xkill:

"xkill"
  control+mod1+q

even if not handeled by WM used, i am able to run xkill (this saves time restarting X if in trouble)

Nice one.


And where were all the sportsmen who always pulled you though?
They're all resting down in Cornwall
writing up their memoirs for a paper-back edition
of the Boy Scout Manual.

Offline

#5 2005-01-11 18:18:38

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: the usefullness of xbindkeys

Greycloack wrote:

I binded the volume keys to aumix

"aumix -w +5 &"
    c:176
"aumix -w -5 &"
    c:174

yeah, now if i can only get the mute toggle to work....

Offline

#6 2005-01-12 17:50:26

Greycloack
Member
Registered: 2004-03-05
Posts: 166

Re: the usefullness of xbindkeys

hmm

"aumix -w m" should mute the channel... but I get the feeling you already tried that...

Offline

#7 2005-01-12 18:50:33

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: the usefullness of xbindkeys

Greycloack wrote:

hmm

"aumix -w m" should mute the channel... but I get the feeling you already tried that...

yeah it mutes it, but the next press mutes it again... I could do it... but it'd require a whole script to check aumix, see if channel is muted, if so unmute, otherwise mute.... i'm just lazy and feel that's too much work to mute/unmute... I'll just hit volume down until it's at 0

Offline

#8 2005-01-12 19:21:02

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: the usefullness of xbindkeys

try "mute" ;-)


Mr Green

Offline

#9 2005-01-13 01:37:14

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Offline

#10 2005-01-13 03:07:39

kakabaratruskia
Member
From: Santiago, Chile
Registered: 2003-08-24
Posts: 596

Re: the usefullness of xbindkeys

Mr Green wrote:

try "mute" ;-)

heh, thanks, I was also looking for something like that.


And where were all the sportsmen who always pulled you though?
They're all resting down in Cornwall
writing up their memoirs for a paper-back edition
of the Boy Scout Manual.

Offline

#11 2007-03-15 11:13:32

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: the usefullness of xbindkeys

phrakture wrote:
Greycloack wrote:

hmm

"aumix -w m" should mute the channel... but I get the feeling you already tried that...

yeah it mutes it, but the next press mutes it again... I could do it... but it'd require a whole script to check aumix, see if channel is muted, if so unmute, otherwise mute.... i'm just lazy and feel that's too much work to mute/unmute... I'll just hit volume down until it's at 0

Hi, I just set up the mute/unmute key on my laptop using xbindkeys and amixer.
I use a little script that ckecks if the Master channel is muted or not and then mutes or unmutes it.

~/.xbindkeysrc

# Master Volume mute/unmute (Fn + F8)
"/usr/local/bin/MasterMuteUnmute"
  c:160 + m:0x0

and the 'MasterMuteUnmute' script

#!/bin/bash

amixer -c 0 cget numid=1 | grep -o values=on

if [ $? -eq 0 ]; then
        amixer -c 0 set Master mute
else
        amixer -c 0 set Master unmute
fi

My question is, it is possible to put the lines of the script directly into the .xbindkeysrc file?

Last edited by SiD (2007-03-15 11:16:21)

Offline

#12 2007-03-15 12:04:09

smoon
Member
Registered: 2005-08-22
Posts: 468
Website

Re: the usefullness of xbindkeys

SiD wrote:
phrakture wrote:
Greycloack wrote:

hmm

"aumix -w m" should mute the channel... but I get the feeling you already tried that...

yeah it mutes it, but the next press mutes it again... I could do it... but it'd require a whole script to check aumix, see if channel is muted, if so unmute, otherwise mute.... i'm just lazy and feel that's too much work to mute/unmute... I'll just hit volume down until it's at 0

Hi, I just set up the mute/unmute key on my laptop using xbindkeys and amixer.
I use a little script that ckecks if the Master channel is muted or not and then mutes or unmutes it.

~/.xbindkeysrc

# Master Volume mute/unmute (Fn + F8)
"/usr/local/bin/MasterMuteUnmute"
  c:160 + m:0x0

and the 'MasterMuteUnmute' script

#!/bin/bash

amixer -c 0 cget numid=1 | grep -o values=on

if [ $? -eq 0 ]; then
        amixer -c 0 set Master mute
else
        amixer -c 0 set Master unmute
fi

My question is, it is possible to put the lines of the script directly into the .xbindkeysrc file?

That looks pretty complicated. Here's how I do it:

"amixer sset Master toggle"
  XF86AudioMute

Offline

#13 2007-03-15 15:32:10

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: the usefullness of xbindkeys

thanks for the tip, this in .xbindkeyrc works for me too

"amixer -c 0 set Master toggle"
c:160 + m:0x0

I didn't see the "toggle" option while reading the amixer man page ...
Anyway, I learned a little more about bash-scripts setting up the mute/unmute key with my script wink

Offline

#14 2007-03-15 16:26:09

Mo
Member
Registered: 2007-01-18
Posts: 92

Re: the usefullness of xbindkeys

smoon wrote:

That looks pretty complicated. Here's how I do it:

"amixer sset Master toggle"
  XF86AudioMute

This does not work for me. Only "amixer -c 0 set PCM 100%-" or "amixer -c 0 set PCM 100%+" work.. Who can help?

Offline

#15 2007-03-15 16:32:13

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Re: the usefullness of xbindkeys

Mo wrote:
smoon wrote:

That looks pretty complicated. Here's how I do it:

"amixer sset Master toggle"
  XF86AudioMute

This does not work for me. Only "amixer -c 0 set PCM 100%-" or "amixer -c 0 set PCM 100%+" work.. Who can help?

The command is :
# Audio mute
"amixer set Master toggle"
    m:0x0 + c:160
Notice that  is "set" not "sset" that may be the reason it does not work for you.

R

Offline

#16 2007-03-15 20:52:30

Mo
Member
Registered: 2007-01-18
Posts: 92

Re: the usefullness of xbindkeys

No, it is the "toggle"-command that is not working. I have to use PCM instead of Master, since my master control is called like that wink.

Offline

#17 2007-05-11 15:08:10

delaril
Member
Registered: 2007-02-11
Posts: 9

Re: the usefullness of xbindkeys

I found this script online (thanks google), it works like a charm and remembers the mixer settings in aumix:

#!/bin/sh

#   Aumix mute toggle
#   Version: 1.1.0
#   Date: 2005/03/21
#
#   Copyright: 2004 Jeremy Brand <jeremy@nirvani.net>
#   http://www.nirvani.net/software/
#   Licenced under the GNU Public License Version 2.
#
# Purpose:
#   To have a single script toggle between current sound levels
#   and mute with the aumix program while maintaining
#   and not deleting current mixer saved settings.
#
# Notes:
#   I bind this program to a single key in my window manager's
#   configuration file.  It then serves the purpose of having a
#   audio mute key.  If you have a fancy keyboard with a mute
#   key, try binding this program to that scancode.
#
# Usage:
#
# Toggle between mute and unmute based on last state:
#   aumix-toggle-mute.sh
#
# Force mute:
#   aumix-toggle-mute.sh --force-mute
#
# Force unmute:
#   aumix-toggle-mute.sh --force-unmute
#

TMP=$$

function __mute() {

  if [ -e "$HOME/.aumixrc.mute" ]; then
    aumix -v 0; aumix -w 0
  else
    mv -f $HOME/.aumixrc $HOME/.aumixrc.$TMP
    aumix -S
    aumix -v 0; aumix -w 0
    mv -f $HOME/.aumixrc $HOME/.aumixrc.mute
    mv -f $HOME/.aumixrc.$TMP $HOME/.aumixrc
  fi

}

function __unmute () {

  if [ -e "$HOME/.aumixrc.mute" ]; then
    mv -f $HOME/.aumixrc $HOME/.aumixrc.$TMP
    mv -f $HOME/.aumixrc.mute $HOME/.aumixrc
    aumix -L > /dev/null
    mv -f $HOME/.aumixrc.$TMP $HOME/.aumixrc
  else
    aumix -L > /dev/null
  fi

}

if [ "$1" = "--force-mute" ]; then

  __mute;

elif [ "$1" = "--force-unmute" ]; then

  __unmute;

elif [ -e "$HOME/.aumixrc.mute" ]; then

  __unmute;

else

  __mute;

fi

Offline

Board footer

Powered by FluxBB