Home liberachat/#xmonad: Logs Calendar

Logs: liberachat/#xmonad

←Prev  Next→
Page 1 .. 906 907 908 909 910 911 912 913 914 915 916 .. 1850
184,996 events total
2022-10-17 15:27:27 <geekosaur> you're using list-bin to grab the built config, the build script uses install to lift it out of dist-newstyle
2022-10-17 15:27:40 <geekosaur> mostly this is left over from cabal v1, at some point I may rewrite it
2022-10-17 15:31:03 <geekosaur> either way you would need to mv (not cp) the running config to a backup name before installing (however you do it) the new one
2022-10-17 15:31:34 <Phaseditto> why is that
2022-10-17 15:31:44 <geekosaur> but this is probably harder if you ln to the build artifact in dist_newstyle because you'd need to find and move it before running cabal
2022-10-17 15:31:55 <geekosaur> [17 13:44:56] <geekosaur> it occurs to me that the file that's being written is the one that';s running and something might be throwing ETXTBSY as a result
2022-10-17 15:32:28 <geekosaur> basically you can't overwrite a file that is currently running because the OS expects to be able to load pages from it on the fly
2022-10-17 15:32:35 <Phaseditto> ooooh yeah
2022-10-17 15:32:38 <Phaseditto> that makes sense
2022-10-17 15:32:53 <Phaseditto> hm
2022-10-17 15:34:38 <geekosaur> I'd say instead of ln -sf you cp, and before doing that mv the existing one out of the way
2022-10-17 15:34:54 <Phaseditto> i could give that a try, gimme a sec
2022-10-17 15:35:34 <Phaseditto> Hold on, remove the symlink or the actual file?
2022-10-17 15:36:07 <geekosaur> it won;t be a symlink any more, it would be a copy
2022-10-17 15:36:13 <Phaseditto> right
2022-10-17 15:36:22 <geekosaur> otherwise you're just pushing the problem down into dist_newstyle
2022-10-17 15:36:31 <geekosaur> and it'll be harder to do the backup step
2022-10-17 15:37:33 <Phaseditto> so instead of "ln -sf "$bin" "$1" i do rm "$1" and cp "$bin" "$1"
2022-10-17 15:38:14 <geekosaur> well, I'd do `mv "$1" "$1.bak"` but I think if you `rm` it it gets copied to swap
2022-10-17 15:38:21 <geekosaur> so it can keep paging from it
2022-10-17 15:38:50 <Phaseditto> i will try the rm version, see how that goes
2022-10-17 15:39:28 <geekosaur> (the OS can't know you're immediately going to exec the new file)
2022-10-17 15:39:56 <geekosaur> hm, actually neither can you, --recompile is separate from --restart)
2022-10-17 15:40:05 <Phaseditto> yup
2022-10-17 15:40:15 <Phaseditto> also it did't change
2022-10-17 15:40:26 <Phaseditto> i can try to mv but i think that also makes no difference
2022-10-17 15:43:42 <geekosaur> first one wouldn't work because it'd be moving the symlink which will do nothing useful
2022-10-17 15:43:52 <geekosaur> I mean,m the first restart after the change
2022-10-17 15:44:08 <Phaseditto> i tried the mv after i switched to cping
2022-10-17 15:44:12 <Phaseditto> didn't work either
2022-10-17 15:44:37 <geekosaur> hm. pastebin your current build script?
2022-10-17 15:44:41 <Phaseditto> sure, sec
2022-10-17 15:45:00 <Phaseditto> https://paste.tomsmeding.com/Juzs0JRr
2022-10-17 15:45:32 <geekosaur> that should work 😞
2022-10-17 15:45:38 <[Leary]> Phaseditto: If you're using `launch` in your xmonad.hs, you might need to switch it for `xmonad`. If not, rather than the build script, I want to know what your logs show.
2022-10-17 15:45:49 <Phaseditto> lemme check
2022-10-17 15:46:22 <Phaseditto> nope, no launch
2022-10-17 15:48:12 <Phaseditto> XMonad is recompiling and replacing itself with another XMonad process because the current process is called "xmonad" but the compiled configuration should be called "xmonad-x86_64-linux"
2022-10-17 15:48:16 <Phaseditto> lul
2022-10-17 15:49:24 <geekosaur> yes, that's an unfortunate message that happens because the first compile is done by xmonad instead of your config, as I described earlier
2022-10-17 15:49:49 <Phaseditto> well it says that twice
2022-10-17 15:50:05 <Phaseditto> should i just copy it as "xmonad"?
2022-10-17 15:50:12 <geekosaur> no
2022-10-17 15:50:40 <Phaseditto> can i tell restart to use a specific file?
2022-10-17 15:51:18 <geekosaur> if you replace th keybinding, yes
2022-10-17 15:53:39 <geekosaur> https://hackage.haskell.org/package/xmonad-0.17.1/docs/XMonad-Operations.html#v:restart
2022-10-17 15:55:30 <Phaseditto> does it matter where i define the restart behavior in the HS file?
2022-10-17 15:56:36 <geekosaur> this would be a keybinding
2022-10-17 15:56:52 <Phaseditto> ah okay
2022-10-17 16:01:10 <Phaseditto> something like this:
2022-10-17 16:01:12 <Phaseditto> , ("M-q", restart "/home/r5on11c/.xmonad/xmonad-x86_64-linux" True) -- Restart xmonad
2022-10-17 16:01:59 <geekosaur> that will restart but not recompile
2022-10-17 16:02:35 <Phaseditto> yeah i know, i haven't done concatenated commands within a single keybind yet
2022-10-17 16:03:46 <geekosaur> use >> to chain commands
2022-10-17 16:03:58 <Phaseditto> gotcha
2022-10-17 16:04:39 <geekosaur> that said, `recompile` is something of a pain to use directly and you can't spawn `xmonad --recompile` because it will run in the background (and you want it to, you don't want xmonad to block while compiling)
2022-10-17 16:05:18 <Phaseditto> that's a shame..
2022-10-17 16:06:05 <Phaseditto> i will restart xmonad manually with logging out and in so i at least have that at my disposal
2022-10-17 16:06:18 × Phaseditto quits (~r5on11c@p5ddf8ff3.dip0.t-ipconnect.de) (Quit: Lost terminal)
2022-10-17 16:09:06 → Phaseditto joins (~r5on11c@p5ddf8ff3.dip0.t-ipconnect.de)
2022-10-17 16:09:22 <Phaseditto> there we go
2022-10-17 16:10:56 <Phaseditto> the restart works accordingly, that makes things easier
2022-10-17 16:14:07 <Phaseditto> i set it back to symlinking and it still seems to work
2022-10-17 16:14:30 <Phaseditto> don't know which method is preferrable
2022-10-17 16:57:28 <dminuoso> geekosaur: How does xmonad know that compilation is done?
2022-10-17 16:58:28 <geekosaur> it doesn't. these days the restart sequence is `spawn "xmonad --recompile; xmonad --restart"` and the restart message comes in when it's done
2022-10-17 16:58:43 <dminuoso> So the manager is blocked while recompilation is going on?
2022-10-17 16:58:47 <geekosaur> no
2022-10-17 16:58:54 <dminuoso> Oh `spawn` sorry!
2022-10-17 16:58:59 <geekosaur> the whole thing is backgrounded
2022-10-17 16:59:32 <dminuoso> Ohh I see, so its actually the spawned thread that will, outside, call xmonad again, triggering the replacement
2022-10-17 16:59:39 <geekosaur> but the shell sequence isn't so *it* (but not xmonad) knows when compilation is done, and sends XMONAD_RESTART
2022-10-17 16:59:41 <dminuoso> or *process rather
2022-10-17 17:00:30 <geekosaur> (client message sent to the root window; xmonad listens for that and does the actual restart)
2022-10-17 17:00:57 <dminuoso> Okay, and `spawn` just double forks.
2022-10-17 17:01:01 <geekosaur> yes
2022-10-17 17:03:51 <dminuoso> So it seems to me, that one can also just bind a key to `spawn "/path/to/build; xmonad --restart"` too,
2022-10-17 17:04:15 <geekosaur> right, but it's te restart part that Phaseditto was trying to replace, not the compile part
2022-10-17 17:04:17 <dminuoso> Adapt the build script to forward stderr to the xmonad.errors directory
2022-10-17 17:04:25 <dminuoso> Fair
2022-10-17 17:05:10 <geekosaur> also build wants a parameter which is the binary to create
2022-10-17 17:07:10 <dminuoso> Yeah, figured that one out already :)
2022-10-17 17:07:18 <dminuoso> The interface is somewhat quirky
2022-10-17 17:07:37 <dminuoso> I mean the entire restart/startup/rebuild interface
2022-10-17 17:07:47 <dminuoso> Cant quite put my thumb on it, but it doesnt feel right
2022-10-17 17:07:51 <geekosaur> there's also fun stuff like cabal redirecting errors to stdout
2022-10-17 17:08:13 <geekosaur> it's not so much designed as grown from a much simpler setup
2022-10-17 17:08:41 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.7)
2022-10-17 17:09:02 <dminuoso> If only I was interested in hacking on my xmonad config again, I might be motivated to invest some work
2022-10-17 17:09:17 <dminuoso> But as the old saying goes: never change a running xmonad config.
2022-10-17 17:39:13 <Phaseditto> Currently spending my time making my xmobar resemble my DWM setup
2022-10-17 17:40:34 <Phaseditto> i can't pass the restart parameters when call the restart in the terminal, can i?
2022-10-17 17:40:58 <Phaseditto> If i could i could just make a recompile & restart script that handles the timing
2022-10-17 17:41:24 <geekosaur> calling `xmonad --restart` sends the restart parameters automatically
2022-10-17 17:41:37 <geekosaur> [17 16:58:28] <geekosaur> it doesn't. these days the restart sequence is `spawn "xmonad --recompile; xmonad --restart"` and the restart message comes in when it's done
2022-10-17 17:42:23 <geekosaur> (`xmonad --restart` just sends an `XMONAD_RESTART` message to the root window; xmonad handles that in its builtin event handler and does `restart (its own path) True`
2022-10-17 17:44:48 <Phaseditto> though i would need to set the restart path in the xmonad.hs then yes?
2022-10-17 17:45:03 <Phaseditto> since i have only done so for the keybinding, but not globally for xmonad itself
2022-10-17 17:46:20 <geekosaur> you could conceivably duplicate the `handle` code in your `handleEventHook` with your own path
2022-10-17 17:46:39 <Phaseditto> i mean elsewise it would do default behavior and i would end up with the same problem

All times are in UTC.