-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,288 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[[commands]] | ||
name = "doc" | ||
command = ''' | ||
echo http://127.0.0.1:9898 | ||
hoogle serve -p 9898 --local | ||
''' | ||
help = "run hoogle server locally for documentation" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
indentation: 2 | ||
comma-style: leading | ||
record-brace-space: true | ||
indent-wheres: true | ||
diff-friendly-import-export: true | ||
respectful: true | ||
haddock-style: multi-line | ||
newlines-between-decls: 1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
module MyLogger where | ||
|
||
import Data.List | ||
import Data.Maybe | ||
import Text.Regex | ||
import XMonad | ||
import XMonad.Hooks.StatusBar.PP | ||
import qualified XMonad.StackSet as W | ||
import XMonad.Util.Loggers | ||
import XMonad.Util.NamedWindows | ||
|
||
totalTitlesLength, unfocusedTitleLength :: Int | ||
totalTitlesLength = 90 | ||
unfocusedTitleLength = 30 | ||
|
||
-- receive one sperate and three funs to format count, focused window and unfocused window | ||
myLogTitles | ||
:: String | ||
-> String | ||
-> (Int -> String) | ||
-> (String -> String) | ||
-> ([String] -> String) | ||
-> Logger | ||
myLogTitles sep1 sep2 formatCount formatFoc formatUnfoc = do | ||
winset <- gets windowset | ||
let focWin = W.peek winset | ||
wins = W.index winset | ||
winsUnfoc = filter (\w -> Just w /= focWin) wins | ||
count = length wins | ||
winNamesUnfoc <- case winsUnfoc of | ||
[] -> pure "" | ||
xs -> (sep2 ++) . formatUnfoc <$> traverse (fmap show . getName) xs | ||
focWinName <- case focWin of | ||
Just justFoc -> | ||
(sep1 ++) | ||
. formatFoc | ||
. shorten (totalTitlesLength - (count - 1) * unfocusedTitleLength) | ||
. show | ||
<$> getName justFoc | ||
Nothing -> pure "" | ||
pure . Just $ formatCount count ++ focWinName ++ winNamesUnfoc | ||
|
||
|
||
logWindowCount :: X (Maybe String) | ||
logWindowCount = withWindowSet ct where | ||
ct ss = | ||
return | ||
$ Just | ||
$ show | ||
$ length | ||
$ W.integrate' | ||
$ W.stack | ||
$ W.workspace | ||
$ W.current ss | ||
|
||
|
||
logMaster :: X Bool | ||
logMaster = withWindowSet isMaster where | ||
isMaster ss = return $ case W.stack . W.workspace . W.current $ ss of | ||
Just (W.Stack _ [] _) -> True | ||
_ -> False | ||
|
||
trimPrefixWithList :: [String] -> Maybe String -> Maybe String | ||
trimPrefixWithList _ Nothing = Nothing | ||
trimPrefixWithList xs (Just s) = case mapMaybe (`stripPrefix` s) xs of | ||
[] -> Just s | ||
n : _ -> trimPrefixWithList xs (Just n) | ||
|
||
trimLayoutModifiers :: Maybe String -> Maybe String | ||
trimLayoutModifiers = trimPrefixWithList ["Spacing", " "] | ||
|
Oops, something went wrong.