xmonad-config/lib/Projects.hs
2021-12-15 12:38:09 +02:00

140 lines
5.4 KiB
Haskell

module Projects (
Projects.modify
) where
import XMonad
import XMonad.Actions.DynamicProjects
import XMonad.Util.Run
spinTextEditorAndTerm :: String -> String -> Project
spinTextEditorAndTerm dir name =
Project { projectName = name
, projectDirectory = dir <> name
, projectStartHook = Just
$ safeSpawn "nvidia-offload" ["kitty","tmux","new","-A","-s",name]
}
spinChat :: String -> Project
spinChat name =
Project { projectName = name
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg (name <> "-desktop")
}
spinInTermWithName :: String -> String -> Project
spinInTermWithName projectName cmd =
Project { projectName = projectName
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawn "kitty" [cmd]
}
spinInTerm :: String -> Project
spinInTerm name = spinInTermWithName name name
justStart :: String -> Project
justStart name =
Project { projectName = name
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg name
}
adminProject = spinTextEditorAndTerm "~/admin/"
candyProject = spinTextEditorAndTerm "~/candy/"
workProject = spinTextEditorAndTerm "~/relex/"
projects :: [Project]
projects = [ adminProject "wrk-config"
, adminProject "cdc-config"
, adminProject "overlays-personal"
, candyProject "dhall-packages"
, candyProject "hfdb"
, candyProject "adventofcode"
, justStart "obs"
, justStart "m8c"
, spinChat "element"
, spinChat "signal"
, spinChat "wire"
, spinInTerm "k9s"
, spinInTermWithName "email" "neomutt"
, spinTextEditorAndTerm "~/." "xmonad" -- Dark magic!
, workProject "azure-core-infra"
, workProject "azure-kube-platform"
, workProject "bob-the-builder"
, workProject "calculation-node-playbook"
, workProject "common-cicd-config-private-cloud"
, workProject "communication-nix-101"
, workProject "connect2-provisioning"
, workProject "connect2-terraform"
, workProject "cooper"
, workProject "customer-configs"
, workProject "customer-modules"
, workProject "docker-images"
, workProject "frankenbase"
, workProject "gitlab-runners"
, workProject "gitlab-self-manage"
, workProject "infra-inventory"
, workProject "isengard"
, workProject "isengard-worktree-2"
, workProject "isengard-worktree-3"
, workProject "linkerd-plugins"
, workProject "morannon"
, workProject "mordor-ca"
, workProject "mordor-dashboard"
, workProject "mordor-deploy"
, workProject "mordor-interview"
, workProject "mordor-kvm"
, workProject "mordor-nixpkgs"
, workProject "mordor-ops"
, workProject "mordor-sudo"
, workProject "mordor-the-repo"
, workProject "mordorbooks"
, workProject "muir"
, workProject "nix"
, workProject "nix-ansible-role"
, workProject "nixos-modules"
, workProject "nixpkgs"
, workProject "planning-cloud"
, workProject "prototype-task-tracking"
, workProject "rfcs"
, workProject "sm-terraform"
, workProject "storagegrid-prototype"
, workProject "time-tracking"
, workProject "ugluk-ansible-role"
, Project { projectName = "minecraft"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg "minecraft-launcher"
safeSpawnProg "mumble"
}
, Project { projectName = "status"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do
safeSpawn "nvidia-offload" ["kitty","gotop"]
}
, Project { projectName = "frs"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg "ff-relex"
}
, Project { projectName = "fre"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg "ff-perso"
}
, Project { projectName = "network-graph"
, projectDirectory = "~/relex/catch-a-network-bug/csvplotter"
, projectStartHook = Just $ do safeSpawn "zathura" ["weekXGraph.pdf"]
safeSpawnProg "st"
}
, Project { projectName = "sound"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do
safeSpawn "pw-jack" ["patchage"]
safeSpawnProg "easyeffects"
}
, Project { projectName = "meeting"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg "chromium"
}
]
modify :: XConfig l -> XConfig l
modify conf = dynamicProjects projects conf
{ workspaces = [] }