/r/xmonad

Photograph via snooOG

/r/xmonad

5,255 Subscribers

3

Floating window scratchpad toggle (migrating from i3)

Hi! I just started trying to get the hang of xmonad today; What I'm trying to do is get my browser chromium-browser to appear and disappear.

I had my i3 setup to have 9 terminals that opened automatically on 3 workspaces, and open a browser in the background.

I'd then use for_window to make it float, and bindsym to send it to the scratchpad.

Like a reverse popup terminal, basically. 🤭

It was pretty easy to do, but I'm struggling here.

I was already pretty familiar with Haskell if that helps. 😅

Also, I'm looking to remap every single default key binding as I do with every window manager and I'm having trouble finding the right docs.

Any help would be much appreciated- Ty!! 💕

7 Comments
2024/11/06
01:24 UTC

2

Strange issue, where applications crash when launched from Xmonad

Hey I have a strange issue, was wondering if anyone had any ideas on how to resolve it.

When I launch my terminal (st) from Xmonad with hotkeys (alt+shift+enter) the terminal sometimes crashes when opening certain applications (nvim / ncmpcpp).

What is strange is if I launch a terminal from Xmonad, then in that terminal launch another instance of the exact same terminal, it works just fine.

I've noticed other applications (and even Xmonad itself) crashing on occasion too, so I really need to figure out what is going on here. Running Arch, and my XMonad config is here: https://github.com/bag-man/dotfiles/blob/master/xmonad/xmonad.hs

What's extra odd is I've used this XMonad setup for maybe a decade at this point, and haven't ran into this issue before, though this instance is setup on a new laptop, so there is some change there.

Thanks for any help / ideas!

9 Comments
2024/10/16
20:13 UTC

2

Why do my windows look like this?

I'm an xmonad user and everytime my system starts, it starts by gnome-keyring prompting me for a password.

Now, the dialog opens and looks normal, and it usually prompts before xmonad has started up. But the moment xmonad does start up, it makes the window look like this.

The dialog starts up normally, the buttons etc. are not overlapping with the input area. But there's something about the way the window is redrawn after xmonad starts up that makes the buttons overlap with the input area.

PS:

  • I cannot take a screenshot normally while this prompt is open: it doesn't let any of xmonad's keybindings work (screenshot etc.).
  • I don't use any DE, just lightdm + xmonad.
  • xmonad version 0.17.2
  • I am using window borders.

Sequence of events:

  1. Lightdm, I input my username and password.
  2. gnome-keyring prompt appears before xmonad starts up. This prompt looks normal: the buttons don't overlap with the text input. This is expected.
  3. xmonad fires up, and the buttons overlap with the text input field (screenshot). The buttons overlapping with the text input is not specific to the gnome-keyring prompt. This seems to be an issue with xmonad, and is unexpected.
2 Comments
2024/10/13
18:36 UTC

6

Show and Tell: Darken empty screens

Some time ago I implemented a feature into my XMonad configuration that I really like, so I thought I'd tell you about it.

If you have multiple monitors and like to keep it dark around you, you probably dislike the bright light the other monitors give when they are not even in use (empty workspaces, that is).

Here's how I fixed that (note that this uses `redshift`, and restore/maintain the current level using a cache file): link to paste.

1 Comment
2024/10/09
17:17 UTC

1

Firefox Persistence Issues with Xmonad

I'm running into a strange issue with Xmonad at work. We use Checkpoint VPN, which involves installing a "Mobile Access Portal Agent" and "SNX" – basically two shell scripts that set up a Firefox extension and the VPN client. You then log in via SSO, and the agent kicks off the SNX VPN.

It's not my favorite setup, but it's what we have currently at work. The problem is, in Xmonad, Firefox seems to "forget" that it already has this extension installed. Every time I log in, I have to re-run the installation script. I've also noticed some other odd behavior, like Slack forgetting my login.

Strangely, this doesn't happen in Plasma. And even if I switch back and forth between Xmonad and Plasma, the same Firefox profile remembers the extension in Plasma but not in Xmonad.

Has anyone else encountered anything like this? Any ideas on what might be causing this or how to troubleshoot it?

Thanks in advance for any help!

1 Comment
2024/09/16
11:11 UTC

5

Building XMonad using cabal

