Hacking On Xmonad - ManageHooks, Prompts and Hoogle

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ม.ค. 2025

ความคิดเห็น • 56

  • @jotix2570
    @jotix2570 4 ปีที่แล้ว +14

    Hi DT. Great work, just one little note, is not necesary xdotool for doShift anymore, only the worspace name. Example: .... className =? "Lutris" --> doShift "9" .... does the work.

    • @DistroTube
      @DistroTube  4 ปีที่แล้ว +8

      Yea, I didn't explain that well in the video. xdotool is required for my config (and anyone who happens to use it) due to the "clickable" workspaces I use in my xmobar. So workspace 9 for me is technically "workspace name".

    • @jotix2570
      @jotix2570 4 ปีที่แล้ว +4

      @@DistroTube ok, I see thank you for the aclaration. Love your work. Greetings from Argentina

    • @Al-gc9ul
      @Al-gc9ul 4 ปีที่แล้ว +1

      ​@@DistroTube That sounds a little bit hack-ish though, and perhaps an indication that XMobar is not the bar for your setup. Would you consider a different bar setup? You are already using the XMonad DesktopConfig so any decent bar should integrate pretty much automatically. I know from past videos that you have a preference to stick with the bar that comes with the WM but technically, XMonad doesn't come with a bar. I tend to prefer Polybar myself because it integrates with most of my WMs and it allows me to use semi-consistent styling across multiple WMs easily, but if you prefer to stay in Haskell, TaffyBar seems like a good alternative and imo not less a part of XMonad then XMobar (hackage.haskell.org/package/taffybar-0.4.6/docs/System-Taffybar-WorkspaceSwitcher.html). Nice video btw! I'm also evaluating XMonad as my next WM and your videos, as always, have been extremely helpful!

    • @chonkov
      @chonkov 4 ปีที่แล้ว

      You should probably use in that case doShift (myWorkspaces !! 0), where 0 is the workspace index (0-based)

  • @kianostad5064
    @kianostad5064 3 ปีที่แล้ว

    Hey man, you’re the only linux user who is not programmer that i know and the same time one the most knowledgeable ones.
    👏

  • @griof
    @griof 4 ปีที่แล้ว +3

    In case you wonder. When you find something like Maybe Int, you need to either write Nothing or Just integer. The reason is that Haskell doesn't have a Null / None value because the type system is very fancy and force you to tag values with the word Just when there exists the chance on none existing values

    • @griof
      @griof 4 ปีที่แล้ว +1

      @@fossegrim287 oversimplification is a generous term hahaha. Sum types might be a little of a headache if your main language doesn't use/support them in regular bases.

  • @kriketedwards6347
    @kriketedwards6347 4 ปีที่แล้ว +1

    I'm living in xmonad for the first time (been using tiling WM's since ion 3)... about a week and a half in. I love it! Having a lot of fun with haskell. Especially when I'm stuck on something for a while and finally recompile without getting an xmessage!

    • @DistroTube
      @DistroTube  4 ปีที่แล้ว +1

      That is awesome!

    • @kriketedwards6347
      @kriketedwards6347 4 ปีที่แล้ว +1

      Once you get the hang of the syntax, haskell is actually pretty straightforward. I just look at the the source for the module I'm trying to use and you see everything you can do with it.

  • @driden1987
    @driden1987 4 ปีที่แล้ว +2

    I’m running gnome on my work laptop. I love Haskell, I probably will install this on the weekend.

  • @johntr7565
    @johntr7565 4 ปีที่แล้ว +2

    This channel is gold

  • @NapoleonWils0n
    @NapoleonWils0n 4 ปีที่แล้ว +2

    the xmonad prompt shows you commands like view to switch workspace, and next and previous layouts and switching screens
    rather than trying to replicate dmenu or rofi as application launcher ( fyi rofi can start ssh sessions)
    what interests me is using the prompt instead of keyboard shortcuts to switch layouts, toggle struts etc
    eg: create a custom list of xmonad actions from your config like the different layouts, and the options you have mapped to keys
    then when you run the xmonad prompt you could type full to switch to full screen layout or grid, toggle struts
    there is a section on the xmonad prompt page that lets you create a prompt with a custom command list, that might work
    hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Prompt-XMonad.html
    going to have a play around with the xmonad prompt and see what possible
    import XMonad.Prompt.XMonad
    i keep dmenu menu bound to super + p
    then set the xmonad prompt to shift + super + p
    , ("S-M-p", xmonadPrompt def)

    • @DistroTube
      @DistroTube  4 ปีที่แล้ว

      I also found Xmonad.Prompt.Pass for a pass menu. It's three prompts actually...one for copying your passwords to your clipboard, one for generating new passwords, and one for removing passwords.

  • @SenthilBabuji
    @SenthilBabuji 4 ปีที่แล้ว +6

    Finally DT pushed me into Xmonad and I thank him for that. Bspwm, bye bye!

  • @auroradraco9974
    @auroradraco9974 4 ปีที่แล้ว +1

    Have been using i3 for a while now becuase its easily configurable but it seems that haskell has such good documentation that this might actually be worth a try. I may tinker with it this weekend

  • @544512
    @544512 4 ปีที่แล้ว

    thank you very much for the job you did. keep doing stuff like that. many greetings form RU fans

  • @agostonvolcz
    @agostonvolcz 4 ปีที่แล้ว

    Hi DT. In a former video, you mentioned that you have Xmobar on all monitors, and I wanted to do just that on my system (laptop with external monitor), but it only shows on the "output" set as primary, and when I run xrandr, it shows that I have "Screen 0" with both displays in it.So how did you set your Xorg to treat each output as a screen?

  • @aoeuplphe7166
    @aoeuplphe7166 4 ปีที่แล้ว

    Why use renamed to rename the layouts? I've seen this in a few people's configs and I can't figure out what actually changes in day to day use from renaming the layouts.

  • @vedantmatanhelia1016
    @vedantmatanhelia1016 2 ปีที่แล้ว

    Hi DT. You have a great config. I have something I would like to add tho: the clickable option that you have can be achived using XMonad.Util.ClickableWorkspaces

  • @AceOfSpadez79
    @AceOfSpadez79 4 ปีที่แล้ว

    For Openbox, do you think Ulauncher or dmenu would be better? Also what panels work well with Openbox? Could Google it but not many people have used so many wm's so I thought I'd ask your opinion.

  • @SherubThakur
    @SherubThakur 4 ปีที่แล้ว

    I never thought that I would someday hear someone say "Haskell documentation is fantastic" ever in my life! I just play around with Haskell sometimes (not a full-time Haskell dev) and I think it has really crap documentation. I love this language though, but it sure as hell is not for documentation. I think XMonad might just be an exception.

  • @Joy_jester
    @Joy_jester 4 ปีที่แล้ว

    Hey,what's the theme ? It looks great

  • @AnzanHoshinRoshi
    @AnzanHoshinRoshi 4 ปีที่แล้ว +2

    Thank you, Derek.

  • @gireeshmarathi2796
    @gireeshmarathi2796 4 ปีที่แล้ว

    Hey DT can you make a video on xkb. Can't use xmodmap on swaywm and this xkb is so overwhelming

  • @alexandremarangonicosta
    @alexandremarangonicosta 4 ปีที่แล้ว +2

    Used i3 for 7 years. Tried DWM and xmonad because of you. Never going back again....Question: can you use arrow keys inside alacritty with vim?

  • @Arkayaplays
    @Arkayaplays 4 ปีที่แล้ว +3

    I am 84th viewer and 9th like and i hate certainly fact of that so less like to view ratio pls do like the video guys

  • @thesolutionstore1
    @thesolutionstore1 4 ปีที่แล้ว

    I mispelt google and found hoogle 😂 what is it used for

  • @NapoleonWils0n
    @NapoleonWils0n 4 ปีที่แล้ว

    hi dt - rofi can have icons next to applications in the launcher, it looks the bomb
    when i type the name of application it auto switches the workspace with it on, and i have ssh working as well
    i think rofi has an advantage over dmenu because it just shows you the actually applications instead of all the binarys on your system
    several times with demu i have launched afire when i meant to launch firefox and wondered why cpu was thru the roof
    will do a video later about rofi and showing icons in the menu, unless you get there first
    rofi has a new config syntax which is on the arch wiki
    wiki.archlinux.org/index.php/Rofi
    ~/.config/rofi/rofi.rasi
    configuration {
    modi: "window,drun,ssh,combi";
    theme: "solarized";
    font: "Inconsolata 14";
    show-icons: true;
    combi-modi: "window,drun,ssh";
    }
    xmonad.hs
    , ("M-p", spawn "rofi -show combi -modi combi")

  • @ertwro
    @ertwro 4 ปีที่แล้ว

    I tried Xmonad and unregistered Haskell modules is an absolute hellish nightmare.

    • @lokegustafsson247
      @lokegustafsson247 4 ปีที่แล้ว +1

      J.P. Silva i use stack to compile xmonad. It solves all dependency issues

    • @ertwro
      @ertwro 4 ปีที่แล้ว

      @@lokegustafsson247 I was just using the AUR in Arch to install pandoc and shellcheck that were my other haskell programs. But a Recent update just destroyed them and I tracked back the problem to some modules that no longer exist from Xmonad in my computer and now I always get a warning that some haskell modules can't be unregistered or registered.

    • @lokegustafsson247
      @lokegustafsson247 4 ปีที่แล้ว

      J.P. Silva haskell package management is sadly horrible, which is why stack exists.
      brianbuccola.com/how-to-install-xmonad-and-xmobar-via-stack/
      You should install pandoc and shellcheck similarly, compiled in their own sandbox. I actually dont even have ghc globally installed. To save some disk space you might want to look at the haskell arch wiki page, under stack configuration.

    • @ertwro
      @ertwro 4 ปีที่แล้ว

      @@lokegustafsson247 I have stack. The first thing I did was read the wiki. The updates with pacman still show the "Unable to unregister modules" while updating sometimes it even refuses to update. Using Haskell Is almost as bad as using Windows, to be honest.

    • @lokegustafsson247
      @lokegustafsson247 4 ปีที่แล้ว

      J.P. Silva You say you have stack, but encounter problems when updating with pacman. My point is that haskell breaks when linking dynamically and reusing dependencies, and so you should build in stack sandboxes. You should not have any haskell packages installed with pacman and pacman should not update any of your haskell stuff. From what you write you appear to not be building in a stack sandbox.

  • @michaeldina1103
    @michaeldina1103 4 ปีที่แล้ว +1

    Xmonad is pretty cool.

  • @lainproliant
    @lainproliant 4 ปีที่แล้ว +1

    XMonad is beautiful. I've been using it for 12 years. I've tried i3, qtile, and a few others, but I always end up coming back to XMonad.

  • @NapoleonWils0n
    @NapoleonWils0n 4 ปีที่แล้ว

    Hi DT, i have got Firefox Picture in Picture working as a floating window in xmonad
    th-cam.com/video/zOPCuzVs6bY/w-d-xo.html
    here's the code for myManageHook
    , className =? "Firefox" resource =? "Toolkit" --> doFloat -- firefox pip
    i have dwm style tagging setup so i can tag the pip video across mulitple workspaces, v cool
    also set mpv to float in the center of the screen which means i can go full screen without toggling struts
    import Data.Ratio ((%)) -- for video
    import XMonad.Hooks.ManageHelpers (isFullscreen, isDialog, doFullFloat, doCenterFloat, doRectFloat)
    myManageHook
    className =? "mpv" --> doRectFloat (W.RationalRect (1 % 4) (1 % 4) (1 % 2) (1 % 2))
    feel free to steal the code i have stolen enough of yours
    github.com/NapoleonWils0n/freebsd-dotfiles/blob/master/.xmonad/xmonad.hs
    obs studio gives me a black screen with xcomposite
    even though i have import XMonad.Hooks.EwmhDesktops and xmonad $ ewmh desktopConfig in my config
    is there anything else needed to get obs working
    keep up the good work

  • @xtnctr
    @xtnctr 4 ปีที่แล้ว +1

    Best hack ever

  • @AliensInc.
    @AliensInc. 4 ปีที่แล้ว +1

    that's extreme :)

  • @jeetadityachatterjee6995
    @jeetadityachatterjee6995 4 ปีที่แล้ว +3

    No don't make me do it! I don't want to go down another rabbit hole! I already have Emacs and tmux to configure ahhhhhhhhhh

    • @RP-kr2mg
      @RP-kr2mg 4 ปีที่แล้ว

      Do you really implement upon these vids or are joking lol. Stay happy in Plasma, Eclipse and Visual Studio :)

    • @auroradraco9974
      @auroradraco9974 4 ปีที่แล้ว

      Lol, no reason to use tmux if you use a tiling wm though

    • @mrkhoi3
      @mrkhoi3 4 ปีที่แล้ว +1

      @@auroradraco9974 I use it for the copy-mode and the plugins like tmux-fingers, tmux-jump, etc. For example, you could config tmux and tmux-fingers to allow you to select and open links in web browser, open file path with compilation errors at certain lines and columns in your favorite code editor.
      It also get tedious to manage the way too many windows. For example, if you are dealing with 2 server clusters with around 10 nodes each, you probably want to manage 2 tmux sessions instead of 20 windows. Yes I know it is still manageable, I do know and use i3 focus parent and tabbed containers, but I find it taxing on my brain to carefully not messing up the windows config and found it painful every time I forget to correctly focus parent/ child container before moving/switching focus...

    • @jeetadityachatterjee6995
      @jeetadityachatterjee6995 4 ปีที่แล้ว

      @@RP-kr2mg I implement on things that interest me and xmonad is very interesting. Plus i I used vscode and it was meh and I am a gnome man

    • @jeetadityachatterjee6995
      @jeetadityachatterjee6995 4 ปีที่แล้ว

      @@auroradraco9974 I don't

  • @Yakushii
    @Yakushii 4 ปีที่แล้ว +3

    Dmenu REPLACEMENT?! What sort of heathen are you?

    • @DistroTube
      @DistroTube  4 ปีที่แล้ว +5

      Haskell masterrace! :D

  • @usrname1105
    @usrname1105 4 ปีที่แล้ว +1

    FiRsT

    • @DistroTube
      @DistroTube  4 ปีที่แล้ว

      CoNfIrMeD

    • @Arkayaplays
      @Arkayaplays 4 ปีที่แล้ว

      @@DistroTube you write it like Con , fir and MeD hmm nice way to say three words in one