(focused xproto.ButtonPressEvent)
| 418 | } |
| 419 | |
| 420 | func (wm *WindowManager) reload(focused xproto.ButtonPressEvent) { |
| 421 | // set the mod key for the wm |
| 422 | var mMask uint16 |
| 423 | switch wm.config.ModKey { |
| 424 | case "Mod1": |
| 425 | mMask = xproto.ModMask1 |
| 426 | case "Mod2": |
| 427 | mMask = xproto.ModMask2 |
| 428 | case "Mod3": |
| 429 | mMask = xproto.ModMask3 |
| 430 | case "Mod4": |
| 431 | mMask = xproto.ModMask4 |
| 432 | case "Mod5": |
| 433 | mMask = xproto.ModMask5 |
| 434 | } |
| 435 | |
| 436 | wm.mod = mMask |
| 437 | |
| 438 | // manage keybinds for keybinds in the config |
| 439 | for i, kb := range wm.config.Keybinds { |
| 440 | wm.config.Keybinds[i] = wm.createKeybind(&kb) |
| 441 | } |
| 442 | |
| 443 | // workspace keybinds, ik not very idiomatic but its fine :) |
| 444 | wm.config.Keybinds = append(wm.config.Keybinds, []Keybind{ |
| 445 | wm.createKeybind(&Keybind{Key: "0", Shift: false, Keycode: 0}), |
| 446 | wm.createKeybind(&Keybind{Key: "1", Shift: false, Keycode: 0}), |
| 447 | wm.createKeybind(&Keybind{Key: "2", Shift: false, Keycode: 0}), |
| 448 | wm.createKeybind(&Keybind{Key: "3", Shift: false, Keycode: 0}), |
| 449 | wm.createKeybind(&Keybind{Key: "4", Shift: false, Keycode: 0}), |
| 450 | wm.createKeybind(&Keybind{Key: "5", Shift: false, Keycode: 0}), |
| 451 | wm.createKeybind(&Keybind{Key: "6", Shift: false, Keycode: 0}), |
| 452 | wm.createKeybind(&Keybind{Key: "7", Shift: false, Keycode: 0}), |
| 453 | wm.createKeybind(&Keybind{Key: "8", Shift: false, Keycode: 0}), |
| 454 | wm.createKeybind(&Keybind{Key: "9", Shift: false, Keycode: 0}), |
| 455 | wm.createKeybind(&Keybind{Key: "0", Shift: true, Keycode: 0}), |
| 456 | wm.createKeybind(&Keybind{Key: "1", Shift: true, Keycode: 0}), |
| 457 | wm.createKeybind(&Keybind{Key: "2", Shift: true, Keycode: 0}), |
| 458 | wm.createKeybind(&Keybind{Key: "3", Shift: true, Keycode: 0}), |
| 459 | wm.createKeybind(&Keybind{Key: "4", Shift: true, Keycode: 0}), |
| 460 | wm.createKeybind(&Keybind{Key: "5", Shift: true, Keycode: 0}), |
| 461 | wm.createKeybind(&Keybind{Key: "6", Shift: true, Keycode: 0}), |
| 462 | wm.createKeybind(&Keybind{Key: "7", Shift: true, Keycode: 0}), |
| 463 | wm.createKeybind(&Keybind{Key: "8", Shift: true, Keycode: 0}), |
| 464 | wm.createKeybind(&Keybind{Key: "9", Shift: true, Keycode: 0}), |
| 465 | }...) |
| 466 | |
| 467 | windowsParent, err := xproto.QueryTree(wm.conn, wm.root).Reply() |
| 468 | if err != nil { |
| 469 | return |
| 470 | } |
| 471 | windows := windowsParent.Children |
| 472 | fmt.Println("windows:", windows) |
| 473 | fmt.Println("new border width:", wm.config.BorderWidth) |
| 474 | |
| 475 | for _, window := range windows { |
| 476 | if win, ok := wm.windows[window]; ok && !win.Fullscreen { |
| 477 | col := wm.config.BorderUnactive |
no test coverage detected