I was wondering what the 'correct' way of building XMonad using cabal was. The way I did it was,

  1. mkdir xmonad (in .config)
  2. cd xmonad
  3. cabal init -> named executable my-xmonad
  4. added xmonad, xmonad-contrib to my-xmonad.cabal's build-depends
  5. cabal configure
  6. cabal build
  7. cabal install

This got me a my-xmonad executable, and running my-xmonad --recompile (using the cabal build script from xmonad-contrib), gave me an xmonad-ARCH file which I put in my .xinitrc So far, so good. But, when I run my-xmonad --restart(using a keybind), nothing happens. Everytime I change something, I need to logout and login again for changes to show up, which is annoying.

5 Comments
2024/09/14
15:08 UTC

2

Xmonad Freezes and I have to reset PC

Hi

I have for some time been trying to find the cause of a freeze, which can only be resolved with a reset.

I am running Xmonad and Xmobar on a pure Arch install. I also have other desktop Tiling Window Manager environments that do not have this problem.

In fact, I have even tried other peripherals to eliminate the problem, such as the keyboard and trackballs but I think I have now narrowed it down.

When I have a browser open on a page and an my PC is polling for an update, which I konw becuae I have an indicator in Xmobar the PC freezes, as does the mouse pointer. After a reboot I run the update and the freeze happens when there is a Haskell update.

I’ve looked at the Arch crash logs, but nothing to even say that there has been a crash by the OS or Kernel. No errors come up during the freeze either.

Now this could be a coincendence but can anyone give an suggestions at this stage which I would appreciate in advance.

3 Comments
2024/09/11
23:50 UTC

2

XMobar is unable of refreshing an element through signals?

I'm trying to make the following:
I have shortcuts to change the volume, if I press one, it will go from x% to either (x+5)% or (x-5)%, and this change is reflected on the status bar.

The problem:
I want this change to be immediate (sending a signal), but it's not; sometimes It feels immediate, others I can notice an obvious delay (as if it's in a loop that refreshes according to a certain interval of time).

  • I tried to use a pipe (Run PipeReader "/tmp/vol_pipe") along with my volume changing command on XMobar configuration, but it didn't work.
  • I tried using the Alsa plugin, but it's the same thing
  • I tried looking for the dbus part in XMobar's documentation, but it's bad documented (and looking at the source code that the documentation points to, it doesn't look like it has what I want).

Is it impossible to do it in XMobar?

2 Comments
2024/08/27
18:10 UTC

1

xmobar visible in fullscreen after restarting xmonad

Hello,

I noticed that after running xmonad --restart so that modifications to my configuration are taken into account, xmobar becomes visible when YouTube videos are in fullscreen (in firefox). I could only revert to the normal behaviour by killing and relogging in.

Is this expected or am I doing something wrong ?

Here's the entire configuration file.

Here's a snippet of the relevant configuration:

xmobarOf :: ScreenId -> IO StatusBarConfig
xmobarOf 0 = pure $ statusBarProp "xmobar -x 0 ~/.config/xmobar/xmobarrc" (pure myPrettyPrinter)
xmobarOf 1 = pure $ statusBarProp "xmobar -x 1 ~/.config/xmobar/xmobarrc" (pure myPrettyPrinter)
xmobarOf _ = mempty

main = xmonad
      . ewmhFullscreen . ewmh
      . dynamicEasySBs xmobarOf
      $ xmonadConfig

Thanks :)

0 Comments
2024/08/07
14:10 UTC

3

Toggle a NamedScratchPad from the script in it

Hello,

TL;DR: Is there a way that I could, in a shell script, invoke xmonad in such a way that it hides a specific scratch pad ?

I recently started scripting a shell script that can fuzzy search a password entry and select it (with the password-store project).

I managed to set up xmonad to have a NamedScratchPad of this script so that I can toggle this script, search away and get my password. The issue is that I mustn't close this NamedScratchPad (otherwise the clipboard will be cleared). I have no issue to keep the scratch pad running, however it would be nice for it to toggle itself away when the password has been copied.

Thank you :)

5 Comments
2024/08/06
20:17 UTC

2

I cannot get xmonad to build in a nix shell (via flake)

I've been looking at switching to xmonad from i3, and have created a small repo with xmonadrc and xmobar as subfolders.

On my system (archlinux) I can cabal install xmonad and it builds just fine.

