From 6baba38cd7d991da95dcd314d62c71a993e39a40 Mon Sep 17 00:00:00 2001 From: Leon Kowarschick Date: Sat, 16 May 2020 21:44:11 +0200 Subject: [PATCH] asdf --- files/.config/alacritty/alacritty.yml | 2 +- files/.config/picom.conf | 2 +- files/.xmonad/.stack-work/stack.sqlite3 | Bin 823296 -> 823296 bytes files/.xmonad/lib/Config.hs | 29 ++++++++++++++++++++---- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/files/.config/alacritty/alacritty.yml b/files/.config/alacritty/alacritty.yml index 316accb..132b3e6 100644 --- a/files/.config/alacritty/alacritty.yml +++ b/files/.config/alacritty/alacritty.yml @@ -310,7 +310,7 @@ font: size: 12 normal: #family: JetBrainsMono Nerd Font - #family: Iosevka + #family: Iosevka Term #family: cozette family: Terminus (TTF) #family: cherry diff --git a/files/.config/picom.conf b/files/.config/picom.conf index 0452486..ef5dc4c 100644 --- a/files/.config/picom.conf +++ b/files/.config/picom.conf @@ -99,7 +99,7 @@ blur-background-exclude = [ # Fading ---------------------------------- {{{ # Fade windows during opacity changes. -fading = true; +fading = false; # The time between steps in a fade in milliseconds. (default 10). fade-delta = 4; # Opacity change between steps while fading in. (default 0.028). diff --git a/files/.xmonad/.stack-work/stack.sqlite3 b/files/.xmonad/.stack-work/stack.sqlite3 index 7109f61c3d03da09f847428cc5f30903aeda8441..08e77ff5898911c2e9fa79609a653df82c150d1e 100644 GIT binary patch delta 76 zcmZozVAQa{Xo57O%tRSyMw!Nh)&$1Z1g6#m=B)`VRRK(lOD7vD7`F2UvH&qF5VHX> VI}mdKF((jn0WtS>-awwub^u@C6=nbc delta 76 zcmZozVAQa{Xo57O&_o$$Mxn-p)&$1Z1g6#m=B)`VRRN3)(;phJ8@2NWvH&qF5VHX> VI}mdKF((jn0WtS>-awwub^u`o6?Xst diff --git a/files/.xmonad/lib/Config.hs b/files/.xmonad/lib/Config.hs index 2484307..d5c56d5 100644 --- a/files/.xmonad/lib/Config.hs +++ b/files/.xmonad/lib/Config.hs @@ -9,6 +9,7 @@ import Control.Concurrent import Control.Exception ( catch , SomeException ) +import Control.Monad ( filterM ) import Data.Char (isDigit) import Data.List ( isSuffixOf , isPrefixOf @@ -63,6 +64,7 @@ import XMonad.Util.SpawnOnce (spawnOnce) import XMonad.Layout.Tabbed import qualified XMonad.Actions.Navigation2D as Nav2d import XMonad.Actions.PhysicalScreens ( horizontalScreenOrderer ) +import XMonad.Actions.SpawnOn import qualified XMonad.Hooks.EwmhDesktops as Ewmh import qualified XMonad.Hooks.ManageHelpers as ManageHelpers import qualified XMonad.Layout.BoringWindows as BoringWindows @@ -197,8 +199,8 @@ myStartupHook = do spawn "/home/leon/.screenlayout/dualscreen.sh " io $ threadDelay $ 1000 * 100 spawnOnce "picom --config ~/.config/picom.conf" --no-fading-openclose" - spawn"/home/leon/.config/polybar/launch.sh" - spawn "nitrogen --restore" + spawn "/home/leon/.config/polybar/launch.sh" + spawnOnce "nitrogen --restore" -- }}} @@ -206,7 +208,7 @@ myStartupHook = do -- Default mappings that need to be removed removedKeys :: [String] -removedKeys = ["M-", "M-S-c", "M-S-q", "M-h", "M-l", "M-j", "M-k"] +removedKeys = ["M-", "M-S-c", "M-S-q", "M-h", "M-l", "M-j", "M-k", "M-S-"] ++ if useSharedWorkspaces then [key ++ show n | key <- ["M-", "M-S-", "M-C-"], n <- [1..9 :: Int]] else [] multiMonitorOperation :: (WorkspaceId -> WindowSet -> WindowSet) -> ScreenId -> X () @@ -247,6 +249,8 @@ myKeys = , ("M-f", toggleFullscreen) + , ("M-b", launchWithBackgroundInstance (className =? "qutebrowser") "bwrap --bind / / --dev-bind /dev /dev --tmpfs /tmp --tmpfs /run qutebrowser") + , ("M-S-", launchWithBackgroundInstance (className =? "Alacritty") "alacritty") , ("M-S-C-c", kill1) , ("M-S-C-q", io exitSuccess) @@ -267,7 +271,6 @@ myKeys = -- programs , ("M-p", spawn myLauncher) - , ("M-b", spawn myBrowser) , ("M-S-p", Rofi.showCombi (def { Rofi.theme = Rofi.bigTheme }) [ "drun", "window", "ssh" ]) , ("M-S-e", Rofi.showNormal (def { Rofi.theme = Rofi.bigTheme }) "emoji" ) --, ("M-s", spawn $ scriptFile "rofi-search.sh") @@ -323,6 +326,22 @@ myKeys = sendMessage $ MTog.Toggle MTog.FULL sendMessage ToggleStruts + -- | launch a program by starting an instance in a hidden workspace, + -- and just raising an already running instance. This allows for super quick "startup" time. + -- For this to work, the window needs to have the `_NET_WM_PID` set and unique! + launchWithBackgroundInstance :: (Query Bool) -> String -> X () + launchWithBackgroundInstance windowQuery commandToRun = withWindowSet $ \winSet -> do + quteWins <- (W.allWindows winSet) |> filter (\win -> Just True == fmap ("NSP" ==) (W.findTag win winSet)) + |> filterM (runQuery windowQuery) + case quteWins of + [] -> do spawnHere commandToRun + spawnOn "NSP" commandToRun + [winId] -> do windows $ W.shiftWin (W.currentTag winSet) winId + spawnOn "NSP" commandToRun + (winId:_) -> windows $ W.shiftWin (W.currentTag winSet) winId + + + scratchpadSubmap :: X () scratchpadSubmap = describedSubmap "Scratchpads" @@ -403,7 +422,7 @@ main = do , layoutHook = myLayout , logHook = polybarLogHooks <+> logHook def , startupHook = myStartupHook <+> startupHook def <+> return () >> checkKeymap myConfig myKeys - , manageHook = myManageHook <+> manageHook def + , manageHook = manageSpawn <+> myManageHook <+> manageHook def , focusedBorderColor = aqua , normalBorderColor = "#282828" --, handleEventHook = minimizeEventHook <+> handleEventHook def <+> hintsEventHook -- <+> Ewmh.fullscreenEventHook