diff options
| author | vin <git@vineetk.net> | 2024-08-11 22:53:00 -0400 |
|---|---|---|
| committer | vin <git@vineetk.net> | 2024-08-11 22:53:00 -0400 |
| commit | 4ca5331ace5cd78844079f4163fec0024671f0bd (patch) | |
| tree | d7204771f675c524e13b83e651630fab5ad8b7cd /home.nix | |
| parent | 4f94a3d13ff3c8aa56b3143048a37790fd971ba6 (diff) | |
add my i3 config
Diffstat (limited to 'home.nix')
| -rw-r--r-- | home.nix | 157 |
1 files changed, 155 insertions, 2 deletions
| @@ -1,4 +1,4 @@ | |||
| 1 | { config, pkgs, ... }: | 1 | { config, lib, pkgs, ... }: |
| 2 | 2 | ||
| 3 | { | 3 | { |
| 4 | home = { | 4 | home = { |
| @@ -10,19 +10,22 @@ | |||
| 10 | aerc | 10 | aerc |
| 11 | age | 11 | age |
| 12 | alacritty # doing st/suckless declaratively seems like it'll suck | 12 | alacritty # doing st/suckless declaratively seems like it'll suck |
| 13 | dmenu | ||
| 13 | doas | 14 | doas |
| 15 | hsetroot | ||
| 14 | kicad | 16 | kicad |
| 15 | librewolf | 17 | librewolf |
| 16 | loksh | ||
| 17 | mpv | 18 | mpv |
| 18 | mupdf | 19 | mupdf |
| 19 | neofetch | 20 | neofetch |
| 20 | profanity | 21 | profanity |
| 21 | rclone | 22 | rclone |
| 22 | redshift | 23 | redshift |
| 24 | st | ||
| 23 | tmux | 25 | tmux |
| 24 | transmission_4 | 26 | transmission_4 |
| 25 | tree | 27 | tree |
| 28 | xdotool | ||
| 26 | ]; | 29 | ]; |
| 27 | 30 | ||
| 28 | preferXdgDirectories = true; | 31 | preferXdgDirectories = true; |
| @@ -366,4 +369,154 @@ | |||
| 366 | videos = "$HOME/"; | 369 | videos = "$HOME/"; |
| 367 | }; | 370 | }; |
| 368 | }; | 371 | }; |
| 372 | |||
| 373 | xsession = { | ||
| 374 | enable = true; | ||
| 375 | windowManager.i3 = { | ||
| 376 | enable = true; | ||
| 377 | config = { | ||
| 378 | # TODO import nix file that defines colorscheme | ||
| 379 | bars = [ { | ||
| 380 | colors = { | ||
| 381 | background = "#0e0c06"; | ||
| 382 | statusline = "#d4b782"; | ||
| 383 | focusedWorkspace = { | ||
| 384 | background = "#1b1918"; | ||
| 385 | border = "#1b1918"; | ||
| 386 | text = "#d4b782"; | ||
| 387 | }; | ||
| 388 | activeWorkspace = { | ||
| 389 | background = "#0e0c06"; | ||
| 390 | border = "#1b1918"; | ||
| 391 | text = "#d4b782"; | ||
| 392 | }; | ||
| 393 | inactiveWorkspace = { | ||
| 394 | background = "#0e0c06"; | ||
| 395 | border = "#0e0c06"; | ||
| 396 | text = "#cfb688"; | ||
| 397 | }; | ||
| 398 | }; | ||
| 399 | command = "${pkgs.i3}/bin/i3bar"; | ||
| 400 | position = "top"; | ||
| 401 | statusCommand = "while date +'%Y-%m-%d %X'; do sleep 1; done"; | ||
| 402 | } ]; | ||
| 403 | colors = { | ||
| 404 | focused = { | ||
| 405 | background = "#0e0c06"; | ||
| 406 | border = "#0e0c06"; | ||
| 407 | childBorder = "#0e0c06"; | ||
| 408 | indicator = "#1b1918"; | ||
| 409 | text = "#d4b782"; | ||
| 410 | }; | ||
| 411 | focusedInactive = { | ||
| 412 | background = "#0e0c06"; | ||
| 413 | border = "#0e0c06"; | ||
| 414 | childBorder = "#0e0c06"; | ||
| 415 | indicator = "#1b1918"; | ||
| 416 | text = "#cfb688"; | ||
| 417 | }; | ||
| 418 | unfocused = { | ||
| 419 | background = "#1b1918"; | ||
| 420 | border = "#1b1918"; | ||
| 421 | childBorder = "#1b1918"; | ||
| 422 | indicator = "#0e0c06"; | ||
| 423 | text = "#cfb688"; | ||
| 424 | }; | ||
| 425 | }; | ||
| 426 | focus.mouseWarping = true; | ||
| 427 | fonts = { | ||
| 428 | names = [ "monospace" ]; | ||
| 429 | size = 11.0; | ||
| 430 | }; | ||
| 431 | keybindings = | ||
| 432 | let | ||
| 433 | left = "n"; | ||
| 434 | down = "e"; | ||
| 435 | up = "o"; | ||
| 436 | right = "i"; | ||
| 437 | modifier = config.xsession.windowManager.i3.config.modifier; | ||
| 438 | menu = config.xsession.windowManager.i3.config.menu; | ||
| 439 | terminal = config.xsession.windowManager.i3.config.terminal; | ||
| 440 | warpmouse = "exec eval $(xdotool getwindowfocus getwindowgeometry --shell) && xdotool mousemove --window $(xdotool getwindowfocus) $((WIDTH/2)) $((HEIGHT/2))"; | ||
| 441 | in lib.mkOptionDefault { | ||
| 442 | "${modifier}+Return" = "exec ${terminal}"; | ||
| 443 | "${modifier}+p" = "exec ${menu}"; | ||
| 444 | "${modifier}+b" = "exec bm t"; | ||
| 445 | "${modifier}+Shift+b" = "exec angoumenu"; | ||
| 446 | |||
| 447 | "${modifier}+Shift+q" = "kill"; | ||
| 448 | "${modifier}+Shift+c" = "reload"; | ||
| 449 | "Mod1+Mod4+Ctrl+Shift+e" = "exit"; | ||
| 450 | |||
| 451 | "${modifier}+${left}" = "focus left; ${warpmouse}"; | ||
| 452 | "${modifier}+${down}" = "focus down; ${warpmouse}"; | ||
| 453 | "${modifier}+${up}" = "focus up; ${warpmouse}"; | ||
| 454 | "${modifier}+${right}" = "focus right; ${warpmouse}"; | ||
| 455 | "${modifier}+Shift+${left}" = "move left"; | ||
| 456 | "${modifier}+Shift+${down}" = "move down"; | ||
| 457 | "${modifier}+Shift+${up}" = "move up"; | ||
| 458 | "${modifier}+Shift+${right}" = "move right"; | ||
| 459 | |||
| 460 | # TODO do this programatically | ||
| 461 | "${modifier}+1" = "workspace number 1"; | ||
| 462 | "${modifier}+2" = "workspace number 2"; | ||
| 463 | "${modifier}+3" = "workspace number 3"; | ||
| 464 | "${modifier}+4" = "workspace number 4"; | ||
| 465 | "${modifier}+5" = "workspace number 5"; | ||
| 466 | "${modifier}+6" = "workspace number 6"; | ||
| 467 | "${modifier}+7" = "workspace number 7"; | ||
| 468 | "${modifier}+8" = "workspace number 8"; | ||
| 469 | "${modifier}+9" = "workspace number 9"; | ||
| 470 | "${modifier}+0" = "workspace number 0"; | ||
| 471 | "${modifier}+Shift+1" = "move container to workspace number 1"; | ||
| 472 | "${modifier}+Shift+2" = "move container to workspace number 2"; | ||
| 473 | "${modifier}+Shift+3" = "move container to workspace number 3"; | ||
| 474 | "${modifier}+Shift+4" = "move container to workspace number 4"; | ||
| 475 | "${modifier}+Shift+5" = "move container to workspace number 5"; | ||
| 476 | "${modifier}+Shift+6" = "move container to workspace number 6"; | ||
| 477 | "${modifier}+Shift+7" = "move container to workspace number 7"; | ||
| 478 | "${modifier}+Shift+8" = "move container to workspace number 8"; | ||
| 479 | "${modifier}+Shift+9" = "move container to workspace number 9"; | ||
| 480 | "${modifier}+Shift+0" = "move container to workspace number 0"; | ||
| 481 | |||
| 482 | "${modifier}+Ctrl+Shift+b" = "splith"; | ||
| 483 | "${modifier}+Ctrl+Shift+v" = "splitv"; | ||
| 484 | "${modifier}+s" = "layout stacking"; | ||
| 485 | "${modifier}+t" = "layout tabbed"; | ||
| 486 | "${modifier}+Shift+t" = "layout toggle split"; | ||
| 487 | "${modifier}+Shift+f" = "fullscreen"; | ||
| 488 | "${modifier}+Shift+space" = "floating toggle"; | ||
| 489 | "${modifier}+space" = "focus mode_toggle"; | ||
| 490 | "${modifier}+a" = "focus parent"; | ||
| 491 | |||
| 492 | "${modifier}+r" = "mode resize"; | ||
| 493 | }; | ||
| 494 | menu = "dmenu_run"; | ||
| 495 | modes.resize = | ||
| 496 | let | ||
| 497 | left = "n"; | ||
| 498 | down = "e"; | ||
| 499 | up = "o"; | ||
| 500 | right = "i"; | ||
| 501 | in lib.mkOptionDefault { | ||
| 502 | ${left} = "resize shrink width 10px"; | ||
| 503 | ${down} = "resize grow height 10px"; | ||
| 504 | ${up} = "resize shrink width 10px"; | ||
| 505 | ${right} = "resize grow width 10px"; | ||
| 506 | Escape = "mode default"; | ||
| 507 | }; | ||
| 508 | modifier = "Mod4"; | ||
| 509 | startup = [ | ||
| 510 | { command = "picom"; always = true; notification = false; } | ||
| 511 | { command = "hsetroot -cover pics/wp/zvezdy-kosmos-korabl-art-fantastika-battleship-dmitrii-ustin_ultrawide.jpg >/dev/null"; notification = false; } | ||
| 512 | ]; | ||
| 513 | terminal = "alacritty"; | ||
| 514 | window = { | ||
| 515 | border = 0; | ||
| 516 | titlebar = false; | ||
| 517 | }; | ||
| 518 | workspaceAutoBackAndForth = true; | ||
| 519 | }; | ||
| 520 | }; | ||
| 521 | }; | ||
| 369 | } | 522 | } |