In my flake, I kept getting dependency issues, until this point and I can't get past it:

~/projects/xmonad/xmonadrc > cabal build                                   (--)(trunk)
Warning: Parsing the index cache failed (Data.Binary.Get.runGet at position
16: Non-matching structured hashes: d81bdd513f41b5d7ee4cd28455adadbe;
expected: f46da61e7afa58a5e8fd1d2b6fb79899). Trying to regenerate the index
cache...
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
 - X11-xft-0.3.4 (lib) (requires build)
 - xmonad-contrib-0.18.0 (lib) (requires build)
 - xmonadrc-0.1.0.0 (lib) (first run)
 - xmonadrc-0.1.0.0 (exe:xmonadrc) (first run)
Starting     X11-xft-0.3.4 (lib)
Building     X11-xft-0.3.4 (lib)

Failed to build X11-xft-0.3.4.
Build log (
/home/gideon/.cabal/logs/ghc-9.8.2/X11-xft-0.3.4-1b25c7f77ecc162263f4b25f121bc46e362d5568bfa986b8ff92d7810efe5cb7.log
):
Configuring library for X11-xft-0.3.4..
Preprocessing library for X11-xft-0.3.4..
running dist/build/Graphics/X11/Xft_hsc_make failed (exit code 127)
rsp file was: "dist/build/Graphics/X11/hsc2hscall3771929-3.rsp"
output file:"dist/build/Graphics/X11/Xft.hs"
command was: dist/build/Graphics/X11/Xft_hsc_make  >dist/build/Graphics/X11/Xft.hs
error: dist/build/Graphics/X11/Xft_hsc_make: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

Error: cabal: Failed to build X11-xft-0.3.4 (which is required by exe:xmonadrc
from xmonadrc-0.1.0.0). See the build log above for details.

