22
5
I am new to Xmonad (just installed it yesterday), and since I have never used haskell before, I found configuration a little bit confusing for me. I got somewhat made xmobar and trayer work, but I have no idea how might I make multimedia keys to adjust volume. Can anyone help with that?
Additional question: How do you manage your volume in xmonad. Do you use tray icon, or other things like that?
Here is my xmonad configuration:
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
main = xmonad =<< statusBar myBar myPP toggleStrutKey myConfig
-- Command to launch the bar
myBar = "xmobar"
-- Custom PP, it determines what is written to the bar
myPP = xmobarPP { ppCurrent = xmobarColor "#429942" "" . wrap "<" ">" }
-- Key bindings to toggle the gap for the bar
toggleStrutKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
myConfig = defaultConfig {
manageHook = manageDocks <+> manageHook defaultConfig,
layoutHook = avoidStruts $ layoutHook defaultConfig,
modMask = mod4Mask -- Rebind Mod to windows key
} `additionalKeys`
[ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
]
1Mute key problem: When I start
xev
and press mute key, there's nothing to find in the terminal. (Other keys are fine.) I looked up from/usr/include/X11/XF86keysym.h
, I found this:#define XF86XK_AudioMute 0x1008FF12 /* Mute sound from the system */
Do you know what's the problem with my mute key? Thank you. – Nick – 2014-12-18T00:42:31.240Another
Mute
key problem: I can't find the name for Mute either. (I use ThinkPad.) – Nick – 2014-12-22T14:48:44.123if the amixer set Master 2- doesn't work for your system, try amixer set Master 2%- – zhenjie – 2013-05-30T19:11:39.030
1When I use xev and press volume keys on my HP laptop I get no keycodes, but showkey command show them as keycode 114 and keycode 115. How do I need to change this XMonad config file to work with my keys? – valentt – 2013-07-03T18:38:54.110
On Ubuntu 13.04 this worked copy/paste without looking up the keys symbols. – Cory Klein – 2013-10-16T21:19:16.343
2If the mute above cannot unmute, try
amixer -D pulse set Master toggle
instead. – zw324 – 2013-12-26T19:26:03.613