diff options
author | Michal Minar <miminar@redhat.com> | 2016-06-25 20:34:24 +0200 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2016-06-25 20:34:24 +0200 |
commit | 31a2490bd2438a5f9d605c9744d40bc6896b3265 (patch) | |
tree | 84e10480c29b33ea242388a1cfcc0795141fafae | |
parent | 3869cf66c0700144513a08d611b47817c8762bf3 (diff) | |
download | xminad-31a2490bd2438a5f9d605c9744d40bc6896b3265.tar.gz xminad-31a2490bd2438a5f9d605c9744d40bc6896b3265.tar.xz xminad-31a2490bd2438a5f9d605c9744d40bc6896b3265.zip |
Tabs Outliner is now a named scratchpad
Signed-off-by: Michal Minar <miminar@redhat.com>
-rw-r--r-- | src/XMonad/Local/Config.hs | 10 | ||||
-rw-r--r-- | src/XMonad/Local/Keys.hs | 35 | ||||
-rw-r--r-- | src/XMonad/Local/Layout.hs | 2 | ||||
-rw-r--r-- | src/XMonad/Local/ManageHook.hs | 81 | ||||
-rw-r--r-- | src/XMonad/Local/NamedScratchpad.hs | 10 |
5 files changed, 76 insertions, 62 deletions
diff --git a/src/XMonad/Local/Config.hs b/src/XMonad/Local/Config.hs index 3224404..ecca2e4 100644 --- a/src/XMonad/Local/Config.hs +++ b/src/XMonad/Local/Config.hs @@ -2,9 +2,13 @@ module XMonad.Local.Config ( explorer , xpConfig , terminal + , tabsOutlinerAppID + , tabsOutlinerAppName + , tabsOutlinerFloatRect ) where import qualified XMonad.Prompt as P +import qualified XMonad.StackSet as W explorer :: String explorer = "caja" @@ -22,3 +26,9 @@ xpConfig = P.def , P.height = 24 } +tabsOutlinerAppID :: String +tabsOutlinerAppID = "eggkanocgddhmamlbiijnphhppkpkmkl" +tabsOutlinerAppName :: String +tabsOutlinerAppName = "crx_" ++ tabsOutlinerAppID +tabsOutlinerFloatRect :: W.RationalRect +tabsOutlinerFloatRect = W.RationalRect (1/5) (1/11) (3/5) (7/9) diff --git a/src/XMonad/Local/Keys.hs b/src/XMonad/Local/Keys.hs index 8d9329c..6965be6 100644 --- a/src/XMonad/Local/Keys.hs +++ b/src/XMonad/Local/Keys.hs @@ -191,28 +191,29 @@ genericKeys conf = [ , ("C-q", spawn "mate-screensaver-command --lock" >> spawn "xset dpms force off") -- namedScratchpads - , ("C-S-t", namedScratchpadAction namedScratchpads "htop") + , ("C-S-h", namedScratchpadAction namedScratchpads "htop") , ("C-S-a", namedScratchpadAction namedScratchpads "stardict") , ("C-S-n", namedScratchpadAction namedScratchpads "notes") , ("C-S-u", namedScratchpadAction namedScratchpads "charmap") , ("C-S-l", namedScratchpadAction namedScratchpads "alarm") , ("C-S-p", namedScratchpadAction namedScratchpads "volctl") + , ("C-S-t", namedScratchpadAction namedScratchpads "tabsoutliner") -- misc , ("S-h", PSsh.sshPrompt xpConfig) --, ("<Print>", spawn "xfce4-screenshooter") , ("y", SUB.submap $ EZ.mkKeymap conf $ concat [ [(k, a), (modm ++ "-" ++ k, a)] - | (k, a) <- [ ("n", io $ liftM fromRight (MPD.withMPD MPD.next)) - , ("p", io $ liftM fromRight (MPD.withMPD MPD.previous)) - , ("S-.", io $ liftM fromRight (MPD.withMPD MPD.next)) - , ("S-,", io $ liftM fromRight (MPD.withMPD MPD.previous)) - , ("y", io $ liftM fromRight (MPD.withMPD (MPD.play Nothing))) - , ("s", io $ liftM fromRight (MPD.withMPD MPD.stop)) - , ("r", io $ liftM fromRight (MPD.withMPD Local.toggleRepeat)) - , ("*", io $ liftM fromRight (MPD.withMPD Local.toggleRandom)) - , ("S-8", io $ liftM fromRight (MPD.withMPD Local.toggleRandom)) - , ("<Space>", io $ liftM fromRight (MPD.withMPD MPD.toggle)) + | (k, a) <- [ ("n", io $ fmap fromRight (MPD.withMPD MPD.next)) + , ("p", io $ fmap fromRight (MPD.withMPD MPD.previous)) + , ("S-.", io $ fmap fromRight (MPD.withMPD MPD.next)) + , ("S-,", io $ fmap fromRight (MPD.withMPD MPD.previous)) + , ("y", io $ fmap fromRight (MPD.withMPD (MPD.play Nothing))) + , ("s", io $ fmap fromRight (MPD.withMPD MPD.stop)) + , ("r", io $ fmap fromRight (MPD.withMPD Local.toggleRepeat)) + , ("*", io $ fmap fromRight (MPD.withMPD Local.toggleRandom)) + , ("S-8", io $ fmap fromRight (MPD.withMPD Local.toggleRandom)) + , ("<Space>", io $ fmap fromRight (MPD.withMPD MPD.toggle)) ] ]) , ("<Print>", spawn "mate-screenshot") @@ -222,8 +223,8 @@ genericKeys conf = [ -- MPD -- mov current playing song in mpd to thrash , ("<Delete>", spawn "mpcrm") - , ("<XF86Forward>", io $ liftM fromRight (MPD.withMPD MPD.next)) - , ("<XF86Back>", io $ liftM fromRight (MPD.withMPD MPD.previous)) + , ("<XF86Forward>", io $ fmap fromRight (MPD.withMPD MPD.next)) + , ("<XF86Back>", io $ fmap fromRight (MPD.withMPD MPD.previous)) ] @@ -255,10 +256,10 @@ unprefixedKeys = [ , ("<XF86HomePage>", TS.switchTopic topicConfig "web") -- mpc - , ("<XF86AudioPlay>", io $ liftM fromRight (MPD.withMPD MPD.toggle)) - , ("<XF86AudioStop>", io $ liftM fromRight (MPD.withMPD MPD.stop)) - , ("<XF86AudioNext>", io $ liftM fromRight (MPD.withMPD MPD.next)) - , ("<XF86AudioPrev>", io $ liftM fromRight (MPD.withMPD MPD.previous)) + , ("<XF86AudioPlay>", io $ fmap fromRight (MPD.withMPD MPD.toggle)) + , ("<XF86AudioStop>", io $ fmap fromRight (MPD.withMPD MPD.stop)) + , ("<XF86AudioNext>", io $ fmap fromRight (MPD.withMPD MPD.next)) + , ("<XF86AudioPrev>", io $ fmap fromRight (MPD.withMPD MPD.previous)) -- volume , ("<XF86AudioMute>", void toggleMute) diff --git a/src/XMonad/Local/Layout.hs b/src/XMonad/Local/Layout.hs index 0d37163..12b23f4 100644 --- a/src/XMonad/Local/Layout.hs +++ b/src/XMonad/Local/Layout.hs @@ -81,7 +81,7 @@ gimpL = LN.named "GIMP" ( CP.ClassName "Gimp" `CP.And` CP.Not (CP.Role "gimp-image-window")) -webL = IM.withIM (1%4) (IM.ClassName "google-chrome" `IM.And` IM.Title "Tabs Outliner") $ easyLay +webL = IM.withIM (1%4) (IM.ClassName "google-chrome" `IM.And` IM.Title "Tabs Outliner") easyLay bgL = windowNavigation $ BW.boringWindows $ smartBorders $ reflectHoriz $ Tall nmaster delta (7/9) diff --git a/src/XMonad/Local/ManageHook.hs b/src/XMonad/Local/ManageHook.hs index fbabd10..b3a7df9 100644 --- a/src/XMonad/Local/ManageHook.hs +++ b/src/XMonad/Local/ManageHook.hs @@ -1,4 +1,6 @@ -module XMonad.Local.ManageHook (manageHook) where +module XMonad.Local.ManageHook ( + manageHook + ) where import Data.List import XMonad hiding (manageHook) @@ -8,20 +10,23 @@ import XMonad.Util.NamedScratchpad as NS import qualified XMonad.StackSet as W -- local modules ************************************************************** +import XMonad.Local.Config import XMonad.Local.NamedScratchpad import XMonad.Local.Workspaces -{- note: earlier hooks override later ones -} +{- note: earlier hooks have higher priority -} manageHook :: ManageHook -manageHook = composeOne (concat - [ --[manageHook myBaseConfig] - [checkDock -?> doIgnore] +manageHook = composeAll + [ composeOne [NS.query c -?> hook c | c <- namedScratchpads] + , composeOne (concat + [ [checkDock -?> doIgnore] + , [(className =? "google-chrome" <&&> + appName =? tabsOutlinerAppName) -?> doTOFloat] , [className =? c -?> doIgnore | c <- myCIgnores] , [className =? "Wine" -?> doFloat ] , [isFullscreen -?> doMaster <+> doFullFloat] , [transience] , [isDialog -?> doMaster <+> doCenterFloat] - , [fmap ("Preferences" `isInfixOf`) title -?> doMaster <+> doCenterFloat] , [(className =? "Gimp" <&&> c) -?> h | (c, h) <- gimpManage] , [( className =? "Qjackctl" @@ -29,7 +34,6 @@ manageHook = composeOne (concat -?> doMaster <+> doFloat] , [(className =? "Dia" <&&> role =? "toolbox_window") -?> doMaster <+> doFloat] - , [ className =? c <&&> title =? t -?> doMaster <+> doFloat | (c, t) <- myCTFloats ] , [className =? c -?> doMaster <+> doCenterFloat | c <- myCCenterFloats] @@ -39,47 +43,46 @@ manageHook = composeOne (concat , [title =? t -?> doMaster <+> doFloat | t <- myTFloats ] , [className =? "BaldursGate" -?> doMyShift "BG" <+> doMaster] , [className =? "witcher.exe" -?> doMyShift "witcher" <+> doMaster] - , [NS.query c -?> hook c | c <- namedScratchpads]]) - --, [className =? "dzen" -?> transparency 0.4]]) - <+> - composeOne (concat - [ [className =? "Dia" -?> doMyShift "dia"] - , [className =? c -?> doMyShift "chat" | c <- myChatClients ] + ]) + , composeOne (concat + [ [className =? "Dia" -?> doMyShift "dia"] + , [className =? c -?> doMyShift "chat" | c <- myChatClients ] , [(className =? "Google-chrome" <&&> title =? "Hangouts") -?> doMyShift "chat"] - , [className =? c -?> doMyShift "web" | c <- myWebBrowsers ] - , [title =? "ncmpcpp" -?> doMyShift "music" ] - , [className =? c -?> doMyShift "music" | c <- myMusicPlayers ] - , [className =? c -?> doMyShift "video" | c <- myVideoPlayers ] - , [className =? "Evince" -?> doMyShift "pdf" ] - , [className =? "Atril" -?> doMyShift "pdf" ] - , [className =? "Thunderbird" -?> doMyShift "mail"] - , [className =? "California" -?> doMyShift "calendar"] - , [className =? "Gimp" -?> doMyShift "gimp"] - , [className =? "Virt-manager" -?> doMyShift "virt"] - , [className =? "VirtualBox" -?> doMyShift "vbox"] - , [className =? "Deluge" -?> doMyShift "p2p"] - , [className =? "Calibre" -?> doMyShift "ebook"] - , [className =? "Squeak" -?> doMyShift "squeak"] - , [className =? "Civ5XP" -?> doMyShift "ciV"] + , [className =? c -?> doMyShift "web" | c <- myWebBrowsers ] + , [title =? "ncmpcpp" -?> doMyShift "music" ] + , [className =? c -?> doMyShift "music" | c <- myMusicPlayers ] + , [className =? c -?> doMyShift "video" | c <- myVideoPlayers ] + , [className =? "Evince" -?> doMyShift "pdf"] + , [className =? "Atril" -?> doMyShift "pdf"] + , [className =? "Thunderbird" -?> doMyShift "mail"] + , [className =? "California" -?> doMyShift "calendar"] + , [className =? "Gimp" -?> doMyShift "gimp"] + , [className =? "Virt-manager" -?> doMyShift "virt"] + , [className =? "VirtualBox" -?> doMyShift "vbox"] + , [className =? "Deluge" -?> doMyShift "p2p"] + , [className =? "Calibre" -?> doMyShift "ebook"] + , [className =? "Squeak" -?> doMyShift "squeak"] + , [className =? "Civ5XP" -?> doMyShift "ciV"] , [className =? "Googleearth-bin" -?> doMyShift "earth"] -- see http://xmonad.org/xmonad-docs/xmonad-contrib/src/XMonad-Hooks-XPropManage.html#xPropManageHook ]) + ] where doMaster = doF W.shiftMaster doMyShift :: WorkspaceId -> ManageHook doMyShift wsp = do liftX (newWorkspace wsp) doF $ W.greedyView wsp . W.shift wsp + doTOFloat = doRectFloat $ tabsOutlinerFloatRect myTFloats = [ "VLC (XVideo output)" - , "DownThemAll! - Make Your Selection" - , "Add Downloads" - , "Add URL(s)" - , "Run Application" - ] + , "DownThemAll! - Make Your Selection" + , "Add Downloads" + , "Add URL(s)" + , "Run Application" + ] myCIgnores = [ "Xfce4-notifyd" ] - myCFloats = [ -- "Gnome-panel" - "Close session" + myCFloats = [ "Close session" , "MPlayer" , "Wine" , "Galculator" @@ -89,8 +92,7 @@ manageHook = composeOne (concat , ("processing-app-Base", "Preferences") , ("Thunar", "File Operation Progress") ] - myCCenterFloats = [ -- "Gnome-tweak-tool" - "Xfce4-notes" + myCCenterFloats = [ "Xfce4-notes" , "Gcolor2" , "Gcr-prompter" , "Xfce4-appfinder" @@ -102,10 +104,7 @@ manageHook = composeOne (concat , "Alarm-clock-applet" ] myChatClients = ["Pidgin", "Xchat", "Skype", "Empathy", "Hexchat"] - myWebBrowsers = [ -- "Firefox" - "Chromium-browser" - , "Google-chrome" - ] + myWebBrowsers = [] myMusicPlayers = ["ncmpcpp", "Sonata", "Rhythmbox", "Gmpc"] myVideoPlayers = ["MPlayer", "Vlc", "Smplayer"] gimpManage = [ ( role =? "gimp-toolbox" <||> role =? "gimp-image-window" diff --git a/src/XMonad/Local/NamedScratchpad.hs b/src/XMonad/Local/NamedScratchpad.hs index 0fbd9f5..4af37b5 100644 --- a/src/XMonad/Local/NamedScratchpad.hs +++ b/src/XMonad/Local/NamedScratchpad.hs @@ -13,20 +13,24 @@ namedScratchpads = [ NS "htop" (terminal ++ " -t htop -e htop") (title =? "htop") cTopFloat , NS "stardict" "qstardict" (className =? "Qstardict") cFloating - , NS "notes" "gvim --role notes ~/notes.txt" (role =? "notes") - cFloating + , NS "notes" "gvim --role notes ~/notes.txt" (role =? "notes") cFloating , NS "charmap" "charmap" (className =? "Gucharmap") cFloating , NS "alarm" "alarm-clock-applet" (className =? "Alarm-clock-applet") cFloating , NS "calculator" (terminal ++ " -e python --title PCalculator") (title =? "PCalculator") cFloating , NS "volctl" "mate-volume-control" (className =? "Mate-volume-control") cFloating - , NS "guake" (terminal ++ " --window-with-profile=Guake-normal --tab-with-profile=Guake-root") + , NS "guake" (terminal ++ " --window-with-profile=Guake-normal" ++ + " --tab-with-profile=Guake-root") (className =? "Mate-terminal" <&&> (startsWith title "Guake")) cBottomFloat + , NS "tabsoutliner" ("google-chrome-stable --profile-directory=Default" ++ + " --app-id=" ++ tabsOutlinerAppID) + (className =? "google-chrome" <&&> appName =? tabsOutlinerAppName) cBigFloat ] where role = stringProperty "WM_WINDOW_ROLE" cFloating = customFloating $ W.RationalRect (1/3) (1/9) (1/3) (1/3) + cBigFloat = customFloating $ tabsOutlinerFloatRect cTopFloat = customFloating $ W.RationalRect (1/5) (1/32) (3/5) (1/2) cBottomFloat = customFloating $ W.RationalRect (1/5) (6/11) (3/5) (4/11) startsWith q x = fmap (startswith x) q |