Axarva / dotfiles-2.0

XMonad™️. Widgets go brr.
MIT License
1.72k stars 156 forks source link

Feature Suggestion - #xmonad #cycleAction #optimization #165

Open sgtrusty opened 1 year ago

sgtrusty commented 1 year ago

Describe the feature I would like to recommend only one key for opening eww related widgets, as opposed to using two with a modifier which is a little bit user unfriendly. At least in my opinion, due to carpal tunnel complications that may develop from using key chords too often. My suggestion is the following:

To Reproduce In order to open the center menu, the following action must be peformed: Mod, xK_p have to be pressed. It will then open the center menu.

Expected behavior Instead of having an alternative key Mod .|. shiftMask, xK_p to unopen--err, close it-- use the same key combination as earlier by using cycleAction:

import XMonad.Util.ActionCycle
--
-- ... your code ...
--
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
    [ 
-- ...
    , ((modm,               xK_p     ), cycleAction "centerlaunch" [centerlaunch, ewwclose])

Relevant code: https://github.com/Axarva/dotfiles-2.0/blob/main/xmonad/xmonad.hs#L112-L117

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

sgtrusty commented 1 year ago

Also, great job on the project! I have seen other sources using similar eww widgets, but i modified them a little to adjust to my own needs: image

Using this as an opportunity to plug in my rice, lol.

Axarva commented 1 year ago

This is actually a great suggestion. Also, nice rice! I'll integrate this into the code as soon as I can.

sgtrusty commented 1 year ago

@Axarva if you want I can do it an open a PR for it really quick, you'd just have to pull the changes and QA if you wanna. That way I can be one of the contributers or at least go down in history with some git blame x)

Oh, also: I forgot to mention, I initally began using xmonad and learning Haskell from i3wm after I saw this rice! So thank you for the inspiration as well!