aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Lib.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2021-11-29 13:11:54 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:45 -0600
commit8486ce27943b1c0460bfcd6d93ed84d2b3c5afb5 (patch)
tree52f5343a37e06d5b4d1914a7a5d00807e3f16497 /src/Internal/Lib.hs
parentbc8f075ebc6ebb987a6c6a20e8a30df241197073 (diff)
downloadrde-8486ce27943b1c0460bfcd6d93ed84d2b3c5afb5.tar.gz
rde-8486ce27943b1c0460bfcd6d93ed84d2b3c5afb5.tar.bz2
rde-8486ce27943b1c0460bfcd6d93ed84d2b3c5afb5.zip
Add some changes.
1. Make the spotify control work for both Spotify and Spotifyd 2. Xmobar weather not break xmobar when not connected to the internet 3. Add g<space> keybinding to go to the toogle-cased version of the current workspace.
Diffstat (limited to 'src/Internal/Lib.hs')
-rw-r--r--src/Internal/Lib.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Internal/Lib.hs b/src/Internal/Lib.hs
index c3bdeb9..3beb640 100644
--- a/src/Internal/Lib.hs
+++ b/src/Internal/Lib.hs
@@ -64,6 +64,17 @@ getHorizontallyOrderedScreens windowSet =
where
screens = current windowSet : visible windowSet
+getCurrentWorkspace :: X WorkspaceName
+getCurrentWorkspace = withWindowSet $
+ \(StackSet (Screen (Workspace t _ _) _ _) _ _ _) -> do
+ return (head t)
+
+gotoAccompaningWorkspace :: X ()
+gotoAccompaningWorkspace = do
+ cur <- getCurrentWorkspace
+ if isUpper cur
+ then gotoWorkspace (toLower cur)
+ else gotoWorkspace (toUpper cur)
gotoWorkspace :: WorkspaceName -> X ()
gotoWorkspace ch = do