Compare commits
8 Commits
bd4f5d7e30
...
views
Author | SHA1 | Date | |
---|---|---|---|
cb8917f6cf | |||
6c9bc7399a | |||
f7b1d89755 | |||
1639feed4c | |||
3789e23cb9 | |||
7c27571ca7 | |||
dbd3024d98 | |||
9b16e074ef |
@ -9,8 +9,6 @@ before_script:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- env:
|
|
||||||
- NIXPKGS=https://github.com/NixOS/nixpkgs-channels/archive/nixos-18.09.tar.gz
|
|
||||||
- env:
|
- env:
|
||||||
- NIXPKGS=https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.03.tar.gz
|
- NIXPKGS=https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.03.tar.gz
|
||||||
- env:
|
- env:
|
||||||
|
14
default.nix
14
default.nix
@ -1,3 +1,13 @@
|
|||||||
{ haskellPackages }:
|
{ lib, haskellPackages }:
|
||||||
|
|
||||||
haskellPackages.callCabal2nix "xmonad-masser" ./. {}
|
let
|
||||||
|
filtered = src: lib.sourceByRegex src [
|
||||||
|
"^src.*"
|
||||||
|
"Setup.hs"
|
||||||
|
".*cabal"
|
||||||
|
"LICENSE"
|
||||||
|
];
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
haskellPackages.callCabal2nix "xmonad-masser" (filtered ./.) {}
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
|
{-# LANGUAGE TypeApplications #-}
|
||||||
module XMonad.Config.MasseR where
|
module XMonad.Config.MasseR where
|
||||||
|
|
||||||
|
|
||||||
import XMonad.Password
|
import Control.Lens ((^.))
|
||||||
import XMonad.CustomPrompt
|
import Data.Generics.Product (field)
|
||||||
import XMonad.TopicSpace
|
|
||||||
import qualified Data.List as List
|
import qualified Data.List as List
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Actions.CycleWS (swapNextScreen)
|
import XMonad.Actions.CycleWS (swapNextScreen)
|
||||||
import XMonad.Actions.Search
|
import XMonad.Actions.Search
|
||||||
|
import XMonad.CustomPrompt
|
||||||
import XMonad.Hooks.EwmhDesktops (ewmh, ewmhDesktopsStartup)
|
import XMonad.Hooks.EwmhDesktops (ewmh, ewmhDesktopsStartup)
|
||||||
import XMonad.Hooks.SetWMName (setWMName)
|
import XMonad.Hooks.SetWMName (setWMName)
|
||||||
import XMonad.Hooks.UrgencyHook (args, dzenUrgencyHook,
|
import XMonad.Hooks.UrgencyHook (args, dzenUrgencyHook,
|
||||||
@ -30,8 +32,10 @@ import XMonad.Layout.Tabbed (TabbedDecoration,
|
|||||||
Theme (..), shrinkText,
|
Theme (..), shrinkText,
|
||||||
tabbed)
|
tabbed)
|
||||||
import XMonad.Layout.ToggleLayouts (ToggleLayout (..))
|
import XMonad.Layout.ToggleLayouts (ToggleLayout (..))
|
||||||
|
import XMonad.Password
|
||||||
import XMonad.Prompt.RunOrRaise (runOrRaisePrompt)
|
import XMonad.Prompt.RunOrRaise (runOrRaisePrompt)
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
|
import XMonad.TopicSpace
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
|
|
||||||
import XMonad.XMobar (zenburnPP)
|
import XMonad.XMobar (zenburnPP)
|
||||||
@ -55,9 +59,9 @@ import XMonad.Hooks.DynamicLog (statusBar)
|
|||||||
|
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
|
||||||
spotify :: XConfig l -> NamedAction
|
spotify :: ExtraConfig -> XConfig l -> NamedAction
|
||||||
spotify conf = submapName . mkNamedKeymap conf $
|
spotify extraConf conf = submapName . mkNamedKeymap conf $
|
||||||
[ ("M-p", addName "Play" $ spawn "sp play") ]
|
[ ("M-p", addName "Play" $ spawn (musicToggle . applications $ extraConf)) ]
|
||||||
|
|
||||||
scratchpads :: [NamedScratchpad]
|
scratchpads :: [NamedScratchpad]
|
||||||
scratchpads = [
|
scratchpads = [
|
||||||
@ -73,7 +77,7 @@ scratchSubmaps conf = submapName . mkNamedKeymap conf $ [
|
|||||||
-- Search engines inside submaps
|
-- Search engines inside submaps
|
||||||
searchSubmaps :: ExtraConfig -> XConfig l -> NamedAction
|
searchSubmaps :: ExtraConfig -> XConfig l -> NamedAction
|
||||||
searchSubmaps extraConfig conf =
|
searchSubmaps extraConfig conf =
|
||||||
let mkBrowser = promptSearchBrowser def "qutebrowser"
|
let mkBrowser = promptSearchBrowser def (extraConfig ^. field @"applications" . field @"browser")
|
||||||
_googleP = addName "Search google" $ mkBrowser google
|
_googleP = addName "Search google" $ mkBrowser google
|
||||||
ddgP = addName "Search duckduckgo" $ mkBrowser (searchEngine "duckduckgo" "http://duckduckgo.com/?q=")
|
ddgP = addName "Search duckduckgo" $ mkBrowser (searchEngine "duckduckgo" "http://duckduckgo.com/?q=")
|
||||||
extras = [(key, addName name $ mkBrowser (searchEngine name url)) | Search{..} <- searchEndpoints extraConfig]
|
extras = [(key, addName name $ mkBrowser (searchEngine name url)) | Search{..} <- searchEndpoints extraConfig]
|
||||||
@ -174,9 +178,8 @@ myKeys extraConfig conf =
|
|||||||
, ("<XF86AudioLowerVolume>", addName "Decrease volume" $ spawn "amixer set Master 2%-")
|
, ("<XF86AudioLowerVolume>", addName "Decrease volume" $ spawn "amixer set Master 2%-")
|
||||||
, ("M-<plus>", addName "Increase volume" $ spawn "amixer set Master 2+")
|
, ("M-<plus>", addName "Increase volume" $ spawn "amixer set Master 2+")
|
||||||
, ("M-<minus>", addName "Decrease volume" $ spawn "amixer set Master 2-")
|
, ("M-<minus>", addName "Decrease volume" $ spawn "amixer set Master 2-")
|
||||||
-- , ("<XF86AudioPlay>", addName "Play/pause spotify" $ spawn "/home/masse/.local/bin/sp play")
|
|
||||||
, ("<XF86AudioPlay>", addName "Play/pause mopidy" $ spawn "mpc toggle")
|
, ("<XF86AudioPlay>", addName "Play/pause mopidy" $ spawn "mpc toggle")
|
||||||
, ("M-m", spotify conf)
|
, ("M-m", spotify extraConfig conf)
|
||||||
, ("M-S-<Space>", addName "Swap screens" swapNextScreen)
|
, ("M-S-<Space>", addName "Swap screens" swapNextScreen)
|
||||||
, ("M-<Backspace>", addName "Kill window" kill)
|
, ("M-<Backspace>", addName "Kill window" kill)
|
||||||
-- scrot requires `unGrab`
|
-- scrot requires `unGrab`
|
||||||
|
@ -10,6 +10,7 @@ data Applications =
|
|||||||
, prompt :: FilePath
|
, prompt :: FilePath
|
||||||
, screenshot :: FilePath
|
, screenshot :: FilePath
|
||||||
, urxvt :: FilePath
|
, urxvt :: FilePath
|
||||||
|
, musicToggle :: FilePath
|
||||||
} deriving (Show, Generic)
|
} deriving (Show, Generic)
|
||||||
|
|
||||||
data TopicRule =
|
data TopicRule =
|
||||||
|
@ -4,7 +4,6 @@ module XMonad.TopicSpace (topicKeys', addTopic, TopicAction(..)) where
|
|||||||
import XMonad.Actions.TopicSpace
|
import XMonad.Actions.TopicSpace
|
||||||
import XMonad
|
import XMonad
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import XMonad.Actions.GridSelect
|
|
||||||
import XMonad.Actions.DynamicWorkspaces
|
import XMonad.Actions.DynamicWorkspaces
|
||||||
import XMonad.TopicUtils
|
import XMonad.TopicUtils
|
||||||
import XMonad.Util.EZConfig (mkNamedKeymap)
|
import XMonad.Util.EZConfig (mkNamedKeymap)
|
||||||
@ -42,7 +41,6 @@ myTopicConfig extraConfig =
|
|||||||
topicKeys' :: ExtraConfig -> XConfig l -> [(String, NamedAction)]
|
topicKeys' :: ExtraConfig -> XConfig l -> [(String, NamedAction)]
|
||||||
topicKeys' extraConfig conf = [ ("M-y", addName "Change topic" $ visualSelect (myTopicConfig extraConfig))
|
topicKeys' extraConfig conf = [ ("M-y", addName "Change topic" $ visualSelect (myTopicConfig extraConfig))
|
||||||
, ("M-S-g", addName "Move window to topic" $ gridselectMove def)
|
, ("M-S-g", addName "Move window to topic" $ gridselectMove def)
|
||||||
, ("M-u", addName "Select window" $ gotoSelected' def{gs_colorizer = fromClassName})
|
|
||||||
, ("M-<Return>", addName "Open project action" $ currentTopicAction' (myTopicConfig extraConfig))
|
, ("M-<Return>", addName "Open project action" $ currentTopicAction' (myTopicConfig extraConfig))
|
||||||
, ("M-w", modificationSubmaps' conf)]
|
, ("M-w", modificationSubmaps' conf)]
|
||||||
|
|
||||||
|
@ -26,9 +26,11 @@ safeRunInTerm dir Nothing = safeSpawn "urxvt" ["-cd", dir]
|
|||||||
safeRunInTerm dir (Just command) = safeSpawn "urxvt" ["-cd", dir, "-e", command]
|
safeRunInTerm dir (Just command) = safeSpawn "urxvt" ["-cd", dir, "-e", command]
|
||||||
|
|
||||||
inactiveTags :: X [WorkspaceId]
|
inactiveTags :: X [WorkspaceId]
|
||||||
inactiveTags = map W.tag . inactive' <$> gets windowset
|
inactiveTags = inactive' <$> gets windowset
|
||||||
where
|
where
|
||||||
inactive' s = W.hidden s ++ map W.workspace (filter (\w -> (W.tag . W.workspace . W.current) s /= (W.tag . W.workspace) w) (W.visible s))
|
inactive' s =
|
||||||
|
let current = W.currentTag s
|
||||||
|
in filter (current /=) . map W.tag $ W.hidden s <> map W.workspace (W.visible s)
|
||||||
|
|
||||||
gridselectMove :: GSConfig WorkspaceId -> X ()
|
gridselectMove :: GSConfig WorkspaceId -> X ()
|
||||||
gridselectMove conf = do
|
gridselectMove conf = do
|
||||||
@ -48,7 +50,10 @@ gsConfig = def{gs_navigate = navNSearch, gs_colorizer = fromClassName}
|
|||||||
-- - Takes a topicspace viewfunc
|
-- - Takes a topicspace viewfunc
|
||||||
gridselectWorkspace :: GSConfig WorkspaceId -> (WorkspaceId -> X ()) -> X ()
|
gridselectWorkspace :: GSConfig WorkspaceId -> (WorkspaceId -> X ()) -> X ()
|
||||||
gridselectWorkspace conf viewFunc = withWindowSet $ \ws -> do
|
gridselectWorkspace conf viewFunc = withWindowSet $ \ws -> do
|
||||||
let wss = map W.tag . W.hidden $ ws
|
let wss = filter (/= current) . map W.tag $ invisible <> visible
|
||||||
|
visible = fmap W.workspace (W.visible ws)
|
||||||
|
invisible = W.hidden ws
|
||||||
|
current = W.currentTag ws
|
||||||
gridselect conf (zip wss wss) >>= flip whenJust viewFunc
|
gridselect conf (zip wss wss) >>= flip whenJust viewFunc
|
||||||
|
|
||||||
gotoSelected' :: GSConfig Window -> X ()
|
gotoSelected' :: GSConfig Window -> X ()
|
||||||
|
@ -34,5 +34,7 @@ library
|
|||||||
, unix
|
, unix
|
||||||
, containers
|
, containers
|
||||||
, text
|
, text
|
||||||
|
, lens
|
||||||
|
, generic-lens
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
Reference in New Issue
Block a user