Skip to content

Commit

Permalink
Update the configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jhgarner committed Apr 18, 2020
1 parent 679d79c commit 6f45497
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 60 deletions.
2 changes: 1 addition & 1 deletion config/actions.dhall
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let Mode = { modeName : Text, hasButtons : Bool, hasBorders : Bool }
let Direction = <Back | Front>
let Actions = < Insert | RunCommand : Text | ChangeModeTo : Mode | ShowWindow : Text | HideWindow : Text | ZoomInInput | ZoomInMonitor | ZoomOutInput | ZoomOutMonitor | PopTiler | PushTiler | ChangeNamed : Text | Move : Direction | KillActive | ExitNow | ToggleLogging | ZoomMonitorToInput | ZoomInputToMonitor | MoveToFront | MakeEmpty | ChangeToFloating | ChangeToHorizontal | SetFull | SetRotate | SetNoMod | ChangeToTwoCols >
let Actions = < Insert | RunCommand : Text | ChangeModeTo : Mode | ShowWindow : Text | HideWindow : Text | ZoomInInput | ZoomInMonitor | ZoomOutInput | ZoomOutMonitor | PopTiler | PushTiler | ChangeNamed : Text | Move : Direction | KillActive | ExitNow | ToggleLogging | ZoomMonitorToInput | ZoomInputToMonitor | MoveToFront | MakeEmpty | ChangeToFloating | ChangeToHorizontal | SetFull | SetRotate | SetNoMod | ChangeToTwoCols | ToggleDocks >
in {Actions = Actions, Mode = Mode, Direction = Direction}
129 changes: 72 additions & 57 deletions config/config.dhall
Original file line number Diff line number Diff line change
@@ -1,69 +1,84 @@
----------Useful Environment Settings----------
let terminal = "termite"
--^ The command used to launch your terminal
let fontLoc = "/usr/share/fonts/OTF/Fira Code Regular Nerd Font Complete.otf"
--^ The fonts Xest will use in its UI
let launcher = "rofi -show drun"
--^ The command you use to launch other apps


----------Action File Helpers----------
let Actions = ./actions.dhall
let Action = Actions.Actions
let Back = Actions.Direction.Back
let Front = Actions.Direction.Front
let Tiler = ./tilers.dhall
let SimpleKB = {key: Text, actions: List Action}
let KB = {key: Text, actions: List Action, exitActions: List Action, mode: Actions.Mode}


