generated from srid/haskell-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9ab6f6
commit 467bee3
Showing
7 changed files
with
167 additions
and
83 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,73 @@ | ||
module Main where | ||
import XMonad | ||
import Data.Monoid | ||
import System.Exit | ||
import XMonad.Layout.Tabbed | ||
import XMonad.Util.EZConfig | ||
import XMonad.Hooks.EastGate | ||
import XMonad.Util.NamedScratchpad | ||
|
||
import Main.Utf8 qualified as Utf8 | ||
import qualified XMonad.StackSet as W | ||
import qualified Data.Map as M | ||
|
||
{- | | ||
Main entry point. | ||
myTerminal = "alacritty" | ||
|
||
The `, run` script will invoke this function. | ||
-} | ||
main :: IO () | ||
main = do | ||
-- For withUtf8, see https://serokell.io/blog/haskell-with-utf8 | ||
Utf8.withUtf8 $ do | ||
putTextLn "Hello 🌎" | ||
myFocusFollowsMouse :: Bool | ||
myFocusFollowsMouse = False | ||
|
||
myBorderWidth = 1 | ||
|
||
myModMask = mod4Mask | ||
|
||
myWorkspaces = ["1","2","3","4","5","6","7","8","9"] | ||
|
||
myNormalBorderColor = "#dddddd" | ||
myFocusedBorderColor = "#ff0000" | ||
|
||
myLayout = tiled ||| Mirror tiled ||| Full ||| simpleTabbed | ||
where | ||
tiled = Tall nmaster delta ratio | ||
nmaster = 1 | ||
ratio = 1/2 | ||
delta = 3/100 | ||
|
||
scratchpads = [ NS "term" "alacritty -T scratchpad" queryTerm manageTerm] | ||
where | ||
queryTerm = title =? "scratchpad" | ||
manageTerm = customFloating $ W.RationalRect xOffset yOffset width height | ||
where | ||
width = 0.9 | ||
height = 0.9 | ||
xOffset = 0.05 | ||
yOffset = 0.05 | ||
|
||
myManageHook = composeAll | ||
[ className =? "MPlayer" --> doFloat | ||
, className =? "Gimp" --> doFloat | ||
, resource =? "desktop_window" --> doIgnore | ||
, resource =? "kdesktop" --> doIgnore | ||
, namedScratchpadManageHook scratchpads | ||
] | ||
|
||
myStartupHook :: X () | ||
myStartupHook = | ||
spawn "myxmobar" | ||
|
||
main = xmonad $ (withMetrics def) $ myConfig | ||
|
||
myConfig = def | ||
{ terminal = myTerminal | ||
, modMask = mod4Mask | ||
, layoutHook = myLayout | ||
, focusFollowsMouse = False | ||
, borderWidth = 1 | ||
, workspaces = myWorkspaces | ||
, normalBorderColor = "#dddddd" | ||
, focusedBorderColor = "#ff0000" | ||
, manageHook = myManageHook | ||
, startupHook = myStartupHook | ||
} | ||
`additionalKeysP` | ||
[ ("M-f", spawn "firefox") | ||
, ("M-r", spawn "rofi -show drun") | ||
, ("M-o", namedScratchpadAction scratchpads "term") | ||
] |