Compare commits
62 commits
iusenixbtw
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
8fe9b3bb4d | ||
|
91926d5975 | ||
|
2d0db0063a | ||
|
1f14f27da7 | ||
|
0b4d60b948 | ||
|
7dbaaaf3d2 | ||
|
4701c62ce3 | ||
|
f1a42476a2 | ||
|
2aafb06e25 | ||
|
57782266e2 | ||
|
591521b585 | ||
|
b9bd40efbe | ||
|
1d76815c13 | ||
|
d30047585b | ||
|
6335946eeb | ||
|
2de387233c | ||
|
4393aafc87 | ||
|
ea3951d543 | ||
|
e660118219 | ||
|
964e01a3fa | ||
|
1eaae43e46 | ||
|
a2faa356ab | ||
|
37c58fbd2c | ||
|
11fb80639d | ||
|
96fcfeee3f | ||
|
33ae468829 | ||
|
a39a26509e | ||
|
fe08cd4141 | ||
|
381753c2a0 | ||
|
a9cf599139 | ||
|
1d3c55f3e9 | ||
|
e206492ae9 | ||
|
9fd4e4c1a5 | ||
|
2cf1863ef3 | ||
|
b6b5e0d467 | ||
|
c2aca9ce98 | ||
|
b04bc2b679 | ||
|
f990027814 | ||
|
c768c1ac7c | ||
|
412957c518 | ||
|
368de76deb | ||
|
3a5d170fe9 | ||
|
1cc3ddd9f3 | ||
|
e383427104 | ||
|
281accb59c | ||
|
257b473ae1 | ||
|
77a9fd5c11 | ||
|
c5b4569491 | ||
|
e8a3d89468 | ||
|
cc119c89d5 | ||
|
34ebd77a58 | ||
|
c578bf77d2 | ||
|
037d8df111 | ||
|
c2226d9e19 | ||
|
3d82dd30c7 | ||
afacb0eac5 | |||
1600ae6e77 | |||
|
b5b91cdd8d | ||
|
82ae92f620 | ||
|
02ef1ead52 | ||
|
a3c2e1680d | ||
|
c41263a44e |
18 changed files with 476 additions and 399 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -1,8 +1,11 @@
|
||||||
.*.swp
|
.*.swp
|
||||||
artwork
|
artwork/
|
||||||
*.hi
|
*.hi
|
||||||
*.o
|
*.o
|
||||||
|
.direnv/
|
||||||
prompt-history
|
prompt-history
|
||||||
xmonad-*-linux
|
xmonad-x86_64-linux
|
||||||
xmonad.errors
|
xmonad.errors
|
||||||
xmonad.state
|
xmonad.state
|
||||||
|
dist-newstyle
|
||||||
|
result*
|
||||||
|
|
5
CHANGELOG.md
Normal file
5
CHANGELOG.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Revision history for xmonad-config
|
||||||
|
|
||||||
|
## 0.1.0.0 -- YYYY-mm-dd
|
||||||
|
|
||||||
|
* First version. Released on an unsuspecting world.
|
2
Setup.hs
Normal file
2
Setup.hs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import Distribution.Simple
|
||||||
|
main = defaultMain
|
22
flake.lock
22
flake.lock
|
@ -1,27 +1,12 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667395993,
|
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670242877,
|
"lastModified": 1725983898,
|
||||||
"narHash": "sha256-jBLh7dRHnbfvPPA9znOC6oQfKrCPJ0El8Zoe0BqnCjQ=",
|
"narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6e51c97f1c849efdfd4f3b78a4870e6aa2da4198",
|
"rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -33,7 +18,6 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
62
flake.nix
62
flake.nix
|
@ -2,18 +2,56 @@
|
||||||
description = "Build my xmonad config";
|
description = "Build my xmonad config";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs = {
|
||||||
|
self,
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
nixpkgs,
|
||||||
let pkgs = nixpkgs.legacyPackages.${system}; in
|
}: let
|
||||||
{
|
forAllSystems = function:
|
||||||
devShells.default = import ./shell.nix { inherit pkgs; };
|
nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"] (system:
|
||||||
}) // {
|
function rec {
|
||||||
packages.aarch64-linux.default =
|
inherit system;
|
||||||
# Notice the reference to nixpkgs here.
|
compilerVersion = "ghc966";
|
||||||
with import nixpkgs { system = "aarch64-linux"; };
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
haskellPackages.callCabal2nix "xmonad-config" ./. {};
|
hsPkgs = pkgs.haskell.packages.${compilerVersion}.override {
|
||||||
|
overrides = hfinal: hprev: {
|
||||||
|
# Internal Packages
|
||||||
|
xmonad-config = hfinal.callCabal2nix "xmonad-config" ./. {};
|
||||||
|
xmonad-contrib = pkgs.haskell.lib.compose.doJailbreak (pkgs.haskell.lib.compose.overrideCabal (drv: {
|
||||||
|
version = "0.18.1";
|
||||||
|
sha256 = "sha256-BXOdIErNhNNS3slNBhiskH/zljVREjx0fu836BOGZDI=";
|
||||||
|
})
|
||||||
|
hprev.xmonad-contrib);
|
||||||
|
xmonad-extras = pkgs.haskell.lib.compose.doJailbreak (pkgs.haskell.lib.compose.overrideCabal (drv: {
|
||||||
|
version = "0.17.2";
|
||||||
|
sha256 = "sha256-KAqC6sDbvd79lhyByfbA0cYwSINJ+JkivsieUE2rm2U=";
|
||||||
|
})
|
||||||
|
hprev.xmonad-extras);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
in {
|
||||||
|
formatter = forAllSystems ({pkgs, ...}: pkgs.alejandra);
|
||||||
|
packages = forAllSystems ({hsPkgs, ...}: ({
|
||||||
|
default = hsPkgs.xmonad-config;
|
||||||
|
}));
|
||||||
|
devShells = forAllSystems ({
|
||||||
|
hsPkgs,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
default = hsPkgs.shellFor {
|
||||||
|
name = "xmonad-config";
|
||||||
|
packages = p: [
|
||||||
|
p.xmonad-config
|
||||||
|
];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
hsPkgs.haskell-language-server
|
||||||
|
hsPkgs.cabal-install
|
||||||
|
cabal2nix
|
||||||
|
haskellPackages.ghcid
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,82 +0,0 @@
|
||||||
module Catppuccin
|
|
||||||
( base
|
|
||||||
, blue
|
|
||||||
, crust
|
|
||||||
, flamingo
|
|
||||||
, green
|
|
||||||
, lavender
|
|
||||||
, mantle
|
|
||||||
, maroon
|
|
||||||
, mauve
|
|
||||||
, overlay0
|
|
||||||
, overlay1
|
|
||||||
, overlay2
|
|
||||||
, peach
|
|
||||||
, pink
|
|
||||||
, red
|
|
||||||
, rosewater
|
|
||||||
, sapphire
|
|
||||||
, sky
|
|
||||||
, subtext0
|
|
||||||
, subtext1
|
|
||||||
, surface0
|
|
||||||
, surface1
|
|
||||||
, surface2
|
|
||||||
, teal
|
|
||||||
, text
|
|
||||||
, yellow
|
|
||||||
, theme
|
|
||||||
) where
|
|
||||||
|
|
||||||
import XMonad.Layout.Decoration (Theme(..))
|
|
||||||
|
|
||||||
theme :: Theme
|
|
||||||
theme =
|
|
||||||
Theme { activeColor = mauve
|
|
||||||
, inactiveColor = surface0
|
|
||||||
, urgentColor = red
|
|
||||||
, activeBorderColor = mauve
|
|
||||||
, inactiveBorderColor = surface0
|
|
||||||
, urgentBorderColor = red
|
|
||||||
, activeBorderWidth = 1
|
|
||||||
, inactiveBorderWidth = 1
|
|
||||||
, urgentBorderWidth = 1
|
|
||||||
, activeTextColor = surface0
|
|
||||||
, inactiveTextColor = surface1
|
|
||||||
, urgentTextColor = red
|
|
||||||
, fontName = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
|
|
||||||
, decoWidth = 200
|
|
||||||
, decoHeight = 15
|
|
||||||
, windowTitleAddons = []
|
|
||||||
, windowTitleIcons = []
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Colors for the Mocha variant
|
|
||||||
-- https://raw.githubusercontent.com/catppuccin/palette/main/palette.json
|
|
||||||
-- cat palette.json|jq -rc '.mocha.colors|map ({(.name):.hex})|.[]'
|
|
||||||
base = "#1e1e2e"
|
|
||||||
blue = "#89b4fa"
|
|
||||||
crust = "#11111b"
|
|
||||||
flamingo = "#f2cdcd"
|
|
||||||
green = "#a6e3a1"
|
|
||||||
lavender = "#b4befe"
|
|
||||||
mantle = "#181825"
|
|
||||||
maroon = "#eba0ac"
|
|
||||||
mauve = "#cba6f7"
|
|
||||||
overlay0 = "#6c7086"
|
|
||||||
overlay1 = "#7f849c"
|
|
||||||
overlay2 = "#9399b2"
|
|
||||||
peach = "#fab387"
|
|
||||||
pink = "#f5c2e7"
|
|
||||||
red = "#f38ba8"
|
|
||||||
rosewater = "#f5e0dc"
|
|
||||||
sapphire = "#74c7ec"
|
|
||||||
sky = "#89dceb"
|
|
||||||
subtext0 = "#a6adc8"
|
|
||||||
subtext1 = "#bac2de"
|
|
||||||
surface0 = "#313244"
|
|
||||||
surface1 = "#45475a"
|
|
||||||
surface2 = "#585b70"
|
|
||||||
teal = "#94e2d5"
|
|
||||||
text = "#cdd6f4"
|
|
||||||
yellow = "#f9e2af"
|
|
|
@ -11,7 +11,6 @@ import Graphics.X11.Types
|
||||||
import System.Exit
|
import System.Exit
|
||||||
-- import Text.EditDistance
|
-- import Text.EditDistance
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Actions.CopyWindow (kill1,copy)
|
|
||||||
import XMonad.Actions.CycleWS
|
import XMonad.Actions.CycleWS
|
||||||
import XMonad.Actions.DynamicProjects
|
import XMonad.Actions.DynamicProjects
|
||||||
import XMonad.Core
|
import XMonad.Core
|
||||||
|
@ -21,19 +20,16 @@ import XMonad.Prompt
|
||||||
import XMonad.Prompt.ConfirmPrompt
|
import XMonad.Prompt.ConfirmPrompt
|
||||||
import XMonad.Prompt.FuzzyMatch
|
import XMonad.Prompt.FuzzyMatch
|
||||||
import XMonad.Prompt.Shell
|
import XMonad.Prompt.Shell
|
||||||
import XMonad.Prompt.Workspace (workspacePrompt)
|
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
import XMonad.Util.NamedScratchpad
|
import XMonad.Util.NamedScratchpad
|
||||||
import qualified Catppuccin as C
|
import qualified Nord as N
|
||||||
import qualified Scratchpad as R
|
import qualified Scratchpad as R
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
|
|
||||||
|
|
||||||
-- Custom (in libs)
|
-- Custom (in libs)
|
||||||
import Password (passPrompt)
|
import Password (passPrompt)
|
||||||
|
|
||||||
lockScreenCmd =
|
|
||||||
spawn "/etc/profiles/per-user/e/bin/mpc pause; /run/current-system/sw/bin/xset s activate"
|
|
||||||
|
|
||||||
modify :: XConfig l -> XConfig l
|
modify :: XConfig l -> XConfig l
|
||||||
modify conf = conf
|
modify conf = conf
|
||||||
{ modMask = mod4Mask -- Use the "Win" key for the mod key
|
{ modMask = mod4Mask -- Use the "Win" key for the mod key
|
||||||
|
@ -41,20 +37,12 @@ modify conf = conf
|
||||||
|
|
||||||
`additionalKeysP` -- Add some extra key bindings:
|
`additionalKeysP` -- Add some extra key bindings:
|
||||||
[ ("M-S-q", confirmPrompt promptConfig "exit" (io exitSuccess))
|
[ ("M-S-q", confirmPrompt promptConfig "exit" (io exitSuccess))
|
||||||
, ("<XF86MonBrightnessDown>", spawn "/run/current-system/sw/bin/light -U 10")
|
, ("<XF86MonBrightnessDown>", spawn "/run/current-system/sw/bin/xbacklight -10")
|
||||||
, ("<XF86MonBrightnessUp>", spawn "/run/current-system/sw/bin/light -A 10")
|
, ("<XF86MonBrightnessUp>", spawn "/run/current-system/sw/bin/xbacklight +10")
|
||||||
, ("<XF86AudioPlay>", spawn "/etc/profiles/per-user/e/bin/mpc toggle")
|
, ("<XF86AudioPlay>", spawn "/run/current-system/sw/bin/mpc toggle")
|
||||||
, ("<XF86AudioNext>", spawn "/etc/profiles/per-user/e/bin/mpc next")
|
, ("<XF86AudioNext>", spawn "/run/current-system/sw/bin/mpc next")
|
||||||
, ("<XF86AudioPrev>", spawn "/etc/profiles/per-user/e/bin/mpc prev")
|
, ("<XF86AudioPrev>", spawn "/run/current-system/sw/bin/mpc prev")
|
||||||
-- KP_1 -> KP_6 macros
|
, ("M-<Delete>", kill)
|
||||||
, ("<XF86Tools>", viewProject "sound")
|
|
||||||
, ("<XF86Launch5>", viewProject "frs")
|
|
||||||
, ("<XF86Launch6>", viewProject "chat")
|
|
||||||
, ("<XF86Launch7>", viewProject "isengard")
|
|
||||||
, ("<XF86Launch8>", viewProject "moria")
|
|
||||||
, ("<XF86Launch9>", viewProject "fre")
|
|
||||||
-- KP_Delete
|
|
||||||
, ("Cancel", lockScreenCmd)
|
|
||||||
, ("M-<Down>", windows W.focusDown)
|
, ("M-<Down>", windows W.focusDown)
|
||||||
, ("M-<Esc>", sendMessage (Toggle "Full"))
|
, ("M-<Esc>", sendMessage (Toggle "Full"))
|
||||||
, ("M-$", sendMessage (Toggle "Full"))
|
, ("M-$", sendMessage (Toggle "Full"))
|
||||||
|
@ -64,37 +52,31 @@ modify conf = conf
|
||||||
, ("M-<Right>", nextWS)
|
, ("M-<Right>", nextWS)
|
||||||
, ("M-<Tab>", toggleWS' ["NSP"])
|
, ("M-<Tab>", toggleWS' ["NSP"])
|
||||||
, ("M-<Up>", windows W.focusUp)
|
, ("M-<Up>", windows W.focusUp)
|
||||||
, ("M-S-<Delete>", lockScreenCmd)
|
, ("M-S-<Delete>", spawn "/run/current-system/sw/bin/mpc pause; /run/current-system/sw/bin/xset s activate")
|
||||||
, ("M-S-<Left>", shiftToPrev >> prevWS)
|
, ("M-S-<Left>", shiftToPrev >> prevWS)
|
||||||
, ("M-S-<Right>", shiftToNext >> nextWS)
|
, ("M-S-<Right>", shiftToNext >> nextWS)
|
||||||
, ("M-s s", spawn "/etc/profiles/per-user/e/bin/flameshot gui")
|
, ("M-s s", spawn "flameshot gui")
|
||||||
, ("M-s t", spawn "/run/current-system/sw/bin/scrot /tmp/screen.png")
|
, ("M-s t", spawn "/run/current-system/sw/bin/scrot /tmp/screen.png")
|
||||||
-- Workspace and tasks
|
-- Workspace and tasks
|
||||||
, ("M-b", switchProjectPrompt promptConfig)
|
, ("M-b", switchProjectPrompt promptConfig)
|
||||||
, ("M-p c", withFocused centerWindow)
|
|
||||||
, ("M-p m", shiftToProjectPrompt promptConfig)
|
, ("M-p m", shiftToProjectPrompt promptConfig)
|
||||||
, ("M-p n", switchProjectPrompt promptConfig)
|
, ("M-p n", switchProjectPrompt promptConfig)
|
||||||
, ("M-p r", renameProjectPrompt promptConfig)
|
, ("M-p r", renameProjectPrompt promptConfig)
|
||||||
, ("M-p s", shellPrompt promptConfig)
|
, ("M-p s", shellPrompt promptConfig)
|
||||||
|
, ("M-p c", withFocused centerWindow)
|
||||||
, ("M-d", passPrompt promptConfig)
|
, ("M-d", passPrompt promptConfig)
|
||||||
-- Scratchpads
|
-- Scratchpads
|
||||||
, ("M-p p", namedScratchpadAction R.pads "htop")
|
, ("M-p p", namedScratchpadAction R.pads "htop")
|
||||||
-- Copy windows to workspaces
|
-- Dunst
|
||||||
, ("M-<Delete>", kill1)
|
, ("C-<Space>", spawn "dunstctl close")
|
||||||
, ("M-c", workspacePrompt promptConfig (\name -> windows $ copy name))
|
|
||||||
-- Mouse stuff
|
|
||||||
, ("<F9>", spawn "find-cursor")
|
|
||||||
-- , ("M-$ $", spawn "xdotool click 3")
|
|
||||||
-- , ("M-$ M-$", spawn "xdotool click 3") -- helpfull to combine M + right click
|
|
||||||
-- resizing the master/slave ratio
|
|
||||||
, ("M-h", sendMessage Shrink) -- Shrink the master area
|
|
||||||
, ("M-l", sendMessage Expand) -- Expand the master area
|
|
||||||
-- dunstctl calls
|
|
||||||
-- , ("C-<Space>", spawn "dunstctl close")
|
|
||||||
, ("C-S-<Space>", spawn "dunstctl close-all")
|
, ("C-S-<Space>", spawn "dunstctl close-all")
|
||||||
, ("M-n p", spawn "dunstctl set-paused toggle")
|
, ("M-n p", spawn "dunstctl set-paused toggle")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
viewProject :: WorkspaceId -> X ()
|
||||||
|
viewProject id = do
|
||||||
|
project <- lookupProject id
|
||||||
|
forM_ project switchProject
|
||||||
|
|
||||||
-- Borrowed from https://www.reddit.com/r/xmonad/comments/gzq316/how_can_i_centre_a_floating_window_without/fthtx29/
|
-- Borrowed from https://www.reddit.com/r/xmonad/comments/gzq316/how_can_i_centre_a_floating_window_without/fthtx29/
|
||||||
centerWindow :: Window -> X ()
|
centerWindow :: Window -> X ()
|
||||||
|
@ -103,23 +85,19 @@ centerWindow win = do
|
||||||
windows $ W.float win (W.RationalRect ((1 - w) / 2) ((1 - h) / 2) w h)
|
windows $ W.float win (W.RationalRect ((1 - w) / 2) ((1 - h) / 2) w h)
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
viewProject :: WorkspaceId -> X ()
|
|
||||||
viewProject id = do
|
|
||||||
project <- lookupProject id
|
|
||||||
case project of
|
|
||||||
Just p -> switchProject p
|
|
||||||
Nothing -> return ()
|
|
||||||
|
|
||||||
promptConfig = def
|
promptConfig = def
|
||||||
{ position = Bottom
|
{ position = Bottom
|
||||||
, alwaysHighlight = True
|
, alwaysHighlight = True
|
||||||
, bgColor = C.lavender
|
, borderColor = N.nord9
|
||||||
, bgHLight = C.surface0
|
-- Normal
|
||||||
, borderColor = C.lavender
|
, bgColor = N.nord9
|
||||||
|
, fgColor = N.background
|
||||||
|
-- Selection
|
||||||
|
, bgHLight = N.nord6
|
||||||
|
, fgHLight = N.background
|
||||||
|
--
|
||||||
, defaultText = ""
|
, defaultText = ""
|
||||||
, fgColor = C.surface2
|
, font = "xft:Iosevka Samae:style=Regular:size=8:charwidth=5"
|
||||||
, fgHLight = C.text
|
|
||||||
, font = "xft:Iosevka Samae:style=Regular:size=10:charwidth=6.5"
|
|
||||||
, height = 24
|
, height = 24
|
||||||
, promptBorderWidth = 5
|
, promptBorderWidth = 5
|
||||||
-- Fuzzysearch by default
|
-- Fuzzysearch by default
|
||||||
|
|
|
@ -9,4 +9,3 @@ modify :: XConfig l -> XConfig l
|
||||||
modify conf = conf
|
modify conf = conf
|
||||||
{ logHook = logHook conf >> updatePointer (0.5,0.5) (0,0)
|
{ logHook = logHook conf >> updatePointer (0.5,0.5) (0,0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
91
lib/Nord.hs
Normal file
91
lib/Nord.hs
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
module Nord
|
||||||
|
( nord0
|
||||||
|
, nord1
|
||||||
|
, nord2
|
||||||
|
, nord3
|
||||||
|
, nord4
|
||||||
|
, nord5
|
||||||
|
, nord6
|
||||||
|
, nord7
|
||||||
|
, nord8
|
||||||
|
, nord9
|
||||||
|
, nord10
|
||||||
|
, nord11
|
||||||
|
, nord12
|
||||||
|
, nord13
|
||||||
|
, nord14
|
||||||
|
, nord15
|
||||||
|
, yellow
|
||||||
|
, orange
|
||||||
|
, red
|
||||||
|
, purple
|
||||||
|
, green
|
||||||
|
, background
|
||||||
|
, backgroundhl
|
||||||
|
, foreground
|
||||||
|
, foregroundhl
|
||||||
|
, foregroundll
|
||||||
|
) where
|
||||||
|
|
||||||
|
-- POLAR NIGHT
|
||||||
|
-- The origin color or the Polar Night palette.
|
||||||
|
nord0 = "#2E3440";
|
||||||
|
|
||||||
|
-- A brighter shade color based on nord0.
|
||||||
|
nord1 = "#3B4252";
|
||||||
|
|
||||||
|
-- An even more brighter shade color of nord0.
|
||||||
|
nord2 = "#434C5E";
|
||||||
|
|
||||||
|
-- The brightest shade color based on nord0.
|
||||||
|
nord3 = "#4C566A";
|
||||||
|
|
||||||
|
-- SNOW STORM
|
||||||
|
-- The origin color or the Snow Storm palette.
|
||||||
|
nord4 = "#D8DEE9";
|
||||||
|
|
||||||
|
-- A brighter shade color of nord4.
|
||||||
|
nord5 = "#E5E9F0";
|
||||||
|
|
||||||
|
-- The brightest shade color based on nord4.
|
||||||
|
nord6 = "#ECEFF4";
|
||||||
|
|
||||||
|
-- FROST
|
||||||
|
-- A calm and highly contrasted color reminiscent of frozen polar water.
|
||||||
|
nord7 = "#8FBCBB";
|
||||||
|
|
||||||
|
-- The bright and shiny primary accent color reminiscent of pure and clear ice.
|
||||||
|
nord8 = "#88C0D0";
|
||||||
|
|
||||||
|
-- A more darkened and less saturated color reminiscent of arctic waters.
|
||||||
|
nord9 = "#81A1C1";
|
||||||
|
|
||||||
|
-- A dark and intensive color reminiscent of the deep arctic ocean.
|
||||||
|
nord10 = "#5E81AC";
|
||||||
|
|
||||||
|
-- AURORA
|
||||||
|
-- RED
|
||||||
|
nord11 = "#BF616A";
|
||||||
|
|
||||||
|
-- ORANGE
|
||||||
|
nord12 = "#D08770";
|
||||||
|
|
||||||
|
-- YELLOW
|
||||||
|
nord13 = "#EBCB8B";
|
||||||
|
|
||||||
|
-- GREEN
|
||||||
|
nord14 = "#A3BE8C";
|
||||||
|
|
||||||
|
-- PURPLE
|
||||||
|
nord15 = "#B48EAD";
|
||||||
|
|
||||||
|
foregroundhl = nord6
|
||||||
|
foreground = nord5
|
||||||
|
foregroundll = nord4
|
||||||
|
backgroundhl = nord1
|
||||||
|
background = nord0
|
||||||
|
red = nord11
|
||||||
|
orange = nord12
|
||||||
|
yellow = nord13
|
||||||
|
green = nord14
|
||||||
|
purple = nord15
|
|
@ -33,23 +33,36 @@ passGeneratePrompt :: XPConfig -> X ()
|
||||||
passGeneratePrompt _ = return () -- Not implemented
|
passGeneratePrompt _ = return () -- Not implemented
|
||||||
|
|
||||||
passPrompt :: XPConfig -> X ()
|
passPrompt :: XPConfig -> X ()
|
||||||
passPrompt = mkPassPrompt "Select password" copyPassword
|
passPrompt = mkPassPrompt "Select password" selectPassword
|
||||||
|
|
||||||
mkPassPrompt :: String -> (String -> X ()) -> XPConfig -> X ()
|
mkPassPrompt :: String -> (String -> X ()) -> XPConfig -> X ()
|
||||||
mkPassPrompt label f conf = do
|
mkPassPrompt label f conf = do
|
||||||
-- I'm just sorting here, but could use some kind of fuzzy matching instead, but it requires a bit more effort
|
-- I'm just sorting here, but could use some kind of fuzzy matching instead,
|
||||||
|
-- but it requires a bit more effort
|
||||||
passwords <- sort <$> liftIO getPasswords
|
passwords <- sort <$> liftIO getPasswords
|
||||||
-- Other change, use infixof instead of prefixof
|
mkXPrompt (Pass label) conf (passComplFun passwords) f
|
||||||
mkXPrompt (Pass label) conf (\input -> pure (sortBy (compare `on` levenshtein input) . take 5 . filter (consumes input) $ passwords)) f
|
|
||||||
where
|
where
|
||||||
consumes [] _ = True -- everything consumed
|
|
||||||
consumes (_:_) [] = False -- all not consumed
|
|
||||||
consumes (a:xs) (a':ys) | a == a' = consumes xs ys
|
|
||||||
| otherwise = consumes (a:xs) ys
|
|
||||||
getPasswords = do
|
getPasswords = do
|
||||||
passwordStoreDir <- (</> "pass") <$> getHomeDirectory
|
passwordStoreDir <- (</> "pass") <$> getHomeDirectory
|
||||||
files <- runProcessWithInput "find" [ passwordStoreDir, "-type", "f", "-name", "*.gpg", "-printf", "%p\n"] []
|
files <- runProcessWithInput "find"
|
||||||
|
[ passwordStoreDir, "-type", "f", "-name", "*.gpg", "-printf"
|
||||||
|
, "%p\n"] []
|
||||||
return . lines $ files
|
return . lines $ files
|
||||||
|
|
||||||
copyPassword :: String -> X ()
|
-- | Find all entries (`allPasses`) matching `input`
|
||||||
copyPassword pass = spawn $ "gpg --decrypt " ++ pass ++ " | copy"
|
passComplFun :: [String] -> String -> IO [String]
|
||||||
|
passComplFun allPasses input = pure $
|
||||||
|
sortBy (compare `on` levenshtein input)
|
||||||
|
. take 10
|
||||||
|
. filter (consumes input)
|
||||||
|
$ allPasses
|
||||||
|
where
|
||||||
|
consumes [] _ = True -- everything consumed
|
||||||
|
consumes (_:_) [] = False -- all not consumed
|
||||||
|
consumes (a:xs) (a':ys) | a == a' = consumes xs ys
|
||||||
|
| otherwise = consumes (a:xs) ys
|
||||||
|
|
||||||
|
selectPassword :: String -> X ()
|
||||||
|
selectPassword pass = spawn $ "gpg --decrypt " ++ pass ++ " | copy"
|
||||||
|
-- “copy” comes with the xmonad module in the nix configuration
|
||||||
|
|
||||||
|
|
244
lib/Projects.hs
244
lib/Projects.hs
|
@ -6,135 +6,135 @@ import XMonad
|
||||||
import XMonad.Actions.DynamicProjects
|
import XMonad.Actions.DynamicProjects
|
||||||
import XMonad.Util.Run
|
import XMonad.Util.Run
|
||||||
|
|
||||||
spinTextEditorAndTerm :: String -> String -> Project
|
term = "kitty"
|
||||||
spinTextEditorAndTerm dir name =
|
|
||||||
Project { projectName = name
|
|
||||||
, projectDirectory = dir <> name
|
|
||||||
, projectStartHook = Just
|
|
||||||
$ safeSpawn "rio" ["-e","tmux","new","-A","-s",name]
|
|
||||||
}
|
|
||||||
|
|
||||||
spinChat :: String -> Project
|
spawnGuiTextEditor :: X ()
|
||||||
spinChat name =
|
spawnGuiTextEditor = safeSpawn "neovide" []
|
||||||
Project { projectName = name
|
|
||||||
, projectDirectory = "/tmp"
|
|
||||||
, projectStartHook = Just $ do safeSpawnProg (name <> "-desktop")
|
|
||||||
}
|
|
||||||
|
|
||||||
spinInTermWithName :: String -> String -> Project
|
singleTermAppWithName :: String -> String -> Project
|
||||||
spinInTermWithName projectName cmd =
|
singleTermAppWithName name app = Project
|
||||||
Project { projectName = projectName
|
{ projectName = name
|
||||||
, projectDirectory = "/tmp"
|
, projectDirectory = "/tmp"
|
||||||
, projectStartHook = Just $ do safeSpawn "rio" ["-e",cmd]
|
, projectStartHook = Just $ do safeSpawn term ["zsh","-c",app]
|
||||||
}
|
}
|
||||||
|
|
||||||
spinInTerm :: String -> Project
|
singleAppWithName :: String -> String -> Project
|
||||||
spinInTerm name = spinInTermWithName name name
|
singleAppWithName name app = Project
|
||||||
|
{ projectName = name
|
||||||
|
, projectDirectory = "/tmp"
|
||||||
|
, projectStartHook = Just $ do spawn app
|
||||||
|
}
|
||||||
|
|
||||||
justStart :: String -> Project
|
singleApp :: String -> Project
|
||||||
justStart name = justStartWithName name name
|
singleApp app = singleAppWithName app app
|
||||||
|
|
||||||
justStartWithName :: String -> String -> Project
|
|
||||||
justStartWithName name pgm =
|
|
||||||
Project { projectName = name
|
|
||||||
, projectDirectory = "/tmp"
|
|
||||||
, projectStartHook = Just $ do safeSpawnProg pgm
|
|
||||||
}
|
|
||||||
|
|
||||||
spinNotes :: Project
|
|
||||||
spinNotes =
|
|
||||||
Project { projectName = "notes"
|
|
||||||
, projectDirectory = "~/zk/org-roam/"
|
|
||||||
, projectStartHook = Just $ do safeSpawn "emacs" ["~/zk/org-roam/20240202124747-index.org"]
|
|
||||||
}
|
|
||||||
|
|
||||||
adminProject = spinTextEditorAndTerm "~/admin/"
|
|
||||||
candyProject = spinTextEditorAndTerm "~/candy/"
|
|
||||||
workProject = spinTextEditorAndTerm "~/relex/"
|
|
||||||
workAnsibleProject = spinTextEditorAndTerm "~/relex/ansible-roles/"
|
|
||||||
|
|
||||||
projects :: [Project]
|
projects :: [Project]
|
||||||
projects = [ adminProject "wrk-config"
|
projects =
|
||||||
, adminProject "cdc-config"
|
[ singleApp "carla"
|
||||||
, adminProject "overlays-personal"
|
, singleApp "obs"
|
||||||
, candyProject "adventofcode"
|
, singleApp "reaper"
|
||||||
, candyProject "dhall-packages"
|
, singleApp "renoise"
|
||||||
, candyProject "hfdb"
|
, singleApp "mixxx"
|
||||||
, justStartWithName "fre" "ff-perso"
|
, singleAppWithName "Books" "calibre"
|
||||||
, justStartWithName "frs" "ff-relex"
|
, singleAppWithName "discord" "Discord"
|
||||||
, justStartWithName "chat" "slack"
|
, singleAppWithName "matrix" "element-desktop"
|
||||||
, justStartWithName "meet" "chromium"
|
, singleAppWithName "signal" "signal-desktop"
|
||||||
, spinNotes
|
, singleAppWithName "vcv" "Rack"
|
||||||
, spinInTermWithName "VPN" "vpn-run"
|
, singleTermAppWithName "email" "neomutt"
|
||||||
, spinChat "element"
|
, Project { projectName = "admin"
|
||||||
, spinChat "signal"
|
, projectDirectory = "~/admin/nixos-config"
|
||||||
, spinInTerm "k9s"
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
, spinInTermWithName "email" "neomutt"
|
safeSpawnProg term
|
||||||
, spinTextEditorAndTerm "~/." "xmonad" -- Dark magic!
|
}
|
||||||
, workProject "azure-kube-platform"
|
, Project { projectName = "nixpkgs"
|
||||||
, workProject "azure-kube-platform-environments"
|
, projectDirectory = "~/admin/nixpkgs"
|
||||||
, workProject "azure-management"
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
, workProject "calculation-node-playbook"
|
safeSpawnProg term
|
||||||
, workProject "communication-nix-101"
|
}
|
||||||
, workProject "communication-nix-102"
|
, Project { projectName = "overlays-personal"
|
||||||
, workProject "communication-nix-103"
|
, projectDirectory = "~/admin/overlays-personal"
|
||||||
, workProject "cooper"
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
, workProject "crebain"
|
safeSpawnProg term
|
||||||
, workProject "customer-configs"
|
}
|
||||||
, workProject "customer-modules"
|
, Project { projectName = "steam"
|
||||||
, workProject "docker-images"
|
, projectDirectory = "/tmp"
|
||||||
, workProject "fangorn"
|
, projectStartHook = Just $ safeSpawn "steam" ["-pipewire"]
|
||||||
, workProject "gitlab-runners"
|
}
|
||||||
, workProject "gitlab-self-manage"
|
, Project { projectName = "youtube"
|
||||||
, workProject "infra-inventory"
|
, projectDirectory = "/tmp"
|
||||||
, workProject "isengard"
|
, projectStartHook = Just $ safeSpawn "chromium"
|
||||||
, workProject "isengard-2"
|
["--app=youtube.com"]
|
||||||
, workProject "isengard-3"
|
}
|
||||||
, workProject "jirawiz"
|
, Project { projectName = "cdc-config"
|
||||||
, workAnsibleProject "java"
|
, projectDirectory = "~/admin/cdc-config"
|
||||||
, workProject "morannon"
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
, workProject "mordor-ca"
|
safeSpawnProg term
|
||||||
, workProject "mordor-deploy"
|
}
|
||||||
, workProject "mordor-interview"
|
, Project { projectName = "saehkoepoika-config"
|
||||||
, workProject "mordor-nixpkgs"
|
, projectDirectory = "~/admin/saehkoepoika-configuration-nix"
|
||||||
, workProject "mordor-ops"
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
, workProject "mordor-the-repo"
|
safeSpawnProg term
|
||||||
, workProject "mordorbooks"
|
}
|
||||||
, workProject "moria"
|
, Project { projectName = "cdc-documentation"
|
||||||
, workProject "muir"
|
, projectDirectory = "~/admin/cdc-documentation"
|
||||||
, workProject "nix"
|
, projectStartHook = Just $ do
|
||||||
, workProject "nix-ansible-role"
|
safeSpawnProg term
|
||||||
, workProject "nixos-modules"
|
spawnGuiTextEditor
|
||||||
, workProject "nixpkgs"
|
}
|
||||||
, workProject "one-off-scripts"
|
, Project { projectName = "adventOfCode"
|
||||||
, workProject "pck-access"
|
, projectDirectory = "~/candy/adventofcode"
|
||||||
, workProject "planning-cloud"
|
, projectStartHook = Just $ do
|
||||||
, workProject "rfcs"
|
safeSpawnProg term
|
||||||
, workProject "runner-tests"
|
spawnGuiTextEditor
|
||||||
, workProject "slog-agent"
|
}
|
||||||
, workProject "sm-terraform"
|
, Project { projectName = "rukokuoppa"
|
||||||
, workProject "tech-radar"
|
, projectDirectory = "~/candy/rukokuoppa"
|
||||||
, workProject "time-tracking"
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
, workProject "ugluk-ansible-role"
|
safeSpawnProg term
|
||||||
, workProject "unified-application-gateway"
|
}
|
||||||
, Project { projectName = "minecraft"
|
, Project { projectName = "notes"
|
||||||
, projectDirectory = "/tmp"
|
, projectDirectory = "~/zk/org-roam-private"
|
||||||
, projectStartHook = Just $ do safeSpawnProg "minecraft-launcher"
|
, projectStartHook = Just $ safeSpawn "emacs" ["~/zk/org-roam-private"]
|
||||||
safeSpawnProg "mumble"
|
}
|
||||||
}
|
, Project { projectName = "groceries"
|
||||||
, Project { projectName = "status"
|
, projectDirectory = "/tmp"
|
||||||
, projectDirectory = "/tmp"
|
, projectStartHook = Just $ safeSpawnProg "obsidian"
|
||||||
, projectStartHook = Just $ do
|
}
|
||||||
safeSpawn "rio" ["-e","btop"]
|
, Project { projectName = "xmonad"
|
||||||
}
|
, projectDirectory = "~/.xmonad"
|
||||||
, Project { projectName = "sound"
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
, projectDirectory = "/tmp"
|
safeSpawnProg term
|
||||||
, projectStartHook = Just $ do
|
}
|
||||||
safeSpawn "pw-jack" ["patchage"]
|
, Project { projectName = "waymonad"
|
||||||
safeSpawnProg "easyeffects"
|
, projectDirectory = "~/candy/waymonad"
|
||||||
}
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
]
|
safeSpawnProg term
|
||||||
|
}
|
||||||
|
, Project { projectName = "accounting"
|
||||||
|
, projectDirectory = "~/accounting"
|
||||||
|
, projectStartHook = Just $ do safeSpawnProg term
|
||||||
|
}
|
||||||
|
, Project { projectName = "arrangements"
|
||||||
|
, projectDirectory = "~/candy/Arrangements"
|
||||||
|
, projectStartHook = Just $ do spawnGuiTextEditor
|
||||||
|
safeSpawnProg term
|
||||||
|
}
|
||||||
|
, Project { projectName = "flim"
|
||||||
|
, projectDirectory = "/flims/rtorrent/download"
|
||||||
|
, projectStartHook = Just $ do safeSpawnProg term
|
||||||
|
}
|
||||||
|
, Project { projectName = "sound"
|
||||||
|
, projectDirectory = "/tmp"
|
||||||
|
, projectStartHook = Just $ do safeSpawnProg "pavucontrol"
|
||||||
|
safeSpawnProg "easyeffects"
|
||||||
|
}
|
||||||
|
, Project { projectName = "web"
|
||||||
|
, projectDirectory = "/tmp"
|
||||||
|
, projectStartHook = Just $ do spawn "firefox"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
modify :: XConfig l -> XConfig l
|
modify :: XConfig l -> XConfig l
|
||||||
modify conf = dynamicProjects projects conf
|
modify conf = dynamicProjects projects conf
|
||||||
{ workspaces = [] }
|
{ workspaces = [] }
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ modify conf = conf
|
||||||
}
|
}
|
||||||
|
|
||||||
pads =
|
pads =
|
||||||
[ NS "htop" "rio -e tmux" (title =? "htop")
|
[ NS "htop" "kitty --title htop tmux" (title =? "htop")
|
||||||
(customFloating $ W.RationalRect (1/3) (1/3) (1/3) (1/3))
|
(customFloating $ W.RationalRect (1/3) (1/3) (1/3) (1/3))
|
||||||
-- , NS "stardict" "stardict" (className =? "Stardict")
|
-- , NS "stardict" "stardict" (className =? "Stardict")
|
||||||
-- (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3))
|
-- (customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3))
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
module ScreenEvents (
|
|
||||||
ScreenEvents.modify
|
|
||||||
) where
|
|
||||||
|
|
||||||
import XMonad
|
|
||||||
import Data.Monoid (All(..))
|
|
||||||
import XMonad.Hooks.Rescreen
|
|
||||||
|
|
||||||
-- screenChangeHandler :: Event -> X All
|
|
||||||
-- screenChangeHandler (RRScreenChangeNotifyEvent _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = do
|
|
||||||
-- spawn "touch /tmp/xmonad-WAAAAAT"
|
|
||||||
-- spawn "/home/e/.fehbg"
|
|
||||||
-- return (All True)
|
|
||||||
-- screenChangeHandler _ = return (All True)
|
|
||||||
|
|
||||||
modify :: XConfig l -> XConfig l
|
|
||||||
modify = addAfterRescreenHook afterRescreen
|
|
||||||
|
|
||||||
afterRescreen :: X ()
|
|
||||||
afterRescreen = do
|
|
||||||
spawn "xrandr --dpi 96"
|
|
||||||
spawn "/home/e/.fehbg"
|
|
|
@ -20,33 +20,8 @@ module Solarized
|
||||||
, foreground
|
, foreground
|
||||||
, foregroundhl
|
, foregroundhl
|
||||||
, foregroundll
|
, foregroundll
|
||||||
, theme
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import XMonad.Layout.Decoration (Theme(..))
|
|
||||||
|
|
||||||
theme :: Theme
|
|
||||||
theme =
|
|
||||||
Theme { activeColor = violet
|
|
||||||
, inactiveColor = base03
|
|
||||||
, urgentColor = red
|
|
||||||
, activeBorderColor = violet
|
|
||||||
, inactiveBorderColor = base03
|
|
||||||
, urgentBorderColor = red
|
|
||||||
, activeBorderWidth = 1
|
|
||||||
, inactiveBorderWidth = 1
|
|
||||||
, urgentBorderWidth = 1
|
|
||||||
, activeTextColor = base03
|
|
||||||
, inactiveTextColor = base02
|
|
||||||
, urgentTextColor = red
|
|
||||||
, fontName = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
|
|
||||||
, decoWidth = 200
|
|
||||||
, decoHeight = 15
|
|
||||||
, windowTitleAddons = []
|
|
||||||
, windowTitleIcons = []
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
base03 = "#002b36"
|
base03 = "#002b36"
|
||||||
base02 = "#073642"
|
base02 = "#073642"
|
||||||
base01 = "#586e75"
|
base01 = "#586e75"
|
||||||
|
|
69
lib/StatusBar.hs
Normal file
69
lib/StatusBar.hs
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
|
|
||||||
|
module StatusBar (
|
||||||
|
StatusBar.modify
|
||||||
|
) where
|
||||||
|
|
||||||
|
import Data.List
|
||||||
|
import Data.Monoid
|
||||||
|
import Nord as N
|
||||||
|
import XMonad.Core
|
||||||
|
import XMonad.Hooks.DynamicBars (dynStatusBarStartup,dynStatusBarEventHook,multiPP)
|
||||||
|
import XMonad.Hooks.DynamicLog
|
||||||
|
import XMonad.ManageHook
|
||||||
|
import XMonad.Util.Run
|
||||||
|
|
||||||
|
-- Type constructors
|
||||||
|
import GHC.IO.Handle (Handle)
|
||||||
|
|
||||||
|
modify :: XConfig l -> XConfig l
|
||||||
|
modify conf = conf
|
||||||
|
{ startupHook = do
|
||||||
|
startupHook conf
|
||||||
|
dynStatusBarStartup runXmobar killXmobar
|
||||||
|
, handleEventHook = handleEventHook conf <+> dynStatusBarEventHook runXmobar killXmobar
|
||||||
|
, logHook = do
|
||||||
|
logHook conf
|
||||||
|
multiPP currentPP otherPP
|
||||||
|
}
|
||||||
|
|
||||||
|
runXmobar :: ScreenId -> IO Handle
|
||||||
|
runXmobar (S id) = spawnPipe
|
||||||
|
$ "/run/current-system/sw/bin/xmobar --screen="
|
||||||
|
<> show id
|
||||||
|
<> " /home/eeva/.xmonad/xmobarrc"
|
||||||
|
|
||||||
|
killXmobar :: IO ()
|
||||||
|
-- killXmobar = spawn "/run/current-system/sw/bin/pkill xmobar"
|
||||||
|
killXmobar = return ()
|
||||||
|
|
||||||
|
otherPP = currentPP
|
||||||
|
{ ppCurrent = xmobarColor N.foreground N.background
|
||||||
|
, ppVisible = xmobarColor N.foreground N.background
|
||||||
|
, ppHidden = xmobarColor N.foreground N.background
|
||||||
|
, ppHiddenNoWindows = xmobarColor N.backgroundhl N.background
|
||||||
|
}
|
||||||
|
|
||||||
|
currentPP = def
|
||||||
|
{ ppCurrent = xmobarColor' N.orange
|
||||||
|
, ppVisible = xmobarColor' N.yellow -- other screen
|
||||||
|
, ppHidden = xmobarColor' N.foreground -- other workspaces with windows
|
||||||
|
, ppHiddenNoWindows = xmobarColor' N.foregroundll -- other workspaces
|
||||||
|
, ppSep = " "
|
||||||
|
, ppWsSep = " "
|
||||||
|
, ppLayout = printLayout
|
||||||
|
, ppTitle = printTitle
|
||||||
|
}
|
||||||
|
where xmobarColor' fg = xmobarColor fg S.base03
|
||||||
|
|
||||||
|
printLayout s | "Mirror ResizableTall" `isSuffixOf` s = "[ — ]"
|
||||||
|
printLayout s | "ResizableTall" `isSuffixOf` s = "[ | ]"
|
||||||
|
printLayout "Full" = "[ F ]"
|
||||||
|
printLayout l = "[" ++ l ++ "]"
|
||||||
|
|
||||||
|
printTitle t = let t' = shorten 120 t
|
||||||
|
in xmobarColor' S.foregroundll "« "
|
||||||
|
++ xmobarColor' S.foregroundhl t'
|
||||||
|
++ xmobarColor' S.foregroundll " »"
|
||||||
|
|
||||||
|
|
18
shell.nix
18
shell.nix
|
@ -1,15 +1,15 @@
|
||||||
{ pkgs }:
|
{pkgs}: let
|
||||||
let
|
|
||||||
inherit (pkgs) callPackage fetchFromGitHub mkShell;
|
inherit (pkgs) callPackage fetchFromGitHub mkShell;
|
||||||
easy-hls-src = fetchFromGitHub {
|
easy-hls-src = fetchFromGitHub {
|
||||||
owner = "jkachmar";
|
owner = "jkachmar";
|
||||||
repo = "easy-hls-nix";
|
repo = "easy-hls-nix";
|
||||||
rev = "291cf77f512a7121bb6801cde35ee1e8b7287f91";
|
rev = "291cf77f512a7121bb6801cde35ee1e8b7287f91";
|
||||||
sha256 = "1bvbcp9zwmh53sm16ycp8phhc6vzc72a71sf0bvyjgfbn6zp68bc";
|
sha256 = "1bvbcp9zwmh53sm16ycp8phhc6vzc72a71sf0bvyjgfbn6zp68bc";
|
||||||
};
|
};
|
||||||
easy-hls = callPackage easy-hls-src {};
|
easy-hls = callPackage easy-hls-src {};
|
||||||
in
|
in
|
||||||
|
mkShell {
|
||||||
mkShell {
|
buildInputs = [
|
||||||
buildInputs = [ easy-hls ];
|
easy-hls
|
||||||
}
|
];
|
||||||
|
}
|
||||||
|
|
36
xmonad-config.cabal
Normal file
36
xmonad-config.cabal
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
cabal-version: >=1.10
|
||||||
|
|
||||||
|
name: xmonad-config
|
||||||
|
version: 0.13.0.0
|
||||||
|
-- synopsis:
|
||||||
|
-- description:
|
||||||
|
-- bug-reports:
|
||||||
|
license: AGPL-3.0-or-later
|
||||||
|
author: EEva (JPotier)
|
||||||
|
maintainer: jpo.contributes.to.nixos@marvid.fr
|
||||||
|
-- copyright:
|
||||||
|
-- category:
|
||||||
|
build-type: Simple
|
||||||
|
extra-source-files: CHANGELOG.md
|
||||||
|
|
||||||
|
executable xmonad
|
||||||
|
main-is: xmonad.hs
|
||||||
|
other-modules: KeyBindings
|
||||||
|
, MouseBindings
|
||||||
|
, Nord
|
||||||
|
, Password
|
||||||
|
, Projects
|
||||||
|
, Scratchpad
|
||||||
|
-- other-extensions:
|
||||||
|
build-depends: base
|
||||||
|
, X11
|
||||||
|
, directory
|
||||||
|
, filepath
|
||||||
|
, mtl
|
||||||
|
, unix
|
||||||
|
, xmonad
|
||||||
|
, xmonad-contrib >= 0.18.1
|
||||||
|
, xmonad-extras
|
||||||
|
hs-source-dirs: .
|
||||||
|
, lib
|
||||||
|
default-language: Haskell2010
|
78
xmonad.hs
78
xmonad.hs
|
@ -9,76 +9,64 @@ import XMonad.Actions.DynamicProjects
|
||||||
import XMonad.Config.Desktop
|
import XMonad.Config.Desktop
|
||||||
import XMonad.Hooks.DynamicLog
|
import XMonad.Hooks.DynamicLog
|
||||||
import XMonad.Hooks.ManageHelpers
|
import XMonad.Hooks.ManageHelpers
|
||||||
|
import XMonad.Layout.NoBorders (noBorders, smartBorders, hasBorder, BorderMessage (HasBorder))
|
||||||
import XMonad.Layout.NoBorders (noBorders, smartBorders)
|
|
||||||
import XMonad.Layout.NoFrillsDecoration
|
|
||||||
import XMonad.Layout.PerScreen
|
|
||||||
import XMonad.Layout.Reflect
|
|
||||||
import XMonad.Layout.ResizableTile (ResizableTall(..))
|
import XMonad.Layout.ResizableTile (ResizableTall(..))
|
||||||
import XMonad.Layout.Spacing
|
import XMonad.Layout.Spacing
|
||||||
import XMonad.Layout.ThreeColumns (ThreeCol(..))
|
|
||||||
import XMonad.Layout.ToggleLayouts (toggleLayouts)
|
import XMonad.Layout.ToggleLayouts (toggleLayouts)
|
||||||
|
|
||||||
import XMonad.StackSet (sink)
|
|
||||||
|
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
import XMonad.Util.SpawnOnce
|
import XMonad.Util.Hacks (fixSteamFlicker)
|
||||||
import qualified Solarized as S
|
import qualified Nord as N
|
||||||
import qualified Catppuccin as C
|
import qualified XMonad.Layout.Spacing as SS (Border(..))
|
||||||
|
|
||||||
-- Tidy modules
|
-- Tidy modules
|
||||||
import KeyBindings as Keys (modify)
|
import KeyBindings as Keys (modify)
|
||||||
import MouseBindings as Mouse (modify)
|
import MouseBindings as Mouse (modify)
|
||||||
import Projects (modify)
|
import Projects (modify)
|
||||||
import Scratchpad (modify)
|
import Scratchpad (modify)
|
||||||
import ScreenEvents (modify)
|
|
||||||
|
|
||||||
-------------------- toggle btw vvvvvvvvvv or vvvvv
|
--------- toggle btw vvvvvvvvvv or vvvvv
|
||||||
--layouts = titleBar $ toggleLayouts fullscreen tiled
|
|
||||||
layouts = toggleLayouts fullscreen tiled
|
layouts = toggleLayouts fullscreen tiled
|
||||||
where
|
where
|
||||||
fullscreen = (noBorders Full)
|
smallBorder = SS.Border 5 5 5 5
|
||||||
tiled = smarts $ ifWider (1920 + 1) wideScreen normalScreen
|
fullscreen = noBorders Full
|
||||||
wideScreen = ThreeColMid 1 (5/100) (1/2)
|
tiled = smarts $ resizableTall ||| Mirror resizableTall
|
||||||
normalScreen = ResizableTall 1 (5/100) (1/2) []
|
smarts = spacingRaw True smallBorder True smallBorder True . smartBorders
|
||||||
smarts = (smartSpacingWithEdge 5) . smartBorders
|
resizableTall = ResizableTall 1 (5/100) (1/2) []
|
||||||
--titleBar = noFrillsDeco shrinkText S.theme
|
|
||||||
|
|
||||||
-- Use the `xprop' tool to get the info you need for these matches.
|
-- Use the `xprop' tool to get the info you need for these matches.
|
||||||
-- For className, use the second value that xprop gives you.
|
-- For className, use the second value that xprop gives you.
|
||||||
-------------- Here be the law of windows
|
-------------- Here be the law of windows
|
||||||
myManageHook = composeOne
|
myManageHook = composeAll
|
||||||
[ className =? "Gcr-prompter" -?> doCenterFloat
|
[ className =? "Patchage" --> doShift "patchage"
|
||||||
, className =? "Pavucontrol" -?> doShift "music"
|
, className =? "Pavucontrol" --> doShift "music"
|
||||||
, className =? "Pinentry" -?> doFloat
|
, className =? "Pinentry" --> doCenterFloat
|
||||||
, className =? "VirtualBox" -?> doFloat
|
, className =? "REAPER" --> hasBorder False
|
||||||
, className =? "gpclient" -?> doTile <+> (doShift "VPN")
|
, className =? "Renoise" --> hasBorder False
|
||||||
, className =? "mpv" -?> doFullFloat <+> (doShift "flims")
|
, className =? "steam" --> doShift "steam"
|
||||||
, className =? "qemu-system-x86_64" -?> doFloat
|
, className =? "steamwebhelper" --> doShift "steam"
|
||||||
, className =? "qutebrowser" -?> doShift "web"
|
, className =? "cs2" --> doShift "steam"
|
||||||
, isDialog -?> doCenterFloat
|
, isDialog --> doCenterFloat
|
||||||
|
|
||||||
-- Move transient windows to their parent:
|
-- Move transient windows to their parent:
|
||||||
, transience
|
, transience'
|
||||||
]
|
]
|
||||||
|
|
||||||
doTile :: ManageHook
|
fixSteam :: XConfig l -> XConfig l
|
||||||
doTile = ask >>= doF . sink
|
fixSteam c = c { handleEventHook = fixSteamFlicker <+> handleEventHook c }
|
||||||
|
|
||||||
------------ build the full config
|
------------ build the full config
|
||||||
withConfig =
|
withConfig =
|
||||||
Projects.modify -- Apply projects config
|
fixSteam -- And workaround steam bug
|
||||||
$ Keys.modify -- Apply keybindings config
|
$ Projects.modify -- Apply projects config
|
||||||
$ Mouse.modify -- Apply mouse bindings config
|
$ Keys.modify -- Apply keybindings config
|
||||||
$ Scratchpad.modify -- Apply scratchpad managehook config
|
$ Mouse.modify -- Apply mouse bindings config
|
||||||
$ ScreenEvents.modify -- Apply screen event hook config
|
$ Scratchpad.modify -- Apply scratchpad managehook config
|
||||||
$ desktopConfig -- on a default desktop config
|
$ desktopConfig -- on a default desktop config
|
||||||
{ manageHook = myManageHook <+> manageHook desktopConfig
|
{ manageHook = myManageHook
|
||||||
, layoutHook = desktopLayoutModifiers layouts
|
, layoutHook = desktopLayoutModifiers layouts
|
||||||
, startupHook = spawnOnce "sh /home/e/.fehbg"
|
, terminal = "kitty"
|
||||||
, terminal = "rio"
|
, normalBorderColor = N.backgroundhl
|
||||||
, normalBorderColor = C.surface0
|
, focusedBorderColor = N.nord9
|
||||||
, focusedBorderColor = C.mauve
|
|
||||||
, borderWidth = 5
|
, borderWidth = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue