diff --git a/.gitignore b/.gitignore index e820acc..e9853ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .hugo_build.lock -public -voidcruiser.nl +src/public +src/voidcruiser.nl .direnv +result diff --git a/.gitmodules b/.gitmodules index b030574..3afb3cb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/flake.lock b/flake.lock index 6ccd9e6..886e55b 100644 --- a/flake.lock +++ b/flake.lock @@ -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", diff --git a/flake.nix b/flake.nix index df41ed1..139c49c 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = '' diff --git a/archetypes/default.md b/src/archetypes/default.md similarity index 100% rename from archetypes/default.md rename to src/archetypes/default.md diff --git a/archetypes/rambles/default.md b/src/archetypes/rambles/default.md similarity index 100% rename from archetypes/rambles/default.md rename to src/archetypes/rambles/default.md diff --git a/config.toml b/src/config.toml similarity index 100% rename from config.toml rename to src/config.toml diff --git a/content/_index.md b/src/content/_index.md similarity index 100% rename from content/_index.md rename to src/content/_index.md diff --git a/content/about.md b/src/content/about.md similarity index 100% rename from content/about.md rename to src/content/about.md diff --git a/content/ideas.md b/src/content/ideas.md similarity index 100% rename from content/ideas.md rename to src/content/ideas.md diff --git a/content/insanity.md b/src/content/insanity.md similarity index 100% rename from content/insanity.md rename to src/content/insanity.md diff --git a/content/rambles/adblock.md b/src/content/rambles/adblock.md similarity index 100% rename from content/rambles/adblock.md rename to src/content/rambles/adblock.md diff --git a/content/rambles/browsers.md b/src/content/rambles/browsers.md similarity index 100% rename from content/rambles/browsers.md rename to src/content/rambles/browsers.md diff --git a/content/rambles/emergent-mechanics.md b/src/content/rambles/emergent-mechanics.md similarity index 100% rename from content/rambles/emergent-mechanics.md rename to src/content/rambles/emergent-mechanics.md diff --git a/content/rambles/git-server.md b/src/content/rambles/git-server.md similarity index 100% rename from content/rambles/git-server.md rename to src/content/rambles/git-server.md diff --git a/content/rambles/hugo.md b/src/content/rambles/hugo.md similarity index 100% rename from content/rambles/hugo.md rename to src/content/rambles/hugo.md diff --git a/content/rambles/i2p-on-nixos.md b/src/content/rambles/i2p-on-nixos.md similarity index 100% rename from content/rambles/i2p-on-nixos.md rename to src/content/rambles/i2p-on-nixos.md diff --git a/content/rambles/mpd-and-icecast-on-nix.md b/src/content/rambles/mpd-and-icecast-on-nix.md similarity index 100% rename from content/rambles/mpd-and-icecast-on-nix.md rename to src/content/rambles/mpd-and-icecast-on-nix.md diff --git a/content/rambles/nix-home-manager.md b/src/content/rambles/nix-home-manager.md similarity index 100% rename from content/rambles/nix-home-manager.md rename to src/content/rambles/nix-home-manager.md diff --git a/content/rambles/nix-on-other-distros-packagemanagers.md b/src/content/rambles/nix-on-other-distros-packagemanagers.md similarity index 100% rename from content/rambles/nix-on-other-distros-packagemanagers.md rename to src/content/rambles/nix-on-other-distros-packagemanagers.md diff --git a/content/rambles/nixvim.md b/src/content/rambles/nixvim.md similarity index 100% rename from content/rambles/nixvim.md rename to src/content/rambles/nixvim.md diff --git a/content/rambles/orca.md b/src/content/rambles/orca.md similarity index 100% rename from content/rambles/orca.md rename to src/content/rambles/orca.md diff --git a/content/rambles/pwr-switch.md b/src/content/rambles/pwr-switch.md similarity index 100% rename from content/rambles/pwr-switch.md rename to src/content/rambles/pwr-switch.md diff --git a/content/rambles/ssh.md b/src/content/rambles/ssh.md similarity index 100% rename from content/rambles/ssh.md rename to src/content/rambles/ssh.md diff --git a/content/rambles/vim.md b/src/content/rambles/vim.md similarity index 100% rename from content/rambles/vim.md rename to src/content/rambles/vim.md diff --git a/content/rambles/windowmanagers.md b/src/content/rambles/windowmanagers.md similarity index 100% rename from content/rambles/windowmanagers.md rename to src/content/rambles/windowmanagers.md diff --git a/src/content/rambles/xmonad-bits.md b/src/content/rambles/xmonad-bits.md new file mode 100644 index 0000000..9f492fe --- /dev/null +++ b/src/content/rambles/xmonad-bits.md @@ -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"]) +``` diff --git a/content/rambles/xmonad-prompts.md b/src/content/rambles/xmonad-prompts.md similarity index 100% rename from content/rambles/xmonad-prompts.md rename to src/content/rambles/xmonad-prompts.md diff --git a/content/services.md b/src/content/services.md similarity index 100% rename from content/services.md rename to src/content/services.md diff --git a/layouts/_default/index.html b/src/layouts/_default/index.html similarity index 100% rename from layouts/_default/index.html rename to src/layouts/_default/index.html diff --git a/layouts/partials/footer.html b/src/layouts/partials/footer.html similarity index 100% rename from layouts/partials/footer.html rename to src/layouts/partials/footer.html diff --git a/layouts/partials/stickers.html b/src/layouts/partials/stickers.html similarity index 100% rename from layouts/partials/stickers.html rename to src/layouts/partials/stickers.html diff --git a/layouts/shortcodes/about.html b/src/layouts/shortcodes/about.html similarity index 100% rename from layouts/shortcodes/about.html rename to src/layouts/shortcodes/about.html diff --git a/static/audio/aaaaanvil.flac b/src/static/audio/aaaaanvil.flac similarity index 100% rename from static/audio/aaaaanvil.flac rename to src/static/audio/aaaaanvil.flac diff --git a/static/audio/insanity.wav b/src/static/audio/insanity.wav similarity index 100% rename from static/audio/insanity.wav rename to src/static/audio/insanity.wav diff --git a/static/audio/orca/climb.flac b/src/static/audio/orca/climb.flac similarity index 100% rename from static/audio/orca/climb.flac rename to src/static/audio/orca/climb.flac diff --git a/static/audio/orca/fall.flac b/src/static/audio/orca/fall.flac similarity index 100% rename from static/audio/orca/fall.flac rename to src/static/audio/orca/fall.flac diff --git a/static/audio/orca/plinkinator.flac b/src/static/audio/orca/plinkinator.flac similarity index 100% rename from static/audio/orca/plinkinator.flac rename to src/static/audio/orca/plinkinator.flac diff --git a/static/audio/orca/varied_plinkinator.flac b/src/static/audio/orca/varied_plinkinator.flac similarity index 100% rename from static/audio/orca/varied_plinkinator.flac rename to src/static/audio/orca/varied_plinkinator.flac diff --git a/static/images/config_length.png b/src/static/images/config_length.png similarity index 100% rename from static/images/config_length.png rename to src/static/images/config_length.png diff --git a/static/images/graphs/radio.png b/src/static/images/graphs/radio.png similarity index 100% rename from static/images/graphs/radio.png rename to src/static/images/graphs/radio.png diff --git a/static/images/xkcd/borrow_your_laptop.png b/src/static/images/xkcd/borrow_your_laptop.png similarity index 100% rename from static/images/xkcd/borrow_your_laptop.png rename to src/static/images/xkcd/borrow_your_laptop.png diff --git a/static/keys/alpine@voidcruiser.nl.rsa.pub b/src/static/keys/alpine@voidcruiser.nl.rsa.pub similarity index 100% rename from static/keys/alpine@voidcruiser.nl.rsa.pub rename to src/static/keys/alpine@voidcruiser.nl.rsa.pub diff --git a/static/keys/gpg.asc b/src/static/keys/gpg.asc similarity index 100% rename from static/keys/gpg.asc rename to src/static/keys/gpg.asc diff --git a/static/stickers/4nobody.gif b/src/static/stickers/4nobody.gif similarity index 100% rename from static/stickers/4nobody.gif rename to src/static/stickers/4nobody.gif diff --git a/static/stickers/80x15.png b/src/static/stickers/80x15.png similarity index 100% rename from static/stickers/80x15.png rename to src/static/stickers/80x15.png diff --git a/static/stickers/cc4.png b/src/static/stickers/cc4.png similarity index 100% rename from static/stickers/cc4.png rename to src/static/stickers/cc4.png diff --git a/static/stickers/edited-with-vim_banner.gif b/src/static/stickers/edited-with-vim_banner.gif similarity index 100% rename from static/stickers/edited-with-vim_banner.gif rename to src/static/stickers/edited-with-vim_banner.gif diff --git a/static/stickers/nonazis.png b/src/static/stickers/nonazis.png similarity index 100% rename from static/stickers/nonazis.png rename to src/static/stickers/nonazis.png diff --git a/static/stickers/notoweb3.gif b/src/static/stickers/notoweb3.gif similarity index 100% rename from static/stickers/notoweb3.gif rename to src/static/stickers/notoweb3.gif diff --git a/static/stickers/same-shit-different-asshole_banner.gif b/src/static/stickers/same-shit-different-asshole_banner.gif similarity index 100% rename from static/stickers/same-shit-different-asshole_banner.gif rename to src/static/stickers/same-shit-different-asshole_banner.gif diff --git a/static/stickers/wiby.gif b/src/static/stickers/wiby.gif similarity index 100% rename from static/stickers/wiby.gif rename to src/static/stickers/wiby.gif diff --git a/src/themes b/src/themes new file mode 160000 index 0000000..53560c9 --- /dev/null +++ b/src/themes @@ -0,0 +1 @@ +Subproject commit 53560c95d3bd33362e5552cb9efeaf8234724868 diff --git a/themes/vugo b/themes/vugo deleted file mode 160000 index 8a0e6fc..0000000 --- a/themes/vugo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8a0e6fc8f845ea5cf6115a9100893e82e64cc3f3