Skip to content

Commit 71697b3

Browse files
committed
wip
1 parent eda15ac commit 71697b3

File tree

2 files changed

+64
-50
lines changed

2 files changed

+64
-50
lines changed

BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ package(default_visibility = ["//visibility:public"])
66

77
# MARK: CUT END
88

9+
# config_setting(
10+
# name = "out",
11+
# )
12+
13+
genrule(
14+
name = "cp_xmonad",
15+
srcs = ["//xmonad:xmonad"],
16+
outs = ["xmonad_new"],
17+
cmd = "cp $< $@",
18+
)
19+
920
# Pasted from https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md
1021
#
1122
# Run using

xmonad/xmonad.hs

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import Control.Exception
55
import Control.Monad
6-
import qualified Data.Map as M
6+
--import qualified Data.Map as M
77
import Debug.Trace
88
import System.Directory (XdgDirectory (XdgCache),
99
getXdgDirectory)
@@ -13,8 +13,8 @@ import System.IO
1313
--import XMonad (ManageHook, XConfig, X(), Window, Layout, WindowAttributes, Rectangle, startupHook, handleEventHook, logHook, workspaces, terminal)
1414
import XMonad hiding (display, config)
1515
--import XMonad.Actions.CycleRecentWS
16-
import XMonad.Actions.CycleWS (shiftNextScreen, swapNextScreen)
17-
import XMonad.Actions.GridSelect
16+
--import XMonad.Actions.CycleWS (shiftNextScreen, swapNextScreen)
17+
--import XMonad.Actions.GridSelect
1818
import XMonad.Actions.SpawnOn
1919
--import XMonad.Actions.UpdatePointer
2020
import XMonad.Actions.Warp (warpToWindow)
@@ -23,19 +23,22 @@ import XMonad.Config.Desktop
2323
import XMonad.Hooks.DynamicBars
2424
import XMonad.Hooks.DynamicLog
2525
import XMonad.Hooks.EwmhDesktops
26-
--import XMonad.Hooks.ManageDocks
26+
import XMonad.Hooks.ManageDocks
2727
import XMonad.Hooks.SetWMName
2828
--import XMonad.Hooks.UrgencyHook
2929
import XMonad.Layout.LayoutModifier --(ModifiedLayout)
30-
import XMonad.Layout.NoBorders (smartBorders)
30+
import XMonad.Layout.NoBorders (smartBorders, SmartBorder)
3131
import XMonad.Layout.Tabbed
32+
import XMonad.Layout.Decoration
33+
import XMonad.Layout.Simplest
34+
--import XMonad.Layout.NoBorders
3235
import qualified XMonad.StackSet as W
3336
import XMonad.Util.Dmenu
3437
import XMonad.Util.EZConfig
3538
--import XMonad.Util.NamedWindows (NamedWindow, getName)
3639
import XMonad.Util.Run (spawnPipe)
3740
--import XMonad.Util.Themes
38-
import XMonad.Util.XUtils (fi)
41+
--import XMonad.Util.XUtils (fi)
3942

4043
myNormalBorderColor :: String
4144
myNormalBorderColor = "#7a7a7a"
@@ -207,7 +210,7 @@ myConfig :: [String] -> XConfig (XMonad.Layout.LayoutModifier.ModifiedLayout
207210
(XMonad.Layout.LayoutModifier.ModifiedLayout
208211
XMonad.Layout.NoBorders.SmartBorder Full)))
209212
myConfig args =
210-
myStatusBars $ initialConfig `additionalKeysP` prettyKeys `plusKeys` keys'
213+
myStatusBars $ initialConfig `additionalKeysP` prettyKeys `plusKeys` keys''
211214
where
212215
initialConfig = desktopConfig {
213216
terminal = "termite"
@@ -241,8 +244,8 @@ myConfig args =
241244
, ("<XF86AudioRaiseVolume>", spawn "pactl -- set-sink-volume @DEFAULT_SINK@ +5%")
242245
, ("<XF86AudioLowerVolume>", spawn "pactl -- set-sink-volume @DEFAULT_SINK@ -5%")
243246
]
244-
keys' XConfig { modMask = modMask } =
245-
[((m .|. modMask, k), windows $ f i)
247+
keys'' XConfig { modMask = currModMask } =
248+
[((m .|. currModMask, k), windows $ f i)
246249
| (i, k) <- zip myWorkspaces [xK_1 .. xK_9]
247250
, (f, m) <- [(W.view, 0), (\ws -> (W.view ws) . (W.shift ws), shiftMask)]]
248251

@@ -268,47 +271,47 @@ manageHook' = composeAll
268271
, title =? "Open" --> doFloat
269272
]
270273

