From f09ec7b7dbddd165ed9e62a64a2c017099457c84 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 14 Apr 2017 19:37:30 -0700 Subject: [PATCH 1/3] [XMonad] Add goFullscreenDWIM --- dotfiles/xmonad/xmonad.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index e582ed1e..ae2c7054 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -522,6 +522,13 @@ actOnWindowsInWorkspace :: (Window -> X ()) actOnWindowsInWorkspace windowAction getWindowsAction = restoreFocus $ withWorkspace (getWindowsAction >=> mapM_ windowAction) +goFullscreenDWIM = + withWorkspace $ \ws -> do + wins <- windowsWithFocusedClass ws + if length wins > 1 + then goFullscreen + else minimizeOtherClassesInWorkspace + windowsWithUnfocusedClass ws = windowsWithOtherClasses (W.focus ws) ws windowsWithFocusedClass ws = windowsWithSameClass (W.focus ws) ws windowsWithOtherClasses = windowsMatchingClassPredicate (/=) @@ -738,7 +745,7 @@ addKeys conf@XConfig { modMask = modm } = , ((modm, xK_g), myGoToWindow) , ((modm, xK_b), myBringWindow) , ((modm .|. shiftMask, xK_b), myReplaceWindow) - , ((modm .|. controlMask, xK_space), goFullscreen) + , ((modm .|. controlMask, xK_space), deactivateFullOr goFullscreenDWIM) , ((modm, xK_m), withFocused minimizeWindow) , ((modm .|. shiftMask, xK_m), deactivateFullOr $ withLastMinimized maximizeWindowAndFocus) From 57bb1bf7f3465c5580f0d6fdfdda70b3addf1a9b Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 14 Apr 2017 21:07:39 -0700 Subject: [PATCH 2/3] Ignore a bunch of files in config --- dotfiles/config/.gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dotfiles/config/.gitignore b/dotfiles/config/.gitignore index 5c32ae1d..fea400b1 100644 --- a/dotfiles/config/.gitignore +++ b/dotfiles/config/.gitignore @@ -1,3 +1,6 @@ +/.mono/keypairs/ +/Atom/ +/Code/ /Popcorn-Time/ /QtProject.conf/ /Trolltech.conf @@ -16,6 +19,7 @@ /gtk-3.0/bookmarks /hexchat /hub +/libreoffice/ /linuxmint/ /menus/ /menus/applications-merged/ @@ -31,6 +35,7 @@ /sparkleshare/avatars/ /sparkleshare/logs /spotify +/sublime-text-3/ /systemd/user/*.target.wants/ /totem/ /transmission/dht.dat @@ -42,4 +47,3 @@ /user-dirs.locale /vlc/ /xfce4/ -/.mono/keypairs/ From 50e21f7fadb046f5626ce2783df0f6f1663bde94 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 14 Apr 2017 21:08:11 -0700 Subject: [PATCH 3/3] [XMonad] Go back to normal fullscreen (instead of DWIM) --- dotfiles/xmonad/xmonad.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index ae2c7054..c6b5906e 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -522,6 +522,9 @@ actOnWindowsInWorkspace :: (Window -> X ()) actOnWindowsInWorkspace windowAction getWindowsAction = restoreFocus $ withWorkspace (getWindowsAction >=> mapM_ windowAction) +-- XXX: The idea behind this was that the normal fullscreen can be annoying if a +-- new window opens, but this behavior is even more annoying than that, so +-- nevermind goFullscreenDWIM = withWorkspace $ \ws -> do wins <- windowsWithFocusedClass ws @@ -745,7 +748,7 @@ addKeys conf@XConfig { modMask = modm } = , ((modm, xK_g), myGoToWindow) , ((modm, xK_b), myBringWindow) , ((modm .|. shiftMask, xK_b), myReplaceWindow) - , ((modm .|. controlMask, xK_space), deactivateFullOr goFullscreenDWIM) + , ((modm .|. controlMask, xK_space), deactivateFullOr goFullscreen) , ((modm, xK_m), withFocused minimizeWindow) , ((modm .|. shiftMask, xK_m), deactivateFullOr $ withLastMinimized maximizeWindowAndFocus)