121 lines
3.9 KiB
Plaintext
121 lines
3.9 KiB
Plaintext
let Prelude =
|
|
https://prelude.dhall-lang.org/v20.1.0/package.dhall
|
|
sha256:26b0ef498663d269e4dc6a82b0ee289ec565d683ef4c00d0ebdd25333a5a3c98
|
|
|
|
let Config =
|
|
/home/masse/git/xmonad-masser/dhall/package.dhall
|
|
sha256:8cca83716bc75d06cb22c7f45091606159404289d9866601817b2ab81170afcb
|
|
|
|
let pkgs =
|
|
{ qutebrowser = "@qutebrowser@"
|
|
, prompt = "@prompt@"
|
|
, signal = "@signal@"
|
|
, element = "@element@"
|
|
, emacs = "@emacs@"
|
|
, urxvt = "@urxvt@"
|
|
, flameshot = "@flameshot@"
|
|
, obsidian = "@obsidian@"
|
|
, vim = "@vim@"
|
|
, calibre = "@calibre@"
|
|
, spotify = "@spotify@"
|
|
, hledger = "@hledger@"
|
|
, hledger-ui = "@hledger_ui@"
|
|
}
|
|
|
|
let browser = "${pkgs.qutebrowser}/bin/qutebrowser"
|
|
|
|
let terminal = "${pkgs.urxvt}/bin/urxvt"
|
|
let prompt = "${pkgs.prompt}/bin/prompt"
|
|
|
|
let shellIn = \(path : Text) -> "${terminal} -cd ${path}"
|
|
|
|
let paths =
|
|
let pathElement = \(x : Prelude.Map.Entry Text Text) -> x.mapValue
|
|
|
|
in Prelude.Text.concatMapSep
|
|
":"
|
|
(Prelude.Map.Entry Text Text)
|
|
pathElement
|
|
(toMap pkgs)
|
|
|
|
let runOnTopic =
|
|
\(name : Text) ->
|
|
\(action : Text) ->
|
|
Config.Topic::{ name, action = [ Config.Command.Spawn action ] }
|
|
|
|
let spawn = Config.Command.Spawn
|
|
|
|
in Config::{
|
|
, path = paths
|
|
, applications = { terminal, prompt = prompt }
|
|
, topics =
|
|
[ runOnTopic "signal" "${pkgs.signal}/bin/signal-desktop"
|
|
, runOnTopic "element" "${pkgs.element}/bin/element-desktop"
|
|
, runOnTopic "xmonad" (shellIn "/home/masse/git/xmonad-masser")
|
|
, runOnTopic "adhoc" (shellIn "/home/masse/code_practice")
|
|
, Config.Topic::{
|
|
, name = "zettel"
|
|
, action =
|
|
[ spawn "${pkgs.obsidian}/bin/obsidian"
|
|
, spawn "${pkgs.vim}/bin/vim -g"
|
|
]
|
|
}
|
|
, runOnTopic "conf" (shellIn "/etc/nixos")
|
|
, runOnTopic "web" browser
|
|
, Config.Topic::{
|
|
, name = "ledger"
|
|
, action =
|
|
[ spawn
|
|
"${pkgs.vim}/bin/vim -g /home/masse/wikidata/accounting/2021.journal"
|
|
, spawn (shellIn "/home/masse/wikidata/accounting")
|
|
, spawn
|
|
( shellIn
|
|
"/home/masse/wikidata/accounting -e ${pkgs.hledger-ui}/bin/hledger-ui --watch --register checking -U -P"
|
|
)
|
|
, spawn
|
|
( shellIn
|
|
"/home/masse/wikidata/accounting -e ${pkgs.hledger-ui}/bin/hledger-ui --watch --register savings -U -P"
|
|
)
|
|
, spawn
|
|
( shellIn
|
|
"/home/masse/wikidata/accounting -e ${pkgs.hledger-ui}/bin/hledger-ui --watch --register lunchcard -U -P"
|
|
)
|
|
]
|
|
}
|
|
, runOnTopic "pdf" "${pkgs.calibre}/bin/calibre"
|
|
, runOnTopic "music" "${pkgs.spotify}/bin/spotify"
|
|
]
|
|
, bindings =
|
|
let mkCommand =
|
|
\(prefix : Text) ->
|
|
\(name : Text) ->
|
|
\(command : Text) ->
|
|
Config.SubCommand.act
|
|
{ prefix, name, command = Config.Command.Spawn command }
|
|
|
|
let mkSearch =
|
|
\(prefix : Text) ->
|
|
\(name : Text) ->
|
|
\(site : Text) ->
|
|
Config.SubCommand.act
|
|
{ prefix
|
|
, name
|
|
, command = Config.Command.Search { name, browser, site }
|
|
}
|
|
|
|
in [ mkCommand
|
|
"M-<Print>"
|
|
"Take a screenshot"
|
|
"${pkgs.flameshot}/bin/flameshot gui"
|
|
, Config.SubCommand.subMap
|
|
{ prefix = "M-s"
|
|
, name = "Search"
|
|
, sub =
|
|
[ mkSearch "h" "hoogle" "https://hoogle.haskell.org?hoogle="
|
|
, mkSearch "g" "google" "https://google.com/search?q="
|
|
, mkSearch "d" "duckduckgo" "https://duckduckgo.com/?q="
|
|
]
|
|
}
|
|
]
|
|
}
|