271-
keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
272-
keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
273-
[
274-
-- https://hackage.haskell.org/package/X11-1.6.1.1/docs/Graphics-X11-Types.html
275-
-- https://hackage.haskell.org/package/X11-1.6.1.1/docs/Graphics-X11-ExtraTypes.html
276-
-- some defaults copied from http://code.haskell.org/xmonad/XMonad/Config.hs
277-
((modMask, xK_Return), spawnHere $ XMonad.terminal conf) -- %! Launch terminal
278-
, ((modMask, xK_p ), spawn "dmenu_run") -- %! Launch dmenu
279-
, ((modMask, xK_c ), kill) -- %! Close the focused window
280-
, ((modMask, xK_space ), windows W.swapMaster) -- %! Set the focused window as master
281-
--, ((modMask, xK_Tab ), windows W.focusDown) -- %! Move focus to the next window
282-
--, ((modMask .|. shiftMask, xK_Tab), windows W.focusUp) -- %! Move focus to the next window
283-
--, ((modMask, xK_Left ), windows W.focusLeft) -- %! Move focus to the next window
284-
--, ((modMask, xK_Right ), windows W.focusRight) -- %! Move focus to the next window
285-
, ((modMask, xK_Up ), windows W.focusUp) -- %! Move focus to the next window
286-
, ((modMask, xK_Down ), windows W.focusDown) -- %! Move focus to the next window
287-
, ((modMask, xK_minus ), sendMessage Shrink) -- %! Shrink the master area
288-
, ((modMask, xK_equal ), sendMessage Expand) -- %! Expand the master area
289-
, ((modMask, xK_t ), withFocused $ windows . W.sink) -- %! Push window back into tiling
290-
, ((modMask, xK_g ), goToSelected def)
291-
, ((modMask .|. shiftMask, xK_q), io (exitWith ExitSuccess)) -- %! Quit xmonad
292-
, ((modMask .|. shiftMask, xK_o), shiftNextScreen)
293-
, ((modMask .|. mod1Mask, xK_o), swapNextScreen)
294-
]
295-
++
296-
-- workspaces
297-
[((m .|. modMask, k), windows $ f i)
298-
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
299-
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
300-
++
301-
-- mod-[',.] %! Switch to physical/Xinerama screens 1, 2, or 3
302-
-- mod-shift-[',.] %! Move client to screen 1, 2, or 3
303-
[((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
304-
| (key, sc) <- zip [xK_quoteright, xK_comma, xK_period] [0..]
305-
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
274+
-- keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
275+
-- keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
276+
-- [
277+
-- -- https://hackage.haskell.org/package/X11-1.6.1.1/docs/Graphics-X11-Types.html
278+
-- -- https://hackage.haskell.org/package/X11-1.6.1.1/docs/Graphics-X11-ExtraTypes.html
279+
-- -- some defaults copied from http://code.haskell.org/xmonad/XMonad/Config.hs
280+
-- ((modMask, xK_Return), spawnHere $ XMonad.terminal conf) -- %! Launch terminal
281+
-- , ((modMask, xK_p ), spawn "dmenu_run") -- %! Launch dmenu
282+
-- , ((modMask, xK_c ), kill) -- %! Close the focused window
283+
-- , ((modMask, xK_space ), windows W.swapMaster) -- %! Set the focused window as master
284+
-- --, ((modMask, xK_Tab ), windows W.focusDown) -- %! Move focus to the next window
285+
-- --, ((modMask .|. shiftMask, xK_Tab), windows W.focusUp) -- %! Move focus to the next window
286+
-- --, ((modMask, xK_Left ), windows W.focusLeft) -- %! Move focus to the next window
287+
-- --, ((modMask, xK_Right ), windows W.focusRight) -- %! Move focus to the next window
288+
-- , ((modMask, xK_Up ), windows W.focusUp) -- %! Move focus to the next window
289+
-- , ((modMask, xK_Down ), windows W.focusDown) -- %! Move focus to the next window
290+
-- , ((modMask, xK_minus ), sendMessage Shrink) -- %! Shrink the master area
291+
-- , ((modMask, xK_equal ), sendMessage Expand) -- %! Expand the master area
292+
-- , ((modMask, xK_t ), withFocused $ windows . W.sink) -- %! Push window back into tiling
293+
-- , ((modMask, xK_g ), goToSelected def)
294+
-- , ((modMask .|. shiftMask, xK_q), io (exitWith ExitSuccess)) -- %! Quit xmonad
295+
-- , ((modMask .|. shiftMask, xK_o), shiftNextScreen)
296+
-- , ((modMask .|. mod1Mask, xK_o), swapNextScreen)
297+
-- ]
298+
-- ++
299+
-- -- workspaces
300+
-- [((m .|. modMask, k), windows $ f i)
301+
-- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
302+
-- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
303+
-- ++
304+
-- -- mod-[',.] %! Switch to physical/Xinerama screens 1, 2, or 3
305+
-- -- mod-shift-[',.] %! Move client to screen 1, 2, or 3
306+
-- [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
307+
-- | (key, sc) <- zip [xK_quoteright, xK_comma, xK_period] [0..]
308+
-- , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
306309

307-
++
308-
-- my custom additions
309-
[
310-
((modMask, xK_l), spawn "i3lock -c000000")
311-
]
310+
-- ++
311+
-- -- my custom additions
312+
-- [
313+
-- ((modMask, xK_l), spawn "i3lock -c000000")
314+
-- ]
312315

313316
myWorkspaces :: [String]
314-
myWorkspaces = ["1:term","2:web","3:code","4:vm","5:media"] ++ map show [6..9]
317+
myWorkspaces = ["1:term","2:web","3:code","4:vm","5:media"] ++ map show ['6'..'9']

0 commit comments

Comments
 (0)