Logs: liberachat/#xmonad
| 2024-04-05 20:44:30 | <haskellbridge> | <Nexilva> , 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> | <Nexilva> , 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> | <Nexilva> -- Add more rules as needed |
| 2024-04-05 20:44:34 | <haskellbridge> | <Nexilva> ] |
| 2024-04-05 20:44:35 | <haskellbridge> | <Nexilva> ``` |
| 2024-04-05 20:44:37 | <haskellbridge> | <Nexilva> Is GPT correct? I have no idea because I don't know haskell |
| 2024-04-05 20:44:52 | <haskellbridge> | <Nexilva> 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> | <Nexilva> `, 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> | <Nexilva> Here is yet another proposed solution: |
| 2024-04-05 20:48:32 | <haskellbridge> | <Nexilva> ``` |
| 2024-04-05 20:48:33 | <haskellbridge> | <Nexilva> import Text.Regex.Posix |
| 2024-04-05 20:48:35 | <haskellbridge> | <Nexilva> -- Define a function to match the window name using regular expressions |
| 2024-04-05 20:48:36 | <haskellbridge> | <Nexilva> matchesPattern :: String -> Bool |
| 2024-04-05 20:48:37 | <haskellbridge> | <Nexilva> matchesPattern s = s =~ "Windows 10 P2V Original Clone [^ ]+ - Oracle VM VirtualBox : [0-9]+" |
| 2024-04-05 20:48:39 | <haskellbridge> | <Nexilva> -- Use the matchesPattern function in your Xmonad configuration |
| 2024-04-05 20:48:40 | <haskellbridge> | <Nexilva> , name `matches` matchesPattern --> (doF . W.view <> doShift) "8:win-A" |
| 2024-04-05 20:48:41 | <haskellbridge> | <Nexilva> ``` |
| 2024-04-05 20:49:00 | <haskellbridge> | <Nexilva> I could try it. |
| 2024-04-05 20:49:28 | <haskellbridge> | <Nexilva> ``` |
| 2024-04-05 20:49:29 | <haskellbridge> | <Nexilva> -- Sort Virtual Machines into separate workspaces |
| 2024-04-05 20:49:31 | <haskellbridge> | <Nexilva> , 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> | <Nexilva> , 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> | <Nexilva> ``` |
| 2024-04-05 20:49:34 | <haskellbridge> | <Nexilva> It also suggested this |
| 2024-04-05 20:50:20 | <haskellbridge> | <Nexilva> 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> | <Nexilva> So className and then matching title. |
| 2024-04-05 21:02:29 | <haskellbridge> | <Nexilva> `, 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> | <Nexilva> `, 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> | <Nexilva> ``` |
| 2024-04-05 21:03:19 | <haskellbridge> | <Nexilva> xmonad.hs:87:22: error: [GHC-88464] |
| 2024-04-05 21:03:20 | <haskellbridge> | <Nexilva> Variable not in scope: (=~) :: String -> String -> Bool |
| 2024-04-05 21:03:21 | <haskellbridge> | <Nexilva> Suggested fix: |
| 2024-04-05 21:03:23 | <haskellbridge> | <Nexilva> Perhaps use one of these: |
| 2024-04-05 21:03:24 | <haskellbridge> | <Nexilva> ‘==’ (imported from Prelude), ‘=?’ (imported from XMonad) |
| 2024-04-05 21:03:25 | <haskellbridge> | <Nexilva> | |
| 2024-04-05 21:03:26 | <haskellbridge> | <Nexilva> 87 | matchesPattern s = s =~ "Windows 10 P2V Original Clone [^ ]+ - Oracle VM VirtualBox : [0-9]+" |
| 2024-04-05 21:03:28 | <haskellbridge> | <Nexilva> ``` |
| 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> | <Nexilva> Ok it compiles now |
| 2024-04-05 21:05:42 | <haskellbridge> | <Nexilva> $ xmonad --recompile |
| 2024-04-05 21:05:43 | <haskellbridge> | <Nexilva> XMonad will use stack ghc --stack-yaml "/home/stoned/.config/xmonad/stack.yaml" to recompile. |
| 2024-04-05 21:05:44 | <haskellbridge> | <Nexilva> XMonad recompiling (forced). |
| 2024-04-05 21:05:46 | <haskellbridge> | <Nexilva> 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> | <Nexilva> I have no idea what is happening 🙂 |
| 2024-04-05 21:06:52 | <haskellbridge> | <Nexilva> 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> | <Nexilva> ``` |
| 2024-04-05 21:07:37 | <haskellbridge> | <Nexilva> -- Sort Virtual Machines into separate workspaces |
| 2024-04-05 21:07:39 | <haskellbridge> | <Nexilva> , 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> | <Nexilva> , 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> | <Nexilva> ``` |
| 2024-04-05 21:07:43 | <haskellbridge> | <Nexilva> I'm using this, what you said |
| 2024-04-05 21:07:58 | <haskellbridge> | <Nexilva> 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> | <Nexilva> ``` |
| 2024-04-05 21:08:57 | <haskellbridge> | <Nexilva> WM_NAME(STRING) = "Windows 10 P2V Original Clone 1 (Working, before update.) [Running] - Oracle VM VirtualBox : 1" |
| 2024-04-05 21:08:58 | <haskellbridge> | <Nexilva> _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> | <Nexilva> ``` |
| 2024-04-05 21:09:11 | <geekosaur> | so get rid of the `className =? "VirtualBox Manager" <&&> ` part |
| 2024-04-05 21:09:24 | <haskellbridge> | <Nexilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-A` |
| 2024-04-05 21:09:24 | <haskellbridge> | <Nexilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-B` |
| 2024-04-05 21:09:25 | <haskellbridge> | <Nexilva> How do to this? |
| 2024-04-05 21:09:27 | <haskellbridge> | <Nexilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-A` |
| 2024-04-05 21:09:28 | <haskellbridge> | <Nexilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-B` |
| 2024-04-05 21:09:29 | <haskellbridge> | <Nexilva> How do to this? |
| 2024-04-05 21:09:30 | <haskellbridge> | <Nexilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-A\` |
| 2024-04-05 21:09:32 | <haskellbridge> | <Nexilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 2` to 8:win-B\` |
| 2024-04-05 21:09:33 | <haskellbridge> | <Nexilva> How do to this? |
| 2024-04-05 21:09:35 | <haskellbridge> | <Nexilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 1` to 8:win-A\` |
| 2024-04-05 21:09:36 | <haskellbridge> | <Nexilva> `Windows 10 P2V Original Clone ... - Oracle VM VirtualBox : 2` to 8:win-B\` |
| 2024-04-05 21:09:37 | <haskellbridge> | <Nexilva> 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> | <Nexilva> 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> | <Nexilva> Thank you |
| 2024-04-05 21:15:28 | <haskellbridge> | <Nexilva> I didn't use any GPT stuff |
| 2024-04-05 21:15:38 | <haskellbridge> | <Nexilva> I used it to learn how to install the text regex package |
| 2024-04-05 21:16:00 | <haskellbridge> | <Nexilva> But I used your suggestions. I trust you far more over the years than GPT |
| 2024-04-05 21:16:11 | <haskellbridge> | <Nexilva> 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> | <Nexilva> "VirtualBox Manager" is moved to desktop 5, and "VirtualBox Machine" to 8-A/B |
| 2024-04-05 23:18:21 | <haskellbridge> | <Nexilva> "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> | <Nexilva> I didn't realize the name changed |
| 2024-04-05 23:19:43 | <haskellbridge> | <Nexilva> 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.