aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2022-06-15 22:00:21 +0300
committerla-ninpre <leobrekalini@gmail.com>2022-06-15 22:00:21 +0300
commit3da3ace194a06ff8867257a38e57decb8a12358a (patch)
treee00d6af3521f9daa97c1319b544a6760b75128d8 /lib
parent6b079b837b24650a8aff7fb78f5d3dea11c80c3b (diff)
downloadxmonad-config-3da3ace194a06ff8867257a38e57decb8a12358a.tar.gz
xmonad-config-3da3ace194a06ff8867257a38e57decb8a12358a.zip
major refactoring
change color theme fix haddock fix gridselect theme fix tabbed theme
Diffstat (limited to 'lib')
-rw-r--r--lib/LaNinpreConfig.hs217
1 files changed, 96 insertions, 121 deletions
diff --git a/lib/LaNinpreConfig.hs b/lib/LaNinpreConfig.hs
index 637fd88..893699a 100644
--- a/lib/LaNinpreConfig.hs
+++ b/lib/LaNinpreConfig.hs
@@ -1,9 +1,11 @@
-{-# OPTIONS_HADDOCK ignore-exports, prune #-}
+{-# OPTIONS_HADDOCK prune #-}
----------------------------------------------------------------------
-- |
-- Module : LaNinpreConfig
-- Description : personal stuff for xmonad
-- Maintainer : la-ninpre
+-- License : ISC
+-- Copyright : la-ninpre <aaoth AT aaoth DOT xyz>
--
-- this module exists because i find it more convenient to manage some things
-- from here instead of doing it right in xmonad config
@@ -11,25 +13,46 @@
----------------------------------------------------------------------
module LaNinpreConfig (
- -- * global
-- $global
+
+ -- * fonts
+ -- $fonts
myFonts,
- myColor,
- myModMask,
+
+ -- * colors
+ -- $colors
+ MyColorTheme(..),
+ def,
+ myNormColor,
+ myFocusColor,
+
+ -- * software constants
+ -- $software
myTerminal,
myBrowser,
myGeminiClient,
myFileMgr,
myMocp,
myEditor,
+
+ -- * hooks
+ -- $hooks
+ myManageHook,
+ myStartupHook,
+
+ -- * scratchpads
+ -- $scratchpads
+ myScratchPads,
+
+ -- * workspaces
+ -- $workspaces
+ myWorkspaces,
+
+ -- * misc
+ -- $misc
+ myModMask,
myBorderWidth,
- myNormColor,
- myFocusColor,
myAppGrid,
- myWorkspaces,
- myScratchPads,
- myManageHook,
- myStartupHook
) where
import Data.List
@@ -49,18 +72,12 @@ import XMonad.Util.SpawnOnce
-- constants and functions starting with \'my\' are exported and used in
-- xmonad config.
--- * constants
-
--- $constants
--- these are set up to avoid unnecessary repetition of replacements, when
--- things change.
-
--- ** fonts
---
-- $fonts
+--
-- default fonts and helper functions for them.
-- | default lato font
+fontLatoDef :: String
fontLatoDef = fontXft "Lato" "regular" 14
-- | font for @ShowWMName@
@@ -72,6 +89,7 @@ fontLatoDef = fontXft "Lato" "regular" 14
-- sitelen pona pona variant
--
-- > fontSWN = fontXft "sitelen\\-pona" "regular" 80
+fontSWN :: String
fontSWN = fontXft "linja pona" "regular" 80
-- | fonts list
@@ -80,7 +98,7 @@ myFonts = [ fontLatoDef
, fontSWN
]
--- *** helper functions
+-- ** helper functions
--
-- | font constructor
--
@@ -88,7 +106,7 @@ myFonts = [ fontLatoDef
-- with xft.
fontXft :: String -- ^ font family
-> String -- ^ font style
- -> Int -- ^ font style
+ -> Int -- ^ font size
-> String
fontXft font style size = intercalate ":" [ "xft"
@@ -99,86 +117,46 @@ fontXft font style size = intercalate ":" [ "xft"
, "hinting=true"
]
-
--- ** colors
-
--- $colorTheme
+-- $colors
--
--- > bg #19191a
--- > fg #cadcde
--- > grey0 #232324
--- > grey1 #363638
--- > grey2 #66666a
--- > black #393838
--- > red #c74444
--- > green #7f9848
--- > yellow #d7a06d
--- > blue #4e96d5
--- > magenta #bc5fa7
--- > cyan #55b795
--- > white #c3b2f7
--- > black-bright #5a514b
--- > red-bright #ed7c68
--- > green-bright #c7ea76
--- > yellow-bright #ffdb9d
--- > blue-bright #a6d5fe
--- > magenta-bright #edbbe9
--- > cyan-bright #7fe2c5
--- > white-bright #e2d6ff
-
--- | color theme structure
-myColorTheme :: [(String,String)]
-myColorTheme = [ ("bg", "#19191a")
- , ("fg", "#cadcde")
- , ("gray0", "#232324")
- , ("gray1", "#363638")
- , ("gray2", "#5c5c60")
- , ("gray3", "#66666a")
- , ("gray4", "#ececf0")
- , ("black", "#393838")
- , ("red", "#c74444")
- , ("green", "#7f9848")
- , ("yellow", "#d7a06d")
- , ("blue", "#4e96d5")
- , ("magenta", "#bc5fa7")
- , ("cyan", "#55b795")
- , ("white", "#c3b2f7")
- , ("black-bright", "#5a514b")
- , ("red-bright", "#ed7c68")
- , ("green-bright", "#c7ea76")
- , ("yellow-bright", "#ffdb9d")
- , ("blue-bright", "#a6d5fe")
- , ("magenta-bright", "#edbbe9")
- , ("cyan-bright", "#7fe2c5")
- , ("white-bright", "#e2d6ff")
- ]
+-- color theme and stuff
+
+myColorTheme :: MyColorTheme
+myColorTheme = MyColorTheme "#111111" "#ccbbcc" "#223333" "#ffaaaa"
-- | unfocused window border colour
myNormColor :: String
-myNormColor = myColor "gray0"
+myNormColor = col_bg def
-- | focused window border colour
myFocusColor :: String
-myFocusColor = myColor "blue"
+myFocusColor = col_bg_alt def
--- *** helper functions
+-- | color theme datatype
--
--- | get color from color theme
-myColor :: String -> String
-myColor c = fromMaybe "" (M.lookup c theme)
- where
- theme = fromList myColorTheme
+-- 'Default' instance gives simple four-color colorscheme
+data MyColorTheme = MyColorTheme {
+ col_bg :: String,
+ col_fg :: String,
+ col_bg_alt :: String,
+ col_fg_alt :: String
+}
+
+instance Default MyColorTheme where
+ def = myColorTheme
--- ** software constants
+-- $software
--
+-- these are just contstants
+
-- | set terminal emulator
myTerminal :: String
myTerminal = "alacritty"
-- | set default browser
myBrowser :: String
-myBrowser = "brave"
+myBrowser = "firefox"
-- | set gemini client
myGeminiClient :: String
@@ -199,63 +177,37 @@ myMocp = "mocp -M '~/.config/moc'"
myEditor :: String
myEditor = myTerminal ++ " -e vim"
--- ** other constants
+-- $hooks
--
--- | set windows key as modkey
-myModMask :: KeyMask
-myModMask = mod4Mask
-
--- | specify border width
-myBorderWidth :: Dimension
-myBorderWidth = 1
+-- hooks for xmonad config
--- | app grid for @GridSelect@ layout
-myAppGrid :: [(String,String)]
-myAppGrid = [ ("discord", "discord")
- , ("steam", "steam")
- , ("cadence", "cadence")
- , ("blender", "blender")
- , ("inkscape", "inkscape")
- , ("obs", "obs")
- , ("gimp", "gimp")
- , ("element", "element-desktop")
- , ("ardour", "ardour6")
- , ("kdenlive", "kdenlive")
- , ("writer", "lowriter")
- ]
-
--- * hooks
---
-- ** startup hook
--
--- $startupHook
---
-- start things at login.
-- | actual instance
myStartupHook :: X ()
myStartupHook = do
- spawnOnce "dunst &"
- spawnOnce "lxsession &"
- spawnOnce "picom &"
- spawnOnce "nm-applet &"
- spawnOnce "volumeicon &"
+ --spawnOnce "dunst &"
+ --spawnOnce "lxsession &"
+ --spawnOnce "picom &"
+ --spawnOnce "nm-applet &"
+ --spawnOnce "volumeicon &"
spawnOnce "setxkbmap -layout us,ru -option 'grp:alt_shift_toggle'"
spawnOnce "kbdd"
- spawnOnce ("trayer --edge top "
+ {-spawnOnce ("trayer --edge top "
++ "--align right "
++ "--widthtype request "
++ "--SetDockType true --SetPartialStrut true --expand false "
++ "--monitor 0 --transparent true --alpha 0 "
++ "--tint 0x19191a --height 24 &"
)
+ -}
spawnOnce "~/.fehbg &"
setWMName "LG3D"
-- ** manage hook
--
--- $managehook
---
-- @doFloat@ forces a window to float. useful for dialog boxes and such.
-- using @doShift (myWorkspaces !! 7)@ sends program to workspace 8
-- i'm doing it this way because otherwise i would have to write out the full
@@ -307,8 +259,6 @@ myManageHook = composeAll
, isFullscreen --> doFullFloat
] <+> namedScratchpadManageHook myScratchPads
--- * scratchpads
---
-- $scratchpads
--
-- currently i have:
@@ -385,8 +335,6 @@ mpvGeometry h w = " --geometry=" ++ show pw ++ "x" ++ show ph
pw = ceiling (1920 * w)
ph = ceiling (1080 * h)
--- * workspaces
---
-- $workspaces
--
-- i've got three ways of specifying them. first one is pretty close to the
@@ -425,6 +373,7 @@ mpvGeometry h w = " --geometry=" ++ show pw ++ "x" ++ show ph
-- > ]
-- | workspaces container
+myWorkspaces :: [String]
myWorkspaces = [ "\xe661\xe921" -- sona nanpa
, "\xe63b" -- musi
, "\xe649" -- pali
@@ -435,3 +384,29 @@ myWorkspaces = [ "\xe661\xe921" -- sona nanpa
, "\xf010\xe915" -- sitelen tawa
, "\xf010\xf107" -- sitelen ante
]
+
+-- $misc
+--
+-- misc constants
+
+-- | set windows key as modkey
+myModMask :: KeyMask
+myModMask = mod4Mask
+
+-- | specify border width
+myBorderWidth :: Dimension
+myBorderWidth = 1
+
+-- | app grid for 'GridSelect' layout
+myAppGrid :: [(String,String)]
+myAppGrid = [ ("discord" ,"discord" )
+ , ("steam" ,"steam" )
+ , ("mail" ,"thunderbird")
+ , ("files" ,"thunar" )
+ , ("blender" ,"blender-3.1")
+ , ("inkscape" ,"inkscape" )
+ , ("obs" ,"obs" )
+ , ("gimp" ,"gimp" )
+ , ("ardour" ,"ardour6" )
+ , ("kdenlive" ,"kdenlive" )
+ ]