My flake does contain a load of libraries as native build inputs (using flake-parts and haskell-flake):

    perSystem = { pkgs, config, ... }: {
      haskellProjects.default = {
        basePackages = pkgs.haskell.packages.ghc982;
        devShell.mkShellArgs = {
          shellHook = config.pre-commit.installationScript;
          nativeBuildInputs = with pkgs; [
            alejandra 
            nil 
            gcc
            xorg.libX11
            xorg.libXext
            xorg.libXinerama
            xorg.libXrandr
            xorg.libXrender
            xorg.libXScrnSaver
            fontconfig
          ];
        };

(These were added to eliminate other dependency issues.)

Has anyone successfully used xmonad this way (outside of NixOS, but just nix flake + xmonad)? If so, would appreciate pointers.

3 Comments
2024/08/06
12:01 UTC

2

Failing to build xmonad on Ubuntu 22.04 with stack

I have stack installed with Ghcup.

I've been following the official building tutorial (https://xmonad.org/INSTALL.html), stack install command fails at xmonad-contrib/XMonad/Util/PureX.hs.

Full logs: https://dpaste.com/DM332ZHAW

Shorter logs:

xmonad-contrib> configure (lib)
xmonad-contrib> Configuring xmonad-contrib-0.17.1...
xmonad-contrib> build (lib) with ghc-9.6.6
xmonad-contrib> Preprocessing library for xmonad-contrib-0.17.1..
xmonad-contrib> Building library for xmonad-contrib-0.17.1..
xmonad-contrib> [ 72 of 308] Compiling XMonad.Hooks.WorkspaceByPos
xmonad-contrib> 
xmonad-contrib> /home/reo/dotfiles/xmonad/xmonad-contrib/XMonad/Hooks/WorkspaceByPos.hs:29:30: error:
xmonad-contrib>     Module ‘Control.Monad.Except’ does not export ‘lift’
xmonad-contrib>    |
xmonad-contrib> 29 | import Control.Monad.Except (lift, runExceptT, throwError)
xmonad-contrib>    |                              ^^^^
xmonad-contrib> [119 of 308] Compiling XMonad.Util.PureX
xmonad-contrib> 
xmonad-contrib> /home/reo/dotfiles/xmonad/xmonad-contrib/XMonad/Util/PureX.hs:153:10: error: [GHC-88464]
xmonad-contrib>     Variable not in scope: void :: X Any -> X ()
xmonad-contrib>     Suggested fix:
xmonad-contrib>       Perhaps you want to add ‘void’ to the import list in the import of
xmonad-contrib>       ‘XMonad.Prelude’ (XMonad/Util/PureX.hs:56:1-54).
xmonad-contrib>     |
xmonad-contrib> 153 | defile = void . windowBracket' getAny
xmonad-contrib>     |          ^^^^
xmonad-contrib> 
xmonad-contrib> /home/reo/dotfiles/xmonad/xmonad-contrib/XMonad/Util/PureX.hs:197:15: error: [GHC-88464]
xmonad-contrib>     Variable not in scope: join :: f0 (m a) -> m a
xmonad-contrib>     Suggested fix:
xmonad-contrib>       Perhaps you want to add ‘join’ to the import list in the import of
xmonad-contrib>       ‘XMonad.Prelude’ (XMonad/Util/PureX.hs:56:1-54).
xmonad-contrib>     |
xmonad-contrib> 197 | withFocii f = join $ (whenJust' <$> peek) <*> (f <$> curTag)
xmonad-contrib>     |               ^^^^

Error: [S-7282]
       Stack failed to execute the build plan.
       
       While executing the build plan, Stack encountered the error:
       
       [S-7011]
       While building package xmonad-contrib-0.17.1 (scroll up to its section to see the error) using:
       /home/reo/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_6HauvNHV_3.10.3.0_ghc-9.6.6 --verbose=1 --builddir=.stack-work/dist/x86_64-linux/ghc-9.6.6 build lib:xmonad-contrib --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1 

Thanks for your help.

3 Comments
2024/08/02
09:19 UTC

1

Why does Firefox pop up on another DynamicProjects workspace?

Sometimes I find that if I launch firefox in a terminal in a DynamicProjects workspace called foo, then it will somehow launch in a workspace called bar. How can this be?

It's not always, so it's a bit hard to troubleshoot. I just wonder if there's like a thing I haven't gotten me head around?;)

I have not extensively troubleshot this, like bisecting my config, etc, cause it might be something trivial.

3 Comments
2024/07/28
20:15 UTC

2

Is XMonad.Layout.NoBorders buggy in chromium-based browsers?

Hi,

I just wanted to know if anyone else has had problems when using some of the functions (e.g. `NoBorders` or `SmartBorders`) from the `XMonad.Layout.NoBorders` library in Chromium-based browser such as Brave. When I scroll/type/watch videos in Fullscreen mode or in the Full layout, the window starts flickering and doing weird stuff. I quickly tried it on Firefox and everything seems to work fine.

In case anybody else has experienced this issue, did you manage to solve it?

2 Comments
2024/07/26
16:42 UTC

2

How can I fuzzy match on raising windows?

This doesn't seem to support fuzzy matching.

   -- , ((modm .|. mod1Mask .|. controlMask, xK_f), raise (title =? "*foobar*"))

Do we have function which supports some kind of wildcards?

4 Comments
2024/07/20
21:28 UTC

1

Xmobar won't work with Alsa module no matter what!

Trying to set up Xmonad with Xmobar, and as soon as I add the Alsa volume module Xmobar will no longer start. This is what I'm trying to add:

Run Alsa "default" "Master"
                             [ "--template", "<volumestatus>"
                             , "--suffix"  , "True"
                             , "--"
                             , "--on", ""
                             ]

Literally copy pasted from the Xmonad documentation. When I add this Xmobar says there is an error on line 83, which is just a closing curly brace, so it makes no sense at all.

This is the entire config:

Config {

   -- appearance
     font = "Ubuntu Bold 12"
   , additionalFonts = [ "JetBrains Mono Nerd Font" ]
   , bgColor =      "#121212"
   , fgColor =      "#212121"
   , position =     TopH 28

   -- layout
   , sepChar =  "%"   -- delineator between plugin names and straight text
   , alignSep = "}{"  -- separator between left-right alignment
   , template = " %XMonadLog% } %date% { %alsa:default:Master% | %kbd% | %multicpu% | %coretemp% | %memory% "

   -- general behavior
   , lowerOnStart =     True    -- send to bottom of window stack on start
   , hideOnStart =      False   -- start with window unmapped (hidden)
   , allDesktops =      True    -- show on all desktops
   , overrideRedirect = True    -- set the Override Redirect flag (Xlib)
   , pickBroadest =     False   -- choose widest display (multi-monitor)
   , persistent =       True    -- enable/disable hiding (True = disabled)

   -- plugins
   --   Numbers can be automatically colored according to their value. xmobar
   --   decides color based on a three-tier/two-cutoff system, controlled by
   --   command options:
   --     --Low sets the low cutoff
   --     --High sets the high cutoff
   --
   --     --low sets the color below --Low cutoff
   --     --normal sets the color between --Low and --High cutoffs
   --     --High sets the color above --High cutoff
   --
   --   The --template option controls how the plugin is displayed. Text
   --   color can be set by enclosing in <fc></fc> tags. For more details
   --   see http://projects.haskell.org/xmobar/#system-monitor-plugins.
   , commands =
        -- cpu activity monitor
        [ Run MultiCpu       [ "--template" , "Cpu: <total0>%|<total1>%"
                             , "--Low"      , "50"         -- units: %
                             , "--High"     , "85"         -- units: %
                             , "--low"      , "darkgreen"
                             , "--normal"   , "darkorange"
                             , "--high"     , "darkred"
                             ] 10

        -- cpu core temperature monitor
        , Run CoreTemp       [ "--template" , "Temp: <core0>°C|<core1>°C"
                             , "--Low"      , "70"        -- units: °C
                             , "--High"     , "80"        -- units: °C
                             , "--low"      , "darkgreen"
                             , "--normal"   , "darkorange"
                             , "--high"     , "darkred"
                             ] 50

        -- memory usage monitor
        , Run Memory         [ "--template" ,"<box type=Bottom color=red width=2>Mem: <usedratio>%</box>"
                             , "--Low"      , "20"        -- units: %
                             , "--High"     , "90"        -- units: %
                             , "--low"      , "darkgreen"
                             , "--normal"   , "darkorange"
                             , "--high"     , "darkred"
                             ] 10

        -- time and date indicator
        --   (%F = y-m-d date, %a = day of week, %T = h:m:s time)
        , Run Date           "<box type=Bottom color=#37bcbe width=3><fc=#ffffff>  %H:%M %a %b %d, %Y</fc></box>" "date" 10

, Run Alsa "default" "Master"
                             [ "--template", "<volumestatus>"
                             , "--suffix"  , "True"
                             , "--"
                             , "--on", ""
                             ]

        -- keyboard layout indicator
        , Run Kbd            [ ("us" , "<fc=#37bcbe>   US</fc>")
                             , ("rs(latinyz)", "<fc=#37bcbe>   RS (Latin)</fc>")
                             , ("rs", "<fc=#37bcbe>   RS</fc>")
                             ]
, Run XMonadLog
]
   }

Again - works perfectly fine when I remove the Run Alsa part.

I'm on Fedora 40. Installed all possible alsa plugins I could find in dnf - alsa-utils, alsa-tools, pipewire-alsa, alsa-plugins-pulseaudio.... amixer binary is there. I have no idea how to fix this and can't find anyone with a similar issue. The error is completely useless.

Does anyone have any idea what I'm doing wrong?

UPDATE: Couldn't fix this no matter what, just wrote my own script for the volume.

4 Comments
2024/07/19
10:31 UTC

5

Is there a "correct" way to have xmonad and xmobar built using Cabal at a user level inside a project?

Hey all, so I've been using xmonad for a few months now on and off, but one thing has been bugging me. The whole time I've been using my distribution's package manager for everything Haskell related. Recently, I installed GHCup to move away from it, and it's working well for what I want. Though, I'd like to have my xmonad and xmobar both built using Cabal at a user level.

If you check out my dotfiles, you can see I have 2 separate Cabal projects for xmonad and xmobar separately. I'm not sure if this is the best way to do this, and I'd like it to be more portable and reproduce-able as long as GHCup is installed and configured.

Right now, I run cabal install in both of those directories, and they get placed inside my Cabal bin directory. Which works fine, but again, I'd like it to be a single project that handles both, if possible. After the first time its built, I can just run xmonad and xmobar directly, and they auto-rebuild after the fact. So it's more about initial setup, if anything.

Has anyone done something similar to this and is able to give me some tips? Do note I'm new to all Haskell tooling, so please bear that in mind, lol. All thanks in advance.

4 Comments
2024/07/12
16:51 UTC

3

XMonad, Polybar, and NixOS woes

So, I'm on NixOS, and I'm trying to configure polybar to work with xmonad. I'm trying to configure the xworkspace module to work with xmonad. The polybar docs I'm looking at are here: https://github.com/polybar/polybar/wiki/Module:-xworkspaces

The main issue is that these docs say that I need an EWMH compatible window manager, which xmonad can do. If I run xprop -root _NET_SUPPORTED, I see that my current config of xmonad supports all the relevant atoms but running something like xprop -root _NET_DESKTOP_NAMES gives _NET_DESKTOP_NAMES: not found.

I'm not sure if this is a NixOS issue or what, but my current xmonad config can be found here: https://gist.github.com/IQubic/70d20a41347a88577fecb50579e2f463

The relevant ewmh section is at the bottom of XMonad.hs. I can't seem to figure out why these atoms aren't being set for me. Note that I am not asking for help with configuring polybar. I'm solely using it as an example of why I want these particular atoms to be set.

3 Comments
2024/06/24
16:59 UTC

1

Does anyone know how do I fix this?

Hello! When I do xmonad --recompile, it throws this:

xmonad.hs:13:1: error:     Could not load module ‘Graphics.X11.ExtraTypes.XF86’     It is a member of the hidden package ‘X11-1.10.3’.     You can run ‘:set -package X11’ to expose it.     (Note: this unloads all the modules in the current scope.)     Use -v (or `:set -v` in ghci) to see a list of the files searched for.    | 13 | import Graphics.X11.ExtraTypes.XF86    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  xmonad.hs:19:1: error:     Could not load module ‘Data.Map’     It is a member of the hidden package ‘containers-0.6.7’.     You can run ‘:set -package containers’ to expose it.     (Note: this unloads all the modules in the current scope.)     Use -v (or `:set -v` in ghci) to see a list of the files searched for.    | 19 | import qualified Data.Map        as M    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Please check the file for errors.

I ran the commands in ghci and still throws this error... Please help!

3 Comments
2024/06/22
22:33 UTC

2

Binding a workspace to a screen?

I was wondering if there was any way to bind an empty/hidden workspace to the screen it was initialized on (similar to how Hyprland handles multiple screens).

If you've ever used Hyprland, the default behavior is a workspace, when "created", is bound to a specific screen. In default xmonad, if workspace 1 and 2 are "made" on screens 1 and 2 respectively, they can still be accessed by the other screen. In Hyprland, the same scenario would have workspace 1 be "bound" to screen 1 (i.e. pressing "mod+1" with workspace 2 and 3 open on your monitors would result it workspace 1 being opened on screen 1, regardless of the focused screen).

I am curious if a package/hack already exists within the xmonad-contrib library that exhibits this behavior. Before it's suggested, I tried IndependentScreens but don't like how each monitor contains independent workspaces. I would still like only 1-9 workspaces to be accessed by both screens, only for a workspace to be bound to the screen it was initialized on.

0 Comments
2024/06/22
12:31 UTC

1

"Proper" way of spawning and handling status bars (e.g. xmobar)?

Hey, so first off, as far as I know there's no "correct" way, but I still would appreciate some guidance. I want to have 2 xmobars using 2 different xmobarrc config files spawned when I load into xmonad. Only one needs to have the data sent from xmonad (workspaces, active client, etc.), the other can just be spawned as usual.

My current approach to spawning and such is this:

myXmobarPP :: PP
myXmobarPP = def
  { ppSep             = " : "
  , ppCurrent         = wrap "[" "]"
  , ppHidden          = xmobarColor "#bbbbbb"
  , ppHiddenNoWindows = xmobarColor "#888888"
  }

main :: IO ()
main = do
  xmonad $ withEasySB (statusBarProp "xmobar ~/.xmonad/xmobarrc0" (pure myXmobarPP)) defToggleStrutsKey $ withEasySB (statusBarProp "xmobar ~/.xmonad/xmobarrc1" (pure myXmobarPP)) defToggleStrutsKey $ ewmhFullscreen $ ewmh $ def
    -- Theme options
    { borderWidth        = myBorderWidth
    , normalBorderColor  = myNormalBorderColor
    , focusedBorderColor = myFocusedBorderColor

    -- Layouts and workspaces
    , layoutHook         = myLayout
    , workspaces         = myWorkspaces

    -- Hooks
    , manageHook         = myManageHook
    , handleEventHook    = myEventHook

    -- Static options
    , focusFollowsMouse  = True
    , clickJustFocuses   = False
    , modMask            = mod4Mask

    -- Binds
    , mouseBindings      = myMouseBindings
    } `additionalKeysP` myKeys

I'm aware this way is pretty garbage, but it got me going at least. Anyways, what I'm actually asking is this: how should I structure my initialization of my xmobars (spawning, stdin piping, all that), and is there anything else glaringly wrong with this setup? I've done a lot of searching of xmonad and xmobar configurations, and I see lots of different setups for handling the data from xmonad to xmobar, all with different timestamps, so I'm not really sure what the best way of doing it nowadays is. Complete noob to Haskell and all that, but I'm open to any documentation I should read. Thanks in advance.

3 Comments
2024/06/22
05:20 UTC

3

Running a personal script from xmobar

Hello, I have a personal script saved in a subdirectory of my home directory. I have added to location to my $PATH variable, and so I am able to run this script from anywhere in my system within the command line.

I would like to also be able to run this script from xmobar in a similar way. But it does not show up using the search functionality, so I was wondering if there was something I could do to allow xmobar to run my personal scripts within this directory. I do not want to do this with a hotkey. Thanks for any help.

EDIT 07-10-2024: My question is malformed, as the "search functionality" I referred to above was actually that of dmenu, not xmonad/xmobar. Thank you. I am ignorant.

The solution is to add PATH="$PATH:/directory/of/script" to your ~/.profile file and refresh everything.

2 Comments
2024/06/21
02:58 UTC

2

How can I assign a custom property to an Xorg window on launch?

How can I assign a custom property to Firefox, when I launch it?

To get the process ID of Firefox at launch, I do

firefox -P hukarz &
NEW_WINDOW_PID=$!

This however is not translatably to Window ID, because "firefox" spawns other processes here, where one ends up as the GUI. I've also not had luck find descendants of this PID.

What I really want to do is assign a custom property at launch:

wmctrl -i -r $NEW_WINDOW_ID -N 'hukarz'
3 Comments
2024/06/20
12:44 UTC

1

Do we have something like WindowGo, but for custom window properties?

I have trouble with Firefox, cause I have multiple windows and I need to somehow distinguish between them. I have to do this programmatically, so I can't use the Window Titler addon for Firefox

I set a custom window property like this:

xprop -id 0x11c00062 -f \_MY\_CUSTOM\_PROPERTY 8u -set \_MY\_CUSTOM\_PROPERTY "MyCustomValue"

This works:

# xprop -id 0x11c00062 | grep -i custom
\_MY\_CUSTOM\_PROPERTY(UTF8\_STRING) = "MyCustomValue"

So now, I need to use that in XMonad, to be able to raise the window, something like

, ((modm .|. mod1Mask .|. controlMask, xK\_e), raise (\_MY\_CUSTOM\_PROPERTY =? "MyCustomValue"))

Any pointers as to what I can use to achieve this?

4 Comments
2024/06/15
12:34 UTC

3

Looking to set up TwoPane + Tabbed Layout

I'm looking for a way to have a layout that combines TwoPane and Tabbed. Basically I want to have two panes open side by side, and I want each pane to have its own set of open applications, with tabs displayed at the top, if possible.

0 Comments
2024/06/11
05:22 UTC

3

logHook only for non-floating windows

Is there a way to run logHook only for non-floating windows? I'm using updatePointer to move the cursor to the middle of new windows, but I wouldn't want to do that for floating windows.

2 Comments
2024/06/10
11:23 UTC

1

Prevent automatic workspace switching at start

So, how to prevent automatic workspace switching at start?

While wm is starting, it launches apps and places them at workspaces according to rules. But! Some apps, first of all based on Electron) switches workspace after starting to get focus. I dislike this behaviour, so what can I do with it?

1 Comment
2024/06/09
18:17 UTC

1

Have new windows appear at the top of the slaves/right after the final master?

I'm looking for the same behavior as the attachtop patch for dwm. I'm relatively new to xmonad and Haskell in general, so if there's any more information I should give about my configuration, let me know!

All thanks.

3 Comments
2024/05/23
09:56 UTC

Back To Top