Compare commits

..

5 commits

Author SHA1 Message Date
Nox Sluijtman 365eb1e164 Move to src dir -- followup 2024-02-10 21:26:57 +01:00
Nox Sluijtman 4741bfad3c aha... 2024-02-10 21:24:42 +01:00
Nox Sluijtman eab3a5f5e9 hmmm... 2024-02-10 21:24:04 +01:00
Nox Sluijtman 51328b664d Flake build 2024-02-10 21:20:06 +01:00
Nox Sluijtman bb3007d53f Move to src dir 2024-02-10 21:03:20 +01:00
54 changed files with 129 additions and 16 deletions

5
.gitignore vendored
View file

@ -1,4 +1,5 @@
.hugo_build.lock
public
voidcruiser.nl
src/public
src/voidcruiser.nl
.direnv
result

6
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "themes/vugo"]
path = themes/vugo
url = gitlab:EternalWanderer/vugo.git
[submodule "src/themes"]
path = src/themes
url = gitlab:EternalWanderer/themes.git

View file

@ -20,16 +20,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1696983906,
"narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=",
"lastModified": 1707347730,
"narHash": "sha256-0etC/exQIaqC9vliKhc3eZE2Mm2wgLa0tj93ZF/egvM=",
"owner": "NixOs",
"repo": "nixpkgs",
"rev": "bd1cde45c77891214131cbbea5b1203e485a9d51",
"rev": "6832d0d99649db3d65a0e15fa51471537b2c56a6",
"type": "github"
},
"original": {
"owner": "NixOs",
"ref": "nixos-23.05",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
@ -37,7 +37,8 @@
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"themes": "themes"
}
},
"systems": {
@ -54,6 +55,22 @@
"repo": "default",
"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",

View file

@ -1,9 +1,13 @@
{ description = "Website flake";
{ description = "Voidcruiser website";
inputs = {
nixpkgs.url = "github:NixOs/nixpkgs/nixos-23.05";
nixpkgs.url = "github:NixOs/nixpkgs/nixos-23.11";
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:
let
pkgs = import nixpkgs { inherit system; };
@ -13,12 +17,12 @@
pname = "voidcruiser";
version = "1.3";
src = ./.;
src = ./src;
buildInputs = [ pkgs.hugo ];
buildPhase = ''
hugo
hugo --themesDir="${themes.outPath}"
'';
installPhase = ''

View 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"])
```

View file

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 446 B

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

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