Move to emacs

This commit is contained in:
Martin Potier 2021-07-14 12:49:35 +03:00
parent 1b3f67199e
commit 7f7fd27fd6
No known key found for this signature in database
GPG key ID: D4DD957DBA4AD89E
2 changed files with 30 additions and 30 deletions

View file

@ -6,11 +6,11 @@ import XMonad
import XMonad.Actions.DynamicProjects import XMonad.Actions.DynamicProjects
import XMonad.Util.Run import XMonad.Util.Run
spinVimAndSt :: String -> String -> Project spinTextEditorAndTerm :: String -> String -> Project
spinVimAndSt dir name = spinTextEditorAndTerm dir name =
Project { projectName = name Project { projectName = name
, projectDirectory = dir <> name , projectDirectory = dir <> name
, projectStartHook = Just $ do safeSpawn "vim" ["-g", "+set guifont=Victor\\ Mono\\ SemiBold\\ 18|e ."] , projectStartHook = Just $ do safeSpawn "emacsclient" ["-c"]
safeSpawn "nvidia-offload" ["alacritty","-e","tmux","new","-A","-s",name] safeSpawn "nvidia-offload" ["alacritty","-e","tmux","new","-A","-s",name]
} }
@ -21,6 +21,16 @@ spinChat name =
, projectStartHook = Just $ do safeSpawnProg (name <> "-desktop") , projectStartHook = Just $ do safeSpawnProg (name <> "-desktop")
} }
spinInTermWithName :: String -> String -> Project
spinInTermWithName projectName cmd =
Project { projectName = projectName
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawn "alacritty" ["-e", cmd]
}
spinInTerm :: String -> Project
spinInTerm name = spinInTermWithName name name
justStart :: String -> Project justStart :: String -> Project
justStart name = justStart name =
Project { projectName = name Project { projectName = name
@ -28,9 +38,9 @@ justStart name =
, projectStartHook = Just $ do safeSpawnProg name , projectStartHook = Just $ do safeSpawnProg name
} }
adminProject = spinVimAndSt "~/admin/" adminProject = spinTextEditorAndTerm "~/admin/"
candyProject = spinVimAndSt "~/candy/" candyProject = spinTextEditorAndTerm "~/candy/"
workProject = spinVimAndSt "~/relex/" workProject = spinTextEditorAndTerm "~/relex/"
projects :: [Project] projects :: [Project]
projects = [ adminProject "wrk-config" projects = [ adminProject "wrk-config"
@ -38,15 +48,18 @@ projects = [ adminProject "wrk-config"
, adminProject "overlays-personal" , adminProject "overlays-personal"
, candyProject "dhall-packages" , candyProject "dhall-packages"
, candyProject "hfdb" , candyProject "hfdb"
, spinChat "element"
, spinChat "wire"
, spinChat "signal"
, justStart "obs" , justStart "obs"
, justStart "lens" , spinChat "element"
, spinChat "signal"
, spinChat "wire"
, spinInTerm "k9s"
, spinInTermWithName "email" "neomutt"
, spinTextEditorAndTerm "~/.xmonad" "xmonad"
, workProject "azure-core-infra" , workProject "azure-core-infra"
, workProject "azure-kube-platform" , workProject "azure-kube-platform"
, workProject "bob-the-builder" , workProject "bob-the-builder"
, workProject "calculation-node-playbook" , workProject "calculation-node-playbook"
, workProject "common-cicd-config-private-cloud"
, workProject "communication-nix-101" , workProject "communication-nix-101"
, workProject "connect2-provisioning" , workProject "connect2-provisioning"
, workProject "connect2-terraform" , workProject "connect2-terraform"
@ -54,11 +67,12 @@ projects = [ adminProject "wrk-config"
, workProject "customer-modules" , workProject "customer-modules"
, workProject "docker-images" , workProject "docker-images"
, workProject "gitlab-runners" , workProject "gitlab-runners"
, workProject "gitlab-self-manage"
, workProject "infra-inventory" , workProject "infra-inventory"
, workProject "isengard" , workProject "isengard"
, workProject "isengard-worktree-2" , workProject "isengard-worktree-2"
, workProject "isengard-worktree-3" , workProject "isengard-worktree-3"
, workProject "k8s-learning-path" , workProject "linkerd-plugins"
, workProject "morannon" , workProject "morannon"
, workProject "mordor-ca" , workProject "mordor-ca"
, workProject "mordor-dashboard" , workProject "mordor-dashboard"
@ -75,7 +89,9 @@ projects = [ adminProject "wrk-config"
, workProject "nixos-modules" , workProject "nixos-modules"
, workProject "nixpkgs" , workProject "nixpkgs"
, workProject "prototype-task-tracking" , workProject "prototype-task-tracking"
, workProject "rfcs"
, workProject "sm-terraform" , workProject "sm-terraform"
, workProject "storagegrid-prototype"
, workProject "time-tracking" , workProject "time-tracking"
, workProject "ugluk-ansible-role" , workProject "ugluk-ansible-role"
, Project { projectName = "minecraft" , Project { projectName = "minecraft"
@ -83,20 +99,11 @@ projects = [ adminProject "wrk-config"
, projectStartHook = Just $ do safeSpawnProg "minecraft-launcher" , projectStartHook = Just $ do safeSpawnProg "minecraft-launcher"
safeSpawnProg "mumble" safeSpawnProg "mumble"
} }
, Project { projectName = "xmonad"
, projectDirectory = "~/.xmonad/"
, projectStartHook = Just $ do safeSpawn "vim" ["-g", "+set guifont=Victor\\ Mono\\ SemiBold\\ 18|e ."]
safeSpawn "nvidia-offload" ["alacritty","-e","tmux","new","-A","-s","xmonad"]
}
, Project { projectName = "status" , Project { projectName = "status"
, projectDirectory = "/tmp" , projectDirectory = "/tmp"
, projectStartHook = Just $ do , projectStartHook = Just $ do
safeSpawn "nvidia-offload" ["alacritty","-e","gotop"] safeSpawn "nvidia-offload" ["alacritty","-e","gotop"]
} }
, Project { projectName = "email"
, projectDirectory = "~/mail"
, projectStartHook = Just $ do safeSpawnProg "st"
}
, Project { projectName = "frs" , Project { projectName = "frs"
, projectDirectory = "/tmp" , projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg "ff-relex" , projectStartHook = Just $ do safeSpawnProg "ff-relex"
@ -119,14 +126,6 @@ projects = [ adminProject "wrk-config"
, projectDirectory = "/tmp" , projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg "chromium" , projectStartHook = Just $ do safeSpawnProg "chromium"
} }
, Project { projectName = "teams"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawnProg "teams"
}
, Project { projectName = "notes"
, projectDirectory = "~/zk/"
, projectStartHook = Just $ do safeSpawn "vim" ["-g", "+set guifont=Victor\\ Mono\\ SemiBold\\ 18|call neuron#edit_zettel_new()"]
}
] ]
modify :: XConfig l -> XConfig l modify :: XConfig l -> XConfig l

View file

@ -20,6 +20,7 @@ import XMonad.Layout.ThreeColumns (ThreeCol(..))
import XMonad.Layout.ToggleLayouts (toggleLayouts) import XMonad.Layout.ToggleLayouts (toggleLayouts)
import XMonad.Util.EZConfig import XMonad.Util.EZConfig
import XMonad.Util.SpawnOnce
import qualified Solarized as S import qualified Solarized as S
-- Tidy modules -- Tidy modules
@ -36,8 +37,7 @@ layouts = toggleLayouts fullscreen tiled
fullscreen = (noBorders Full) fullscreen = (noBorders Full)
tiled = smarts $ ifWider (1920 + 1) wideScreen normalScreen tiled = smarts $ ifWider (1920 + 1) wideScreen normalScreen
wideScreen = ThreeColMid 1 (5/100) (1/2) wideScreen = ThreeColMid 1 (5/100) (1/2)
normalScreen = resizableTall normalScreen = ResizableTall 1 (5/100) (1/2) []
resizableTall = ResizableTall 1 (5/100) (1/2) []
smarts = (smartSpacingWithEdge 5) . smartBorders smarts = (smartSpacingWithEdge 5) . smartBorders
--titleBar = noFrillsDeco shrinkText S.theme --titleBar = noFrillsDeco shrinkText S.theme
@ -70,6 +70,7 @@ withConfig =
$ desktopConfig -- on a default desktop config $ desktopConfig -- on a default desktop config
{ manageHook = myManageHook <+> manageHook desktopConfig { manageHook = myManageHook <+> manageHook desktopConfig
, layoutHook = desktopLayoutModifiers layouts , layoutHook = desktopLayoutModifiers layouts
, startupHook = spawnOnce "sh ~/.fehbg"
, terminal = "nvidia-offload alacritty" , terminal = "nvidia-offload alacritty"
, normalBorderColor = S.base03 , normalBorderColor = S.base03
, focusedBorderColor = S.violet , focusedBorderColor = S.violet