initial commit

This commit is contained in:
Maximilian Keßler 2022-07-23 12:44:13 +02:00
commit c9dc82165b
4 changed files with 123 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "xmonad-custom"]
path = xmonad-custom
url = ../xmonad-custom

1
xmonad-custom Submodule

@ -0,0 +1 @@
Subproject commit be10c83957d683147da5aa156d3e79d50ab081b7

118
xmonad.hs Normal file
View file

@ -0,0 +1,118 @@
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import qualified XMonad.StackSet as W
-- DBus for PolyBar support
-- import XMonad.Hooks.DynamicLog
import qualified XMonad.DBus as D
import qualified DBus.Client as DC
-- important for getting polybar to work
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.EwmhDesktops
-- additionalKeysP
import XMonad.Util.EZConfig
-- custom imports for clarity
import XMonad.Custom.BasicKeyBindings
import XMonad.Custom.SystemKeyBindings
import XMonad.Custom.AudioKeyBindings
import XMonad.Custom.ProgramWorkspaces
import XMonad.Custom.NumberWorkspaces
import XMonad.Custom.UniversitySetup
import XMonad.Custom.Layout
import XMonad.Custom.Modifiers
import XMonad.Custom.WorkspaceNames
import XMonad.Custom.TopicSpace
import XMonad.Custom.Prompt
import XMonad.Util.Loggers
-- | temporary to try out
import XMonad.Actions.TopicSpace
import XMonad.Prompt.Workspace
myTryOutKeyBindings = [
]
myTopicItems :: [TopicItem]
myTopicItems = [
TI "1:WEB" ".config" (spawn "firefox")
]
myTopicConfig :: TopicConfig
myTopicConfig = def {
topicDirs = tiDirs myTopicItems
, topicActions = tiActions myTopicItems
, defaultTopicAction = const (pure ())
, defaultTopic = "1:WEB"
}
myTopicWorkspaces = topicNames myTopicItems
promptedGoto :: X ()
promptedGoto = workspacePrompt def goto
promptedShift :: X ()
promptedShift = workspacePrompt def $ windows . W.shift
-- Toggle between the two most recently used topics, but keep
-- screens separate. This needs @workspaceHistoryHook@.
toggleTopic :: X ()
toggleTopic = switchNthLastFocusedByScreen myTopicConfig 1
--
myLogHook :: DC.Client -> PP
myLogHook dbus = def { ppOutput = D.send dbus }
main :: IO ()
main = do
-- Connect to DBus
dbus <- D.connect
-- Request access (needed when sending messages)
D.requestAccess dbus
-- start xmonad. docks is needed to leave space polybar
xmonad . workspaceNamesEwmh . ewmh . ewmhFullscreen . docks $ myXMonadConfig { logHook = dynamicLogWithPP =<< (workspaceNamesPP $ myLogHook dbus) }
-- potentially add ewmh support here. for now, this does not seem to be needed
myXMonadConfig = def {
modMask = myMainModMask
, workspaces = myWorkspaces
, layoutHook = avoidStruts $ myLayout -- avoidStruts to leave space for polybar
, startupHook = spawn "killall polybar; polybar -q main &!" >> topicStartupHook myTopicConfig
}
`additionalKeysP` myKeyBindings
-- | Collect keybindings from imported modules
myKeyBindings :: [(String, X ())]
myKeyBindings = concat [
myBasicKeyBindings
, myUniversitySetupKeyBindings
, mySystemKeyBindings
, myProgramWorkspacesKeyBindings
, myNumberWorkspacesKeyBindings
, myAudioKeyBindings
, myWorkspaceNamesKeyBindings
, myTryOutKeyBindings
]
-- | Workspace management (currently just defaults)
myWorkspaces :: [WorkspaceId]
myWorkspaces = concat [
myNumberWorkspaces
, myProgramWorkspaces
, myTopicWorkspaces
]