Auto Tangle, Whitespace Fixes, & Xmobar Config Changes
- Auto tangle xmonad & xmobar config - Replace ` with ~ for code formatted text - Put code example inside an example block - Change workspaces back to default numbers - Fix leading whitespace in org document - Initial xmobar config changes
This commit is contained in:
34
README.org
34
README.org
@@ -1,12 +1,13 @@
|
||||
#+title: Personal Xmonad Configuration
|
||||
#+title: Personal Xmonad Configuration with Xmobar
|
||||
#+author: Sravan Balaji
|
||||
#+PROPERTY: header-args:haskell :tangle ./xmonad.hs
|
||||
#+auto_tangle: t
|
||||
|
||||
* Welcome
|
||||
|
||||
My personal configuration of Xmonad, written as an [[https://orgmode.org][Org Mode]] document.
|
||||
|
||||
Run the block below with `C-c C-c` to tangle code blocks to config file.
|
||||
Run the block below with ~C-c C-c~ to tangle code blocks to config file.
|
||||
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(org-mode-restart)
|
||||
@@ -85,10 +86,12 @@ of this list.
|
||||
|
||||
A tagging example:
|
||||
|
||||
> workspaces = ["web", "irc", "code" ] ++ map show [4..9]
|
||||
#+begin_example
|
||||
workspaces = ["web", "irc", "code" ] ++ map show [4..9]
|
||||
#+end_example
|
||||
|
||||
#+begin_src haskell
|
||||
myWorkspaces = ["\f868\2081", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
#+end_src
|
||||
|
||||
* Keybindings
|
||||
@@ -108,7 +111,6 @@ is mod1Mask ("left alt"). You may also consider using mod3Mask
|
||||
|
||||
#+begin_src haskell
|
||||
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
||||
|
||||
-- launch a terminal
|
||||
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
|
||||
|
||||
@@ -183,19 +185,15 @@ is mod1Mask ("left alt"). You may also consider using mod3Mask
|
||||
]
|
||||
++
|
||||
|
||||
--
|
||||
-- mod-[1..9], Switch to workspace N
|
||||
-- mod-shift-[1..9], Move client to workspace N
|
||||
--
|
||||
[((m .|. modm, k), windows $ f i)
|
||||
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
|
||||
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
||||
++
|
||||
|
||||
--
|
||||
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
|
||||
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
|
||||
--
|
||||
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
|
||||
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
|
||||
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
|
||||
@@ -234,7 +232,7 @@ The available layouts. Note that each layout is separated by |||,
|
||||
which denotes layout choice.
|
||||
|
||||
*Example With Xmobar*
|
||||
#+begin_src haskell :tangle no
|
||||
#+begin_example
|
||||
myLayout = avoidStruts (tiled ||| Mirror tiled ||| Full)
|
||||
where
|
||||
-- default tiling algorithm partitions the screen into two panes
|
||||
@@ -248,7 +246,7 @@ which denotes layout choice.
|
||||
|
||||
-- Percent of screen to increment by when resizing panes
|
||||
delta = 3/100
|
||||
#+end_src
|
||||
#+end_example
|
||||
|
||||
#+begin_src haskell
|
||||
myLayout = avoidStruts (tiled ||| Mirror tiled ||| Full)
|
||||
@@ -440,14 +438,18 @@ Finally, a copy of the default bindings in simple textual tabular format.
|
||||
* Xmobar
|
||||
|
||||
#+begin_src haskell :tangle ./xmobar.config
|
||||
Config { font = "xft:FiraCode Nerd Font Mono:pixelsize=12:antialias=true:hinting=true"
|
||||
Config { font = "xft:FiraCode Nerd Font Mono:weight=bold:pixelsize=12:antialias=true:hinting=true"
|
||||
, bgColor = "black"
|
||||
, fgColor = "grey"
|
||||
, fgColor = "white"
|
||||
, position = Top
|
||||
, lowerOnStart = True
|
||||
, commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
|
||||
-- , lowerOnStart = True
|
||||
-- , hideOnStart = False
|
||||
-- , allDesktop = True
|
||||
-- , persistent = True
|
||||
, commands = [ Run Weather "KARB" ["-t","<station>: <tempF>F","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
|
||||
, Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
|
||||
, Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10
|
||||
, Run Network "wlp0s20f3" ["-L","0","-H","32","--normal","green","--high","red"] 10
|
||||
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
|
||||
, Run Memory ["-t","Mem: <usedratio>%"] 10
|
||||
, Run Swap [] 10
|
||||
@@ -456,6 +458,6 @@ Finally, a copy of the default bindings in simple textual tabular format.
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = "%cpu% | %memory% * %swap% | %eth0% - %eth1% }{ <fc=#ee9a00>%date%</fc>| %EGPF% | %uname%"
|
||||
, template = "%cpu% | %memory% * %swap% | %wlp0s20f3% }{ <fc=#ee9a00>%date%</fc>| %KARB% | %uname%"
|
||||
}
|
||||
#+end_src
|
||||
|
@@ -1,11 +1,15 @@
|
||||
Config { font = "xft:FiraCode Nerd Font Mono:pixelsize=12:antialias=true:hinting=true"
|
||||
Config { font = "xft:FiraCode Nerd Font Mono:weight=bold:pixelsize=12:antialias=true:hinting=true"
|
||||
, bgColor = "black"
|
||||
, fgColor = "grey"
|
||||
, fgColor = "white"
|
||||
, position = Top
|
||||
, lowerOnStart = True
|
||||
, commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
|
||||
-- , lowerOnStart = True
|
||||
-- , hideOnStart = False
|
||||
-- , allDesktop = True
|
||||
-- , persistent = True
|
||||
, commands = [ Run Weather "KARB" ["-t","<station>: <tempF>F","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
|
||||
, Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
|
||||
, Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10
|
||||
, Run Network "wlp0s20f3" ["-L","0","-H","32","--normal","green","--high","red"] 10
|
||||
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
|
||||
, Run Memory ["-t","Mem: <usedratio>%"] 10
|
||||
, Run Swap [] 10
|
||||
@@ -14,5 +18,5 @@ Config { font = "xft:FiraCode Nerd Font Mono:pixelsize=12:antialias=true:hinting
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = "%cpu% | %memory% * %swap% | %eth0% - %eth1% }{ <fc=#ee9a00>%date%</fc>| %EGPF% | %uname%"
|
||||
, template = "%cpu% | %memory% * %swap% | %wlp0s20f3% }{ <fc=#ee9a00>%date%</fc>| %KARB% | %uname%"
|
||||
}
|
||||
|
@@ -26,12 +26,11 @@ myBorderWidth = 2
|
||||
myNormalBorderColor = "#4D4D4D"
|
||||
myFocusedBorderColor = "#BD93F9"
|
||||
|
||||
myWorkspaces = ["\f868\2081", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
|
||||
myModMask = mod4Mask
|
||||
|
||||
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
||||
|
||||
-- launch a terminal
|
||||
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
|
||||
|
||||
@@ -106,19 +105,15 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
|
||||
]
|
||||
++
|
||||
|
||||
--
|
||||
-- mod-[1..9], Switch to workspace N
|
||||
-- mod-shift-[1..9], Move client to workspace N
|
||||
--
|
||||
[((m .|. modm, k), windows $ f i)
|
||||
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
|
||||
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
||||
++
|
||||
|
||||
--
|
||||
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
|
||||
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
|
||||
--
|
||||
[((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
|
||||
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
|
||||
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
|
||||
|
Reference in New Issue
Block a user