----------Some Scary Looking Helper Functions----------
let newKey = \(mode: Actions.Mode) -> \(l: List SimpleKB) ->
List/fold SimpleKB l (List KB) (\(a: SimpleKB) -> \(ls: List KB) -> [a // {mode = mode, exitActions = []: List Action}] # ls) ([]: List KB)
let mkDesktops = \(n: Natural) ->
let result = Natural/fold n {a: Natural, b: List SimpleKB}
(\(r: {a: Natural, b: List SimpleKB}) -> {a = r.a + 1, b = [{key = Natural/show r.a, actions = [Action.ChangeNamed (Natural/show r.a)]}] # r.b})
({a = 1, b = []: List SimpleKB})
in result.b


----------Keybinding Modes----------
let Normal = { modeName = "Normal", hasButtons = False, hasBorders = True }
let NormalS = { modeName = "NormalS", hasButtons = False, hasBorders = True }
let Resize = { modeName = "Resize", hasButtons = True, hasBorders = True }
let Insert = { modeName = "Insert", hasButtons = False, hasBorders = False }
-- let bind = \(k: Text) -> \(m: Mode) -> \(as: [Action]) -> \(ea: [Action]) -> {key = k, mode = m, actions = as, exitActions = ea}


in {
startupScript = "~/.config/xest/startup.sh",
initialMode = Insert,
fontLocation = "/nix/store/1sldx0ry67bvr6nk7pblqdyl2yrr6lh1-fira-code-2/share/fonts/opentype/FiraCode-Retina.otf",
keyBindings = [
{key = "t", mode = Normal, actions = [Action.RunCommand "kitty"], exitActions = [] : List Action},
{key = "t", mode = NormalS, actions = [Action.ChangeToTwoCols], exitActions = [] : List Action},
{key = "d", mode = Normal, actions = [Action.RunCommand "rofi -show drun"], exitActions = [] : List Action},
{key = "f", mode = NormalS, actions = [Action.ChangeToFloating], exitActions = [] : List Action},
{key = "f", mode = Normal, actions = [Action.MoveToFront], exitActions = [] : List Action},
{key = "n", mode = Normal, actions = [Action.Insert], exitActions = [] : List Action},
{key = "m", mode = Normal, actions = [Action.SetFull], exitActions = [] : List Action},
{key = "c", mode = Normal, actions = [Action.SetNoMod], exitActions = [] : List Action},
{key = "v", mode = Normal, actions = [Action.SetRotate], exitActions = [] : List Action},
{key = "n", mode = NormalS, actions = [Action.ChangeToHorizontal], exitActions = [] : List Action},
{key = "i", mode = NormalS, actions = [Action.ZoomInInput], exitActions = [] : List Action},
{key = "i", mode = Normal, actions = [Action.ZoomInInput], exitActions = [] : List Action},
{key = "Super_L", mode = Insert, actions = [Action.ChangeModeTo Normal, Action.ShowWindow "Polybar"], exitActions = [Action.HideWindow "Polybar"] : List Action},
{key = "Shift_L", mode = Normal, actions = [Action.ChangeModeTo NormalS], exitActions = [] : List Action},
{key = "Escape", mode = NormalS, actions = [Action.ChangeModeTo Normal], exitActions = [] : List Action},
{key = "Escape", mode = Normal, actions = [Action.ChangeModeTo Insert, Action.HideWindow "Polybar"], exitActions = [] : List Action},
{key = "Escape", mode = Resize, actions = [Action.ChangeModeTo Normal], exitActions = [] : List Action},
{key = "o", mode = Normal, actions = [Action.ZoomOutInput], exitActions = [] : List Action},
{key = "o", mode = NormalS, actions = [Action.ZoomOutInput], exitActions = [] : List Action},
-- {key = "Left", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.Move Front, Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "Right", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.Move Back, Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
{key = "Left", mode = Normal, actions = [Action.Move Front], exitActions = [] : List Action},
{key = "Right", mode = Normal, actions = [Action.Move Back], exitActions = [] : List Action},
-- {key = "1", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "1", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "2", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "2", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "3", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "3", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "4", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "4", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "5", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "5", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "6", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "6", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "7", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "7", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "8", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "8", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
-- {key = "9", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.ChangeNamed "9", Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
{key = "1", mode = Normal, actions = [Action.ChangeNamed "1"], exitActions = [] : List Action},
{key = "2", mode = Normal, actions = [Action.ChangeNamed "2"], exitActions = [] : List Action},
{key = "3", mode = Normal, actions = [Action.ChangeNamed "3"], exitActions = [] : List Action},
{key = "4", mode = Normal, actions = [Action.ChangeNamed "4"], exitActions = [] : List Action},
{key = "5", mode = Normal, actions = [Action.ChangeNamed "5"], exitActions = [] : List Action},
{key = "6", mode = Normal, actions = [Action.ChangeNamed "6"], exitActions = [] : List Action},
{key = "7", mode = Normal, actions = [Action.ChangeNamed "7"], exitActions = [] : List Action},
{key = "8", mode = Normal, actions = [Action.ChangeNamed "8"], exitActions = [] : List Action},
{key = "9", mode = Normal, actions = [Action.ChangeNamed "9"], exitActions = [] : List Action},
{key = "y", mode = Normal, actions = [Action.PopTiler], exitActions = [] : List Action},
{key = "p", mode = Normal, actions = [Action.PushTiler], exitActions = [] : List Action},
{key = "r", mode = Normal, actions = [Action.ChangeModeTo Resize], exitActions = [] : List Action},
-- {key = "s", mode = Normal, actions = [Action.ZoomOutMonitor, Action.ZoomOutInput, Action.MakeEmpty, Action.ZoomInInput, Action.ZoomMonitorToInput], exitActions = [] : List Action},
{key = "s", mode = Normal, actions = [Action.MakeEmpty], exitActions = [] : List Action},
{key = "x", mode = Normal, actions = [Action.KillActive], exitActions = [] : List Action},
{key = "z", mode = Normal, actions = [Action.ZoomMonitorToInput], exitActions = [] : List Action},
{key = "z", mode = NormalS, actions = [Action.ZoomInMonitor], exitActions = [] : List Action},
{key = "b", mode = NormalS, actions = [Action.ExitNow], exitActions = [] : List Action},
{key = "w", mode = Normal, actions = [Action.ToggleLogging], exitActions = [] : List Action},
{key = "q", mode = Normal, actions = [Action.ZoomOutMonitor], exitActions = [] : List Action}
]
fontLocation = fontLoc,


keyBindings =
newKey Insert
[ {key = "Super_L", actions = [Action.ChangeModeTo Normal]}
]
#
newKey Normal (
[ {key = "Escape", actions = [Action.ChangeModeTo Insert]}
, {key = "Shift_L", actions = [Action.ChangeModeTo NormalS]}
, {key = "r", actions = [Action.ChangeModeTo Resize]}
, {key = "Return", actions = [Action.RunCommand terminal]}
, {key = "space", actions = [Action.RunCommand launcher]}
, {key = "f", actions = [Action.ToggleDocks]}
, {key = "m", actions = [Action.SetFull]}
, {key = "c", actions = [Action.SetNoMod]}
, {key = "n", actions = [Action.Insert]}
, {key = "v", actions = [Action.SetRotate]}
, {key = "i", actions = [Action.ZoomInInput]}
, {key = "o", actions = [Action.ZoomOutInput]}
, {key = "q", actions = [Action.ZoomOutMonitor]}
, {key = "z", actions = [Action.ZoomMonitorToInput]}
, {key = "s", actions = [Action.MakeEmpty]}
, {key = "w", actions = [Action.ToggleLogging]}
, {key = "Left", actions = [Action.Move Front]}
, {key = "Right", actions = [Action.Move Back]}
] # mkDesktops 9)
#
newKey NormalS
[ {key = "Escape", actions = [Action.ChangeModeTo Normal]}
, {key = "t", actions = [Action.ChangeToTwoCols]}
, {key = "f", actions = [Action.ChangeToFloating]}
, {key = "n", actions = [Action.ChangeToHorizontal]}
, {key = "1", actions = [Action.MoveToFront]}
, {key = "d", actions = [Action.PopTiler]}
, {key = "p", actions = [Action.PushTiler]}
, {key = "x", actions = [Action.KillActive]}
, {key = "b", actions = [Action.ExitNow]}
, {key = "z", actions = [Action.ZoomInMonitor]}
]
#
newKey Resize
[ {key = "Escape", actions = [Action.ChangeModeTo Normal]}
]
}
12 changes: 10 additions & 2 deletions xest-site/userguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ If a Many Tiler is the direct child of the Input Controller, this will change to
the rotate modifier.

setFull
^^^^^^^^^
^^^^^^^

If a Many Tiler is the direct child of the Input Controller, this will change to
the full screen modifier.
Expand All @@ -332,7 +332,7 @@ ChangeNamed (n: Text)
Change to a different child. Currently, the only valid names are numbers.

Move (d: Direction)
^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^

Changes children either forwards or backwards depending on the value
passed to it.
Expand Down Expand Up @@ -363,3 +363,11 @@ ZoomInputToMonitor
^^^^^^^^^^^^^^^^^^

Moves the Input Controller so that it is right in front of the Monitor.


ToggleDocks
^^^^^^^^^^^

Toggles whether to show any docks such as Polybar. Docks are hidden when you
enter full screen although they won't necessarily be restored automatically so
you might want to have this as a keybinding somewhere.

0 comments on commit 6f45497

Please sign in to comment.