Merge branch 'master' of framagit.org:mpo/xmonad-config

This commit is contained in:
Martin Potier 2019-05-16 09:05:44 +03:00
commit 1600ae6e77
2 changed files with 29 additions and 13 deletions

View file

@ -8,7 +8,7 @@ import Data.List (sort, isSuffixOf)
import Data.Maybe (isJust)
import Graphics.X11.Types
import System.Exit
import Text.EditDistance
-- import Text.EditDistance
import XMonad
import XMonad.Actions.CycleWS
import XMonad.Actions.DynamicProjects
@ -82,15 +82,15 @@ promptConfig = def
, promptBorderWidth = 5
}
-- Slightly taken from
-- https://mail.haskell.org/pipermail/xmonad/2010-October/010671.html
data FuzzySpawn = FuzzySpawn deriving (Read, Show)
instance XPrompt FuzzySpawn where showXPrompt _ = "RunC: "
fuzzyPrompt config = do
cmds <- io getCommands
let compl s
| null s = []
| otherwise = let weight c = levenshteinDistance defaultEditCosts s c
in map snd $ take 20 $ sort $ map (\c -> (weight c,c)) cmds
mkXPrompt FuzzySpawn config (return . compl) spawn
-- -- Slightly taken from
-- -- https://mail.haskell.org/pipermail/xmonad/2010-October/010671.html
-- data FuzzySpawn = FuzzySpawn deriving (Read, Show)
-- instance XPrompt FuzzySpawn where showXPrompt _ = "RunC: "
-- fuzzyPrompt config = do
-- cmds <- io getCommands
-- let compl s
-- | null s = []
-- | otherwise = let weight c = levenshteinDistance defaultEditCosts s c
-- in map snd $ take 20 $ sort $ map (\c -> (weight c,c)) cmds
-- mkXPrompt FuzzySpawn config (return . compl) spawn
--

View file

@ -71,6 +71,22 @@ projects = [ Project { projectName = "admin"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do safeSpawn "nix" ["run", "nixpkgs.chromium", "-c", "chromium"]
}
, Project { projectName = "steam"
, projectDirectory = "~/"
, projectStartHook = Just $ do spawn "steam"
}
, Project { projectName = "web"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do spawn "firefox"
}
, Project { projectName = "yt"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do spawn "ytapp-launcher.sh"
}
, Project { projectName = "Diablo"
, projectDirectory = "/tmp"
, projectStartHook = Just $ do spawn "/run/current-system/sw/bin/wine '/home/eeva/.wine/drive_c/Program Files/Battle.net/Battle.net Launcher.exe'"
}
]
modify :: XConfig l -> XConfig l