Compare commits
5 commits
79fd67e916
...
365eb1e164
Author | SHA1 | Date | |
---|---|---|---|
Nox Sluijtman | 365eb1e164 | ||
Nox Sluijtman | 4741bfad3c | ||
Nox Sluijtman | eab3a5f5e9 | ||
Nox Sluijtman | 51328b664d | ||
Nox Sluijtman | bb3007d53f |
5
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
.hugo_build.lock
|
.hugo_build.lock
|
||||||
public
|
src/public
|
||||||
voidcruiser.nl
|
src/voidcruiser.nl
|
||||||
.direnv
|
.direnv
|
||||||
|
result
|
||||||
|
|
6
.gitmodules
vendored
|
@ -1,3 +1,3 @@
|
||||||
[submodule "themes/vugo"]
|
[submodule "src/themes"]
|
||||||
path = themes/vugo
|
path = src/themes
|
||||||
url = gitlab:EternalWanderer/vugo.git
|
url = gitlab:EternalWanderer/themes.git
|
||||||
|
|
27
flake.lock
|
@ -20,16 +20,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696983906,
|
"lastModified": 1707347730,
|
||||||
"narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=",
|
"narHash": "sha256-0etC/exQIaqC9vliKhc3eZE2Mm2wgLa0tj93ZF/egvM=",
|
||||||
"owner": "NixOs",
|
"owner": "NixOs",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bd1cde45c77891214131cbbea5b1203e485a9d51",
|
"rev": "6832d0d99649db3d65a0e15fa51471537b2c56a6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOs",
|
"owner": "NixOs",
|
||||||
"ref": "nixos-23.05",
|
"ref": "nixos-23.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,8 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"themes": "themes"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
@ -54,6 +55,22 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"themes": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1707594839,
|
||||||
|
"narHash": "sha256-VeoBv8LfsTLGSoGpiNlC8gd79xd4InG+bAC6TkBCSHw=",
|
||||||
|
"owner": "EternalWanderer",
|
||||||
|
"repo": "themes",
|
||||||
|
"rev": "53560c95d3bd33362e5552cb9efeaf8234724868",
|
||||||
|
"type": "gitlab"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "EternalWanderer",
|
||||||
|
"repo": "themes",
|
||||||
|
"type": "gitlab"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
14
flake.nix
|
@ -1,9 +1,13 @@
|
||||||
{ description = "Website flake";
|
{ description = "Voidcruiser website";
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOs/nixpkgs/nixos-23.05";
|
nixpkgs.url = "github:NixOs/nixpkgs/nixos-23.11";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
themes = {
|
||||||
|
url = "gitlab:EternalWanderer/themes";
|
||||||
|
flake = false;
|
||||||
};
|
};
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
};
|
||||||
|
outputs = { self, nixpkgs, flake-utils, themes }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
@ -13,12 +17,12 @@
|
||||||
|
|
||||||
pname = "voidcruiser";
|
pname = "voidcruiser";
|
||||||
version = "1.3";
|
version = "1.3";
|
||||||
src = ./.;
|
src = ./src;
|
||||||
|
|
||||||
buildInputs = [ pkgs.hugo ];
|
buildInputs = [ pkgs.hugo ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
hugo
|
hugo --themesDir="${themes.outPath}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
|
91
src/content/rambles/xmonad-bits.md
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
---
|
||||||
|
title: "Xmonad Configuration Bits"
|
||||||
|
date: "2023-09-13T16:47:48+02:00"
|
||||||
|
author: "$HUMANOID"
|
||||||
|
tags: ["xmonad", "haskell"]
|
||||||
|
description: "A few interesting things I've done with my XMonad config"
|
||||||
|
---
|
||||||
|
|
||||||
|
So the other day I was hacking some more on my XMonad config and came across a
|
||||||
|
few quirks that I don't think I've seen other people implement in their configs.
|
||||||
|
Though truth be told, I haven't really looked at a lot of other people's config
|
||||||
|
files.
|
||||||
|
|
||||||
|
> "Where is your config file anyway?"
|
||||||
|
|
||||||
|
Haven't published it yet as it's still a huge mess of half baked Haskell
|
||||||
|
snippets.
|
||||||
|
|
||||||
|
## Complex terminal sessions
|
||||||
|
|
||||||
|
I use [Kitty](https://sw.kovidgoyal.net/kitty/) as my terminal. It's amazing and
|
||||||
|
probably warrants its own article one day. One of the really cool features is
|
||||||
|
that it allows you to override options on launch with the `-o` or `--override`
|
||||||
|
parameter. This allows you to change any of the values in your `kitty.conf`,
|
||||||
|
this includes the font and colour pallet.
|
||||||
|
|
||||||
|
I've been using this to start terminals with
|
||||||
|
[BQN](https://mlochbaum.github.io/BQN/) compatible font.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
kitty -o font_size=17 -o font_family='BQN386 Unicode' -e bqn
|
||||||
|
```
|
||||||
|
|
||||||
|
This works great and I assigned it to a keybinding for a while. However, some
|
||||||
|
time later I decided to check out [R](https://www.r-project.org/) and wanted to
|
||||||
|
have a similar keybinding with slightly different options. Here it dawned on me
|
||||||
|
that it would be silly to copy-paste the BQN keybinding and change a few things,
|
||||||
|
so I abstracted that away into a function that takes a list of options and feeds
|
||||||
|
that to Kitty.
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
runInKittyWithOpts :: [String] -> String -> X ()
|
||||||
|
runInKittyWithOpts opts executable = spawn $ "kitty "
|
||||||
|
++ (unwords . map ("-o " ++)) opts
|
||||||
|
++ " -e " ++ executable
|
||||||
|
```
|
||||||
|
|
||||||
|
If I now want to start a kitty session with a BQN font and R repl, I can add
|
||||||
|
something like the following to a keybinding:
|
||||||
|
```haskell
|
||||||
|
runInKittyWithOpts rOptions "R"
|
||||||
|
where rOptions = [ "font_size=17"
|
||||||
|
, "font_family='BQN386 Unicode'"
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Since I write quite a bit, I also have a kitty session with a giant margin left
|
||||||
|
and right of the "terminal" section of the window as that empty space helps me
|
||||||
|
concentrate. All this is, is the previous function without the `-e` parameter:
|
||||||
|
```haskell
|
||||||
|
kittyWithOpts :: [String] -> X ()
|
||||||
|
kittyWithOpts opts = spawn $ "kitty "
|
||||||
|
++ (unwords . map ("-o " ++)) opts
|
||||||
|
```
|
||||||
|
Though I didn't let that stop me from golfing it down to a point free version:
|
||||||
|
```haskell
|
||||||
|
kittyWithOpts :: [String] -> X ()
|
||||||
|
kittyWithOpts = spawn . ("kitty " ++) . (unwords . map ("-o " ++))
|
||||||
|
```
|
||||||
|
My prefered settings for a "text hole" terminal.
|
||||||
|
```haskell
|
||||||
|
kittyWithOpts [ "font_family='BQN386 Unicode'"
|
||||||
|
, "font_size=14"
|
||||||
|
, "single_window_margin_width='5 200'"
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
If I were to implement this properly, I would make a kitty module with all
|
||||||
|
options in DataType. But alas, I'm not patient/bored enough for that... yet.
|
||||||
|
|
||||||
|
## Mouse bindings
|
||||||
|
|
||||||
|
I thought it would be neat to be able to scroll up and down while holding my
|
||||||
|
modifier key to change my screen brightness and audio levels. The basic concept
|
||||||
|
here was quite simple; us a lambda function that chucks whatever data it gets
|
||||||
|
onto the ground because the type signature for mousebindings forces you to deal
|
||||||
|
with a focussed window.
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
, ((modMask, button4), \_ -> safeSpawn "pulsemixer" ["--change-volume","+1"])
|
||||||
|
```
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 446 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
1
src/themes
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 53560c95d3bd33362e5552cb9efeaf8234724868
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 8a0e6fc8f845ea5cf6115a9100893e82e64cc3f3
|
|