Open thealio opened 4 months ago
What are you having trouble with?
I'd like to note that this belongs in xmonad-contrib, not core.
The lower level mechanisms in EZKeys
could be used to make a function that would let you use additionalKeysP
-style bindings with Prompt
. The higher level ones (additionalKeys
and friends) won't work because they require and produce an XConfig
, plus they expect the actions to be X ()
, not XP ()
.
addName
isn't even meaningful here. Why do you want it?
Similarly, mouse bindings are not key bindings and so it's not useful to define mouse bindings in additionalKeysP
style.
Hi, and thank you for your answer
I'd like to note that this belongs in xmonad-contrib, not core.
The lower level mechanisms in
EZKeys
could be used to make a function that would let you useadditionalKeysP
-style bindings withPrompt
. The higher level ones (additionalKeys
and friends) won't work because they require and produce anXConfig
, plus they expect the actions to beX ()
, notXP ()
.
addName
isn't even meaningful here. Why do you want it?Similarly, mouse bindings are not key bindings and so it's not useful to define mouse bindings in
additionalKeysP
style.
The addName is used in a custom function that pipes the keybindings into rofi for have a list of keybindings
-- Show Keybindings
showKeybindings :: [((KeyMask, KeySym), NamedAction)] -> NamedAction
showKeybindings x = addName "Show Keybindings" $ io $ do
h <- spawnPipe $ myMenu
-- hPutStr h (unlines $ showKm x) -- showKM adds ">>" before subtitles
hPutStr h (unlines $ showKmSimple x) -- showKmSimple doesn't add ">>" to subtitles
hClose h
return ()
where
myMenu = "rofi -dmenu -i -matching fuzzy -p 'Xmonad keys'"
-- Keybind for showing the keybinds list
myMenuKey = addDescrKeys' ((mod4Mask, xK_F1), showKeybindings)
myWorkspaces = myNamedWS
-- Main section
main :: IO ()
main = do
dbus <- D.connectSession -- dbus is required for polybar
-- Request access to the DBus name
D.requestName dbus (D.busName_ "org.xmonad.Log")
[D.nameAllowReplacement, D.nameReplaceExisting, D.nameDoNotQueue]
xmonad $ ewmh $ docks $ addDescrKeys' ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmhFullscreen $ pagerHints $ myDefaults
-- $ pagerHints is required for print the current layout in xmonad ( xprop -root _XMONAD_CURRENT_LAYOUT | awk '{print $NF}' | tr -d "\"" )
-- Start polybar
myBarHook = do
spawn "polybar --config=~/.config/polybar/config.ini mainbar-xmonad" -- Start polybar
I wanna also pipe mouse bindings and prompt bindings in the keybind list
Hi I have these keybindis, that work OK with standard keybinds
Now I'd like to write them using the XMonad.Util.EZConfig module keys and also wit addName , I tried many times , but unsuccesfully .
I wanna ask if this is technically possible, and how to do that. If it's not, I wanna made a feature request.
I have these lines for normal keys
xmonad $ ewmh $ docks $ addDescrKeys' ((mod4Mask, xK_F1), showKeybindings) myKeys $ ewmhFullscreen $ pagerHints $ myDefaults
I'm using distrotube config as a code source : https://gitlab.com/dwt1/dotfiles/-/blob/master/.config/xmonad/xmonad.hs