Home liberachat/#xmonad: Logs Calendar

Logs: liberachat/#xmonad

←Prev  Next→ 184,768 events total
2024-04-05 20:44:30 <haskellbridge> <N​exilva> , fmap (\n -> name `oneOf` [n]) (extractCloneName "Windows 10 P2V Original Clone") --> (doF . W.view <> doShift) "8:win-A"
2024-04-05 20:44:32 <haskellbridge> <N​exilva> , fmap (\n -> name `oneOf` [n]) (extractCloneName "Windows 10 P2V Original Clone") --> (doF . W.view <> doShift) "8:win-B"
2024-04-05 20:44:33 <haskellbridge> <N​exilva> -- Add more rules as needed
2024-04-05 20:44:34 <haskellbridge> <N​exilva> ]
2024-04-05 20:44:35 <haskellbridge> <N​exilva> ```
2024-04-05 20:44:37 <haskellbridge> <N​exilva> Is GPT correct? I have no idea because I don't know haskell
2024-04-05 20:44:52 <haskellbridge> <N​exilva> I can always tell in C++ or PHP or Js or other langs if GPT is right or not. But Haskell I don't even know.
2024-04-05 20:48:00 <haskellbridge> <N​exilva> `, className =? "Oracle VM VirtualBox" <&&> fmap ("Windows 10 P2V Original Clone" `isPrefixOf`) title --> (doF . W.view <> doShift) "8:win-A"` Here's another thing it suggestd, but this one doesn't match the Window, as I run VM in dual screen mode (two virtual screens)
2024-04-05 20:48:31 <haskellbridge> <N​exilva> Here is yet another proposed solution:
2024-04-05 20:48:32 <haskellbridge> <N​exilva> ```
2024-04-05 20:48:33 <haskellbridge> <N​exilva> import Text.Regex.Posix
2024-04-05 20:48:35 <haskellbridge> <N​exilva> -- Define a function to match the window name using regular expressions
2024-04-05 20:48:36 <haskellbridge> <N​exilva> matchesPattern :: String -> Bool
2024-04-05 20:48:37 <haskellbridge> <N​exilva> matchesPattern s = s =~ "Windows 10 P2V Original Clone [^ ]+ - Oracle VM VirtualBox : [0-9]+"
2024-04-05 20:48:39 <haskellbridge> <N​exilva> -- Use the matchesPattern function in your Xmonad configuration
2024-04-05 20:48:40 <haskellbridge> <N​exilva> , name `matches` matchesPattern --> (doF . W.view <> doShift) "8:win-A"
2024-04-05 20:48:41 <haskellbridge> <N​exilva> ```
2024-04-05 20:49:00 <haskellbridge> <N​exilva> I could try it.
2024-04-05 20:49:28 <haskellbridge> <N​exilva> ```
2024-04-05 20:49:29 <haskellbridge> <N​exilva> -- Sort Virtual Machines into separate workspaces
2024-04-05 20:49:31 <haskellbridge> <N​exilva> , className =? "VirtualBox Manager" <&&> stringProperty "WM_NAME" =? "Windows 10 P2V Original Clone .* - Oracle VM VirtualBox : 1" --> (doF . W.view <> doShift) "8:win-A"
2024-04-05 20:49:32 <haskellbridge> <N​exilva> , className =? "VirtualBox Manager" <&&> stringProperty "WM_NAME" =? "Windows 10 P2V Original Clone .* - Oracle VM VirtualBox : 2" --> (doF . W.view <> doShift) "8:win-B"
2024-04-05 20:49:33 <haskellbridge> <N​exilva> ```
2024-04-05 20:49:34 <haskellbridge> <N​exilva> It also suggested this
2024-04-05 20:50:20 <haskellbridge> <N​exilva> If it was another language I could easily tell whether the code is good or not. Haskell I can't tell and somehow I make do
2024-04-05 20:55:09 <geekosaur> `matches` won't work because it needs to be fmapped in
2024-04-05 20:55:47 <geekosaur> also `stringProperty "WM_NAME"` is `title`
2024-04-05 20:57:53 <geekosaur> className =? "VirtualBox Manager" <&&> title ^? "Windows 10 P2V Original Clone " <&&> title ~? " Oracle VM VirtualBox : 2" --> (doF . W.view <> doShift) "8:win-A"
2024-04-05 20:58:39 <geekosaur> import XMonad.Hooks.ManageHelpers for ^? and $? (sorry I meant $? instead of ~?, IRC doesn't do edits)
2024-04-05 21:01:09 <haskellbridge> <N​exilva> So className and then matching title.
2024-04-05 21:02:29 <haskellbridge> <N​exilva> `, className =? "VirtualBox Manager" <&&> title ^? "Windows 10 P2V Original Clone " <&&> title $? " Oracle VM VirtualBox : 1" --> (doF . W.view <> doShift) "8:win-A"`
2024-04-05 21:02:29 <haskellbridge> <N​exilva> `, className =? "VirtualBox Manager" <&&> title ^? "Windows 10 P2V Original Clone " <&&> title $? " Oracle VM VirtualBox : 2" --> (doF . W.view <> doShift) "8:win-B`
2024-04-05 21:02:58 <geekosaur> right
2024-04-05 21:03:18 <haskellbridge> <N​exilva> ```
2024-04-05 21:03:19 <haskellbridge> <N​exilva> xmonad.hs:87:22: error: [GHC-88464]
2024-04-05 21:03:20 <haskellbridge> <N​exilva> Variable not in scope: (=~) :: String -> String -> Bool
2024-04-05 21:03:21 <haskellbridge> <N​exilva> Suggested fix:
2024-04-05 21:03:23 <haskellbridge> <N​exilva> Perhaps use one of these:
2024-04-05 21:03:24 <haskellbridge> <N​exilva> ‘==’ (imported from Prelude), ‘=?’ (imported from XMonad)
2024-04-05 21:03:25 <haskellbridge> <N​exilva> |
2024-04-05 21:03:26 <haskellbridge> <N​exilva> 87 | matchesPattern s = s =~ "Windows 10 P2V Original Clone [^ ]+ - Oracle VM VirtualBox : [0-9]+"
2024-04-05 21:03:28 <haskellbridge> <N​exilva> ```
2024-04-05 21:04:27 <geekosaur> you're not using that and you would have to import Text.Regex.Posix to get that operator
2024-04-05 21:05:19 <haskellbridge> <N​exilva> Ok it compiles now
2024-04-05 21:05:42 <haskellbridge> <N​exilva> $ xmonad --recompile
2024-04-05 21:05:43 <haskellbridge> <N​exilva> XMonad will use stack ghc --stack-yaml "/home/stoned/.config/xmonad/stack.yaml" to recompile.
2024-04-05 21:05:44 <haskellbridge> <N​exilva> XMonad recompiling (forced).
2024-04-05 21:05:46 <haskellbridge> <N​exilva> XMonad recompilation process exited with success!
2024-04-05 21:06:14 <geekosaur> hm, and it wouldn't do what you wanted anyway because you want to move it to a different ws based on the number, but that pattern just matches any number
2024-04-05 21:06:40 <haskellbridge> <N​exilva> I have no idea what is happening 🙂
2024-04-05 21:06:52 <haskellbridge> <N​exilva> So I launched the VM and like you said it didn't work.
2024-04-05 21:07:23 <geekosaur> no, I was talking about matchesPattern which you I think aren't using (and if you are, it's doing the wrong thing)
2024-04-05 21:07:36 <haskellbridge> <N​exilva> ```
2024-04-05 21:07:37 <haskellbridge> <N​exilva> -- Sort Virtual Machines into separate workspaces
2024-04-05 21:07:39 <haskellbridge> <N​exilva> , className =? "VirtualBox Manager" <&&> title ^? "Windows 10 P2V Original Clone " <&&> title $? " Oracle VM VirtualBox : 1" --> (doF . W.view <> doShift) "8:win-A"
2024-04-05 21:07:40 <haskellbridge> <N​exilva> , className =? "VirtualBox Manager" <&&> title ^? "Windows 10 P2V Original Clone " <&&> title $? " Oracle VM VirtualBox : 2" --> (doF . W.view <> doShift) "8:win-B"
2024-04-05 21:07:41 <haskellbridge> <N​exilva> ```
2024-04-05 21:07:43 <haskellbridge> <N​exilva> I'm using this, what you said
2024-04-05 21:07:58 <haskellbridge> <N​exilva> It compiles, but doesn't shift the VM windows
2024-04-05 21:08:11 <geekosaur> I wonder if the className is right
2024-04-05 21:08:42 <geekosaur> vbox doesn't want to work on my system for some reason so I can't check
2024-04-05 21:08:56 <haskellbridge> <N​exilva> ```
2024-04-05 21:08:57 <haskellbridge> <N​exilva> WM_NAME(STRING) = "Windows 10 P2V Original Clone 1 (Working, before update.) [Running] - Oracle VM VirtualBox : 1"
2024-04-05 21:08:58 <haskellbridge> <N​exilva> _NET_WM_NAME(UTF8_STRING) = "Windows 10 P2V Original Clone 1 (Working, before update.) [Running] - Oracle VM VirtualBox : 1"
2024-04-05 21:08:59 <haskellbridge> <N​exilva> ```
2024-04-05 21:09:11 <geekosaur> so get rid of the `className =? "VirtualBox Manager" <&&> ` part
2024-04-05 21:09:24 <haskellbridge> <N​exilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-A`
2024-04-05 21:09:24 <haskellbridge> <N​exilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-B`
2024-04-05 21:09:25 <haskellbridge> <N​exilva> How do to this?
2024-04-05 21:09:27 <haskellbridge> <N​exilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-A`
2024-04-05 21:09:28 <haskellbridge> <N​exilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-B`
2024-04-05 21:09:29 <haskellbridge> <N​exilva> How do to this?
2024-04-05 21:09:30 <haskellbridge> <N​exilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-A\`
2024-04-05 21:09:32 <haskellbridge> <N​exilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 2` to 8:win-B\`
2024-04-05 21:09:33 <haskellbridge> <N​exilva> How do to this?
2024-04-05 21:09:35 <haskellbridge> <N​exilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-A\`
2024-04-05 21:09:36 <haskellbridge> <N​exilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 2` to 8:win-B\`
2024-04-05 21:09:37 <haskellbridge> <N​exilva> How do to this?
2024-04-05 21:11:53 <geekosaur> the difference between the code you originally had and my suggestion is the className part, so remove that as I said above
2024-04-05 21:12:06 <geekosaur> presumably it's the wrong className
2024-04-05 21:13:13 <haskellbridge> <N​exilva> WM_CLASS(STRING) = "VirtualBox Machine", "VirtualBox Machine"
2024-04-05 21:13:51 <geekosaur> so change "VirtualBox Manager" to "VirtualBox Machine"
2024-04-05 21:14:07 <geekosaur> (I think you said you got that from ChatGPT? it was wrong)
2024-04-05 21:15:22 <haskellbridge> <N​exilva> Thank you
2024-04-05 21:15:28 <haskellbridge> <N​exilva> I didn't use any GPT stuff
2024-04-05 21:15:38 <haskellbridge> <N​exilva> I used it to learn how to install the text regex package
2024-04-05 21:16:00 <haskellbridge> <N​exilva> But I used your suggestions. I trust you far more over the years than GPT
2024-04-05 21:16:11 <haskellbridge> <N​exilva> It's working now.
2024-04-05 23:10:15 × mekeor quits (~user@2001:a61:10db:ae01:ee8e:7029:dae7:575c) (Quit: towards emacs as interface to a cybernetic council communism)
2024-04-05 23:17:56 <haskellbridge> <N​exilva> "VirtualBox Manager" is moved to desktop 5, and "VirtualBox Machine" to 8-A/B
2024-04-05 23:18:21 <haskellbridge> <N​exilva> "VirtualBox Manager" is the main Vbox window which lists all the VMs and allows you to configure them
2024-04-05 23:18:59 <geekosaur> yes
2024-04-05 23:19:25 <geekosaur> I had been wondering why you were matching against "VirtualBox Manager", tbh
2024-04-05 23:19:36 <haskellbridge> <N​exilva> I didn't realize the name changed
2024-04-05 23:19:43 <haskellbridge> <N​exilva> I had to do xprop to see the difference
2024-04-05 23:21:53 <geekosaur> they're actually misusing it, className should be VirtualBox, appName should be virtualBox, role should be manager vs. machine
2024-04-05 23:22:05 <geekosaur> but nobody cares about ICCCM any more
2024-04-05 23:22:09 mekeor joins (~user@2001:a61:10db:ae01:ee8e:7029:dae7:575c)
2024-04-05 23:35:05 × mekeor quits (~user@2001:a61:10db:ae01:ee8e:7029:dae7:575c) (Quit: towards emacs as interface to a cybernetic council communism)
2024-04-06 00:44:05 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 252 seconds)

All times are in UTC.