You are not logged in.

#1 2015-04-10 13:59:58

coyote3007
Member
Registered: 2015-03-26
Posts: 19

[SOLVED] F1 to F12 not working

Hi all, i have a Razer Blackwidow Chroma 2014 as keyboard and the problem is when i try to use the Fx keys (F1,F2....F12) in urxvt, it takes them as ~ (f8 takes as 0~ , F9 1~... F12 4~) , it only happens on urxvtand when i press it a green flash appears on the screen ( i have green color font)

here's my xmonad.hs

import System.IO
import System.Exit
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
import XMonad.Layout.Spiral
import XMonad.Layout.Tabbed
import XMonad.Layout.ThreeColumns
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import qualified XMonad.StackSet as W
import qualified Data.Map        as M

myTerminal = "urxvt"

myWorkspaces = [ "1:Internet"
	       , "2:Programming"
	       , "3:Shell"
	       , "4:Mail"
	       , "5:Skype"
	       , "6:Other"
	       ] ++ map show [7..9]

myManageHook = composeAll
    [ className =? "Chromium"       --> doShift "1:Internet"
    , resource  =? "desktop_window" --> doIgnore
    , className =? "Galculator"     --> doFloat
    , className =? "Mutt"           --> doShift "4:Mail"
    , className =? "Skype"          --> doShift "5:Skype"
    , isFullscreen --> (doF W.focusDown <+> doFullFloat)]

------------------------------------------------------------------------
-- Layouts
-- You can specify and transform your layouts by modifying these values.
-- If you change layout bindings be sure to use 'mod-shift-space' after
-- restarting (with 'mod-q') to reset your layout state to the new
-- defaults, as xmonad preserves your old layout settings by default.
--
-- The available layouts.  Note that each layout is separated by |||,
-- which denotes layout choice.
--
myLayout = avoidStruts (
    Tall 1 (3/100) (1/2) |||
    Mirror (Tall 1 (3/100) (1/2)) |||
    tabbed shrinkText tabConfig |||
    Full |||
    spiral (6/7)) |||
    noBorders (fullscreenFull Full)


------------------------------------------------------------------------
-- Colors and borders
-- Currently based on the ir_black theme.
--
myNormalBorderColor  = "#7c7c7c"
myFocusedBorderColor = "#ffb6b0"

-- Colors for text and backgrounds of each tab when in "Tabbed" layout.
tabConfig = defaultTheme {
    activeBorderColor = "#7C7C7C",
    activeTextColor = "#CEFFAC",
    activeColor = "#000000",
    inactiveBorderColor = "#7C7C7C",
    inactiveTextColor = "#EEEEEE",
    inactiveColor = "#000000"
}

-- Color of current window title in xmobar.
xmobarTitleColor = "#FFB6B0"

-- Color of current workspace in xmobar.
xmobarCurrentWorkspaceColor = "#CEFFAC"

-- Width of the window border in pixels.
myBorderWidth = 1


------------------------------------------------------------------------
-- Key bindings
--
-- modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt").  You may also consider using mod3Mask
-- ("right alt"), which does not conflict with emacs keybindings. The
-- "windows key" is usually mod4Mask.
--
myModMask = mod4Mask

myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
  ----------------------------------------------------------------------
  -- Custom key bindings
  --

  -- Start a terminal.  Terminal to start is specified by myTerminal variable.
  [ ((modMask .|. shiftMask, xK_Return),
     spawn $ XMonad.terminal conf)

  -- Lock the screen using xscreensaver.
  , ((modMask .|. controlMask, xK_l),
     spawn "xscreensaver-command -lock")

  -- Launch dmenu via yeganesh.
  -- Use this to launch programs without a key binding.
  , ((modMask, xK_p),
     spawn "dmenu_run -b -fn '7x14'")

  -- Take a screenshot in select mode.
  -- After pressing this key binding, click a window, or draw a rectangle with
  -- the mouse.
  , ((modMask .|. shiftMask, xK_p),
     spawn "select-screenshot")

  -- Take full screenshot in multi-head mode.
  -- That is, take a screenshot of everything you see.
  , ((modMask .|. controlMask .|. shiftMask, xK_p),
     spawn "screenshot")


  --------------------------------------------------------------------
  -- "Standard" xmonad key bindings
  --

  -- Close focused window.
  , ((modMask .|. shiftMask, xK_c),
     kill)

  -- Cycle through the available layout algorithms.
  , ((modMask, xK_space),
     sendMessage NextLayout)

  --  Reset the layouts on the current workspace to default.
  , ((modMask .|. shiftMask, xK_space),
     setLayout $ XMonad.layoutHook conf)

  -- Resize viewed windows to the correct size.
  , ((modMask, xK_n),
     refresh)

  -- Move focus to the next window.
  , ((modMask, xK_Tab),
     windows W.focusDown)

  -- Move focus to the next window.
  , ((modMask, xK_j),
     windows W.focusDown)

  -- Move focus to the previous window.
  , ((modMask, xK_k),
     windows W.focusUp  )

  -- Move focus to the master window.
  , ((modMask, xK_m),
     windows W.focusMaster  )

  -- Swap the focused window and the master window.
  , ((modMask, xK_Return),
     windows W.swapMaster)

  -- Swap the focused window with the next window.
  , ((modMask .|. shiftMask, xK_j),
     windows W.swapDown  )

  -- Swap the focused window with the previous window.
  , ((modMask .|. shiftMask, xK_k),
     windows W.swapUp    )

  -- Shrink the master area.
  , ((modMask, xK_h),
     sendMessage Shrink)

  -- Expand the master area.
  , ((modMask, xK_l),
     sendMessage Expand)

  -- Push window back into tiling.
  , ((modMask, xK_t),
     withFocused $ windows . W.sink)

  -- Increment the number of windows in the master area.
  , ((modMask, xK_comma),
     sendMessage (IncMasterN 1))

  -- Decrement the number of windows in the master area.
  , ((modMask, xK_period),
     sendMessage (IncMasterN (-1)))

  -- Toggle the status bar gap.
  -- TODO: update this binding with avoidStruts, ((modMask, xK_b),

  -- Quit xmonad.
  , ((modMask .|. shiftMask, xK_q),
     io (exitWith ExitSuccess))

  -- Restart xmonad.
  , ((modMask, xK_q),
     restart "xmonad" True)
  ]
  ++

  -- mod-[1..9], Switch to workspace N
  -- mod-shift-[1..9], Move client to workspace N
  [((m .|. modMask, k), windows $ f i)
      | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
      , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
  ++

  -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
  -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
  [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
      | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
      , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]


------------------------------------------------------------------------
-- Mouse bindings
--
-- Focus rules
-- True if your focus should follow your mouse cursor.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True

myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
  [
    -- mod-button1, Set the window to floating mode and move by dragging
    ((modMask, button1),
     (\w -> focus w >> mouseMoveWindow w))

    -- mod-button2, Raise the window to the top of the stack
    , ((modMask, button2),
       (\w -> focus w >> windows W.swapMaster))

    -- mod-button3, Set the window to floating mode and resize by dragging
    , ((modMask, button3),
       (\w -> focus w >> mouseResizeWindow w))

    -- you may also bind events to the mouse scroll wheel (button4 and button5)
  ]


------------------------------------------------------------------------
-- Status bars and logging
-- Perform an arbitrary action on each internal state change or X event.
-- See the 'DynamicLog' extension for examples.
--
-- To emulate dwm's status bar
--
-- > logHook = dynamicLogDzen
--


------------------------------------------------------------------------
-- Startup hook
-- Perform an arbitrary action each time xmonad starts or is restarted
-- with mod-q.  Used by, e.g., XMonad.Layout.PerWorkspace to initialize
-- per-workspace layout choices.
--
-- By default, do nothing.
myStartupHook = return ()


------------------------------------------------------------------------
-- Run xmonad with all the defaults we set up.
--
main = do
  xmproc <- spawnPipe "xmobar ~/.xmonad/xmobar.hs"
  xmonad $ defaults {
      logHook = dynamicLogWithPP $ xmobarPP {
            ppOutput = hPutStrLn xmproc
          , ppTitle = xmobarColor xmobarTitleColor "" . shorten 100
          , ppCurrent = xmobarColor xmobarCurrentWorkspaceColor ""
          , ppSep = "   "
      }
      , manageHook = manageDocks <+> myManageHook
      , startupHook = setWMName "LG3D"
  }


------------------------------------------------------------------------
-- Combine it all together
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
--
-- No need to modify this.
--
defaults = defaultConfig {
    -- simple stuff
    terminal           = myTerminal,
    focusFollowsMouse  = myFocusFollowsMouse,
    borderWidth        = myBorderWidth,
    modMask            = myModMask,
    workspaces         = myWorkspaces,
    normalBorderColor  = myNormalBorderColor,
    focusedBorderColor = myFocusedBorderColor,

    -- key bindings
    keys               = myKeys,
    mouseBindings      = myMouseBindings,

    -- hooks, layouts
    layoutHook         = smartBorders $ myLayout,
    manageHook         = myManageHook,
    startupHook        = myStartupHook
}

and here's my .Xdefaults

emacs.Background: DarkSlateGray
emacs.Foreground: Wheat
emacs.pointerColor: Orchid
emacs.cursorColor: Orchid
emacs.bitmapIcon: on
emacs.font: fixed
emacs.geometry: 80x25

URxvt.geometry: 240x84
URxvt.Foreground: Green
!meh, esta bien!
!URxvt.color2: #cccc00000000
!URxvt.color3: #4e4e9a9a0606
!URxvt.color4: #c4c4a0a00000
!URxvt.color5: #34346565a4a4
!URxvt.color6: #757550507b7b
!URxvt.color7: #060698989a9a
!URxvt.color8: #d3d3d7d7cfcf
!URxvt.color9: #555557575353
!URxvt.color10: #efef29292929
!URxvt.color11: #8a8ae2e23434
!URxvt.color12: #fcfce9e94f4f
!URxvt.color13: #72729f9fcfcf
!URxvt.color14: #adad7f7fa8a8
!URxvt.color15: #3434e2e2e2e2
!URxvt.color16: #d4a4d4a4d4a4
URxvt.background: #1ef81ef81ef8

URxvt*cursorColor: #DCDCCC
URxvt*cursorColor2: #3F3F3F
URxvt*colorUL: #8CD0D3
URxvt*underlineColor: #F0DFAF
URxvt*colorBD: #E0CF9F
URxvt*colorIT: #656555

!! black dark/light
URxvt.color0: #3F3F3F
URxvt.color8: #5F5F5F
!! red dark/light
URxvt.color1: #BC8383
URxvt.color9: #CC9393
!! green dark/light
URxvt.color2: #5F7F5F
URxvt.color10: #7F9F7F
!! yellow dark/light
URxvt.color3: #E0CF9F
URxvt.color11: #F0DFAF
!! blue dark/light
URxvt.color4: #7CB8BB
URxvt.color12: #8CD0D3
!! magenta dark/light
URxvt.color5: #DC8CC3
URxvt.color13: #DC8CC3
!! cyan dark/light
URxvt.color6: #93E0E3
URxvt.color14: #93E0E3
!! white dark/light
URxvt.color7: #DCDCCC
URxvt.color15: #FFFFFF

Xmessage.font: -*-terminus-medium-r-*-*-14-*-*-*-*-*-iso10646-1
Xmessage.background: red
Xmessage.foreground: yellow
Xmessage.form.*.shapeStyle: rectangle
Xmessage.Scrollbar.width: 1
Xmessage.Scrollbar.borderWidth: 0
Xmessage.Buttons: OK
Xmessage.defaultButton: OK

URxvt.loginShell: true
URxvt.scrollColor: #777777
URxvt.scrollstyle: plain
URxvt.scrollTtyKeypress: true
URxvt.scrollTtyOutput: false
URxvt.scrollWithBuffer: false
URxvt.secondaryScreen: true
URxvt.secondaryScroll: true
URxvt.skipScroll: true
URxvt.scrollBar: true
URxvt.scrollBar_right: true
URxvt.scrollBar_floating: true
URxvt.fading: 30
URxvt.utmpInhibit: false
URxvt.urgentOnBell: false
URxvt.visualBell: true
URxvt.mapAlert: true
URxvt.mouseWheelScrollPage: true
!URxvt.background: Black
URxvt.foreground: Green
URxvt.colorUL: yellow
URxvt.underlineColor: yellow
URxvt.saveLines: 0
URxvt.buffered: true
URxvt.hold: false
URxvt.internalBorder:
URxvt.print-pipe: cat > $HOME/$(echo urxvt.dump.$(date +'%Y%M%d%H%m%S'))
URxvt.termName: screen-256color

!-- Xft settings -- !
Xft.dpi:        96
Xft.antialias:  true
Xft.rgba:       rgb
Xft.hinting:    true
Xft.hintstyle: hintfull
Xft.autohint: 0
Xft.lcdfilter: lcddefault

! -- Fonts -- !
URxvt.font:xft:droid sans mono slashed:medium:pixelsize=11
URxvt.boldFont:xft:droid sans mono slashed:medium:pixelsize=11

Urxvt.perl-ext-common: default,matcher, -option-popup, -selection-popup,-realine
URxvt.matcher.button: 1
URxvt.urlLauncher: google-chrome-stable


! --Dec/Incr-- !
URxvt.keysym.C-equal : perl:font-size:increase
URxvt.keysym.C-minus : perl:font-size:decrease

i also have installed razer plugin to enable macros and fn key

----------------------------------UPDATE-----------------------------------------

i've just discovered (and i don't know why in htop i can Fx but in other kind of enviroments (like alsamixer) i can't

sorry for my english sad

Last edited by coyote3007 (2015-04-11 07:58:47)

Offline

#2 2015-04-10 16:09:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] F1 to F12 not working

Are you using tmux?

Offline

#3 2015-04-10 16:31:16

coyote3007
Member
Registered: 2015-03-26
Posts: 19

Re: [SOLVED] F1 to F12 not working

karol wrote:

Are you using tmux?

no, here's all my packages

alsa-oss 1.0.28-1
alsa-utils 1.0.29-1
amarok 2.8.0-5
arandr 0.1.7.1-3
asoundconf 1:1.1-1
autoconf 2.69-2
automake 1.15-1
bash 4.3.033-1
binutils 2.25-2
bison 3.0.4-1
bzip2 1.0.6-5
cabal-install 1.22.2.0-1
chromium 41.0.2272.118-2
chromium-pepper-flash 1:17.0.0.134-2
coreutils 8.23-1
cryptsetup 1.6.6-1
device-mapper 2.02.116-1
dhcpcd 6.8.1-1
diffutils 3.3-2
dmenu 4.5.13.5ed5e90-1
dropbox 3.2.9-2
e2fsprogs 1.42.12-2
emacs 24.4-2
fakeroot 1.20.2-1
file 5.22-1
filesystem 2015.02-1
findutils 4.4.2-6
firefox 37.0.1-2
firefox-flashgot 1.5.6.10-1
flashplugin 11.2.202.451-1
flex 2.5.39-1
fortune-mod 1.99.1-6
galculator 2.1.3-3
gawk 4.1.1-1
gcc 4.9.2-4
gcc-libs 4.9.2-4
gettext 0.19.4-1
ghc 7.10.1-1
git 2.3.5-1
glibc 2.21-2
grep 2.21-2
groff 1.22.3-3
grub 1:2.02.beta2-5
gst-libav 1.4.5-1
gst-plugins-good 1.4.5-1
gstreamer0.10 0.10.36-4
gstreamer0.10-bad-plugins 0.10.23-8
gstreamer0.10-base-plugins 0.10.36-3
gstreamer0.10-ffmpeg 0.10.13-2
gstreamer0.10-good-plugins 0.10.31-6
gstreamer0.10-ugly-plugins 0.10.19-14
gzip 1.6-1
htop 1.0.3-2
inetutils 1.9.2-2
iproute2 3.19.0-1
iputils 20121221-3
jdk7-openjdk 7.u75_2.5.4-1
jfsutils 1.1.15-4
less 471-1
lib32-libpulse 6.0-1
libtool 2.4.6-1
licenses 20140629-1
linux 3.19.3-3
logrotate 3.8.9-1
lshw B.02.17-1
lvm2 2.02.116-1
m4 1.4.17-1
make 4.1-1
man-db 2.7.1-1
man-pages 3.82-1
mdadm 3.3.2-1
msmtp 1.6.1-1
mutt-sidebar 1.5.23-10
nano 2.4.0-1
netctl 1.10-1
ntfs-3g 2014.2.15-1
os-prober 1.64-1
ossp 1.3.2-15
pacgraph 20110629-3
pacman 4.2.1-1
paprefs 0.9.10-3
patch 2.7.5-1
pavucontrol 3.0-1
pciutils 3.3.0-1
pcmciautils 018-7
perl 5.20.2-1
pkg-config 0.28-2
popcorntime 0.3.7.2-1
postgresql 9.4.1-1
procps-ng 3.3.10-2
psmisc 22.21-2
pulseaudio 6.0-1
pulseaudio-alsa 2-3
razer-blackwidow-macro-scripts 2-1
reiserfsprogs 3.6.24-1
ruby 2.2.1-1
rxvt 2.7.10-7
rxvt-unicode 9.21-1
s-nail 14.7.11-1
scrot 0.8.13-1
sed 4.2.2-3
shadow 4.2.1-3
skype 4.3.0.37-3
stalonetray 0.8.3-1
subversion 1.8.13-1
sudo 1.8.13-1
sysfsutils 2.1.0-9
systemd-sysvcompat 218-2
tar 1.28-1
telegram-bin 0.8.0-1
texinfo 5.2-3
trayer 1.0-8
unzip 6.0-10
urlview 0.9-10
urxvt-font-size-git 18-1
usbutils 008-1
util-linux 2.26.1-3
vi 1:050325-4
vlc 2.2.0-2
wget 1.16.3-1
which 2.21-1
xf86-input-evdev 2.9.2-1
xf86-input-joystick 1.6.2-5
xf86-input-keyboard 1.8.0-3
xf86-input-libinput 0.8.0-2
xf86-input-mouse 1.9.1-1
xf86-input-synaptics 1.8.2-2
xf86-input-vmmouse 13.0.0-5
xf86-input-void 1.4.0-7
xf86-video-ark 0.7.5-6
xf86-video-ati 1:7.5.0-2
xf86-video-dummy 0.3.7-4
xf86-video-fbdev 0.4.4-4
xf86-video-glint 1.2.8-6
xf86-video-i128 1.3.6-6
xf86-video-intel 2.99.917-4
xf86-video-mach64 6.9.4-5
xf86-video-neomagic 1.2.8-4
xf86-video-nouveau 1.0.11-3
xf86-video-nv 2.1.20-6
xf86-video-openchrome 0.3.3-5
xf86-video-r128 6.9.2-5
xf86-video-savage 2.3.7-4
xf86-video-siliconmotion 1.7.7-6
xf86-video-sis 0.10.7-7
xf86-video-tdfx 1.4.5-6
xf86-video-trident 1.3.7-1
xf86-video-vesa 2.3.2-6
xf86-video-vmware 13.1.0-2
xf86-video-voodoo 1.2.5-6
xfsprogs 3.2.2-1
xmobar 0.23-2
xmonad 0.11.1-2
xmonad-contrib 0.11.4-2
xorg-bdftopcf 1.0.5-1
xorg-docs 1.7-2
xorg-font-util 1.3.1-1
xorg-fonts-100dpi 1.0.3-2
xorg-fonts-75dpi 1.0.3-2
xorg-fonts-encodings 1.0.4-4
xorg-iceauth 1.0.7-1
xorg-luit 1.1.1-2
xorg-mkfontdir 1.0.7-2
xorg-mkfontscale 1.1.2-1
xorg-server 1.17.1-4
xorg-server-utils 7.6-4
xorg-sessreg 1.1.0-1
xorg-setxkbmap 1.3.0-2
xorg-smproxy 1.0.5-2
xorg-utils 7.6-9
xorg-x11perf 1.5.4-2
xorg-xauth 1.0.9-1
xorg-xbacklight 1.2.1-1
xorg-xclock 1.0.7-1
xorg-xcmsdb 1.0.4-2
xorg-xcursorgen 1.0.6-1
xorg-xdpyinfo 1.3.1-1
xorg-xdriinfo 1.0.4-4
xorg-xev 1.2.1-2
xorg-xgamma 1.0.5-2
xorg-xhost 1.0.6-1
xorg-xinit 1.3.4-2
xorg-xinput 1.6.1-1
xorg-xkbcomp 1.3.0-1
xorg-xkbevd 1.1.3-2
xorg-xkbutils 1.0.4-2
xorg-xkill 1.0.4-1
xorg-xlsatoms 1.1.1-2
xorg-xlsclients 1.1.3-1
xorg-xmodmap 1.0.8-1
xorg-xpr 1.0.4-2
xorg-xprop 1.2.2-1
xorg-xrandr 1.4.3-1
xorg-xrdb 1.1.0-1
xorg-xrefresh 1.0.5-1
xorg-xset 1.2.3-1
xorg-xsetroot 1.1.1-2
xorg-xvinfo 1.1.2-2
xorg-xwd 1.0.6-1
xorg-xwininfo 1.1.3-1
xorg-xwud 1.0.4-2
xterm 317-1
yaourt 1.5-1
zsh 5.0.7-1
zsh-completions 0.12.0-1

Offline

#4 2015-04-10 23:34:19

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] F1 to F12 not working

You can run a quick check to determine if your urxvt configurations are the cause of your problems. Start a new urxvt instance with the command:

$ urxvt -name default    # any string following '-name' will work

Then try alsamixer and see if your Fn keys work.

The only thing that immediately catches my attention in your X resources is that you set termName to screen-256color. Why? 

Incorrectly setting termName, or $TERM, might be the cause of your problems. If you want to set $TERM for GNU screen, you should use a ~/.screenrc file.

Offline

#5 2015-04-11 07:57:52

coyote3007
Member
Registered: 2015-03-26
Posts: 19

Re: [SOLVED] F1 to F12 not working

thisoldman wrote:

You can run a quick check to determine if your urxvt configurations are the cause of your problems. Start a new urxvt instance with the command:

$ urxvt -name default    # any string following '-name' will work

Then try alsamixer and see if your Fn keys work.

The only thing that immediately catches my attention in your X resources is that you set termName to screen-256color. Why? 

Incorrectly setting termName, or $TERM, might be the cause of your problems. If you want to set $TERM for GNU screen, you should use a ~/.screenrc file.

wow ty man i solverd it thanks to your info. It was a problem about termName, it should be rxvt-unicode-256color instead of  screen-256color. I have that in urxvt cause i have no screenrc file.

Offline

Board footer

Powered by FluxBB