REF move removable module to dbus section

This commit is contained in:
Nathan Dwarshuis 2021-11-27 00:08:24 -05:00
parent 8282cf05cc
commit 7010d4a723
3 changed files with 9 additions and 8 deletions

View File

@ -50,12 +50,12 @@ import XMonad.Internal.Command.Power
import XMonad.Internal.Concurrent.ACPIEvent import XMonad.Internal.Concurrent.ACPIEvent
import XMonad.Internal.Concurrent.ClientMessage import XMonad.Internal.Concurrent.ClientMessage
import XMonad.Internal.Concurrent.DynamicWorkspaces import XMonad.Internal.Concurrent.DynamicWorkspaces
import XMonad.Internal.Concurrent.Removable
import XMonad.Internal.DBus.Brightness.ClevoKeyboard import XMonad.Internal.DBus.Brightness.ClevoKeyboard
import XMonad.Internal.DBus.Brightness.Common import XMonad.Internal.DBus.Brightness.Common
import XMonad.Internal.DBus.Brightness.IntelBacklight import XMonad.Internal.DBus.Brightness.IntelBacklight
import XMonad.Internal.DBus.Control import XMonad.Internal.DBus.Control
import XMonad.Internal.DBus.Screensaver import XMonad.Internal.DBus.Screensaver
import XMonad.Internal.DBus.Removable
import XMonad.Internal.Dependency import XMonad.Internal.Dependency
import XMonad.Internal.Process import XMonad.Internal.Process
import XMonad.Internal.Shell import XMonad.Internal.Shell
@ -79,7 +79,8 @@ main = do
sesClient <- startXMonadService sesClient <- startXMonadService
sysClient <- getDBusClient True sysClient <- getDBusClient True
(h, p) <- spawnPipe "xmobar" (h, p) <- spawnPipe "xmobar"
mapM_ (executeFeatureWith_ forkIO_) [runPowermon, runRemovableMon sysClient] executeFeature_ $ runRemovableMon sysClient
executeFeatureWith_ forkIO_ runPowermon
forkIO_ $ runWorkspaceMon allDWs forkIO_ $ runWorkspaceMon allDWs
let ts = ThreadState let ts = ThreadState
{ tsSessionClient = sesClient { tsSessionClient = sesClient

View File

@ -4,7 +4,7 @@
-- Currently, its only purpose is to play Super Mario sounds when a drive is -- Currently, its only purpose is to play Super Mario sounds when a drive is
-- inserted or removed. Why? Because I can. -- inserted or removed. Why? Because I can.
module XMonad.Internal.Concurrent.Removable (runRemovableMon) where module XMonad.Internal.DBus.Removable (runRemovableMon) where
import Control.Monad import Control.Monad
@ -74,10 +74,10 @@ playSoundMaybe p b = when b $ playSound p
-- enable the udisks2 service at boot; however this is not default behavior. -- enable the udisks2 service at boot; however this is not default behavior.
listenDevices :: Client -> IO () listenDevices :: Client -> IO ()
listenDevices client = do listenDevices client = do
void $ addMatch' memAdded driveInsertedSound addedHasDrive addMatch' memAdded driveInsertedSound addedHasDrive
void $ addMatch' memRemoved driveRemovedSound removedHasDrive addMatch' memRemoved driveRemovedSound removedHasDrive
where where
addMatch' m p f = addMatch client ruleUdisks { matchMember = Just m } addMatch' m p f = void $ addMatch client ruleUdisks { matchMember = Just m }
$ playSoundMaybe p . f . signalBody $ playSoundMaybe p . f . signalBody
runRemovableMon :: Maybe Client -> FeatureIO runRemovableMon :: Maybe Client -> FeatureIO

View File

@ -8,7 +8,6 @@ library
exposed-modules: XMonad.Internal.Concurrent.ClientMessage exposed-modules: XMonad.Internal.Concurrent.ClientMessage
, XMonad.Internal.Concurrent.ACPIEvent , XMonad.Internal.Concurrent.ACPIEvent
, XMonad.Internal.Concurrent.DynamicWorkspaces , XMonad.Internal.Concurrent.DynamicWorkspaces
, XMonad.Internal.Concurrent.Removable
, XMonad.Internal.Theme , XMonad.Internal.Theme
, XMonad.Internal.Notify , XMonad.Internal.Notify
, XMonad.Internal.Shell , XMonad.Internal.Shell
@ -23,6 +22,7 @@ library
, XMonad.Internal.DBus.Brightness.Common , XMonad.Internal.DBus.Brightness.Common
, XMonad.Internal.DBus.Control , XMonad.Internal.DBus.Control
, XMonad.Internal.DBus.Screensaver , XMonad.Internal.DBus.Screensaver
, XMonad.Internal.DBus.Removable
, XMonad.Internal.Process , XMonad.Internal.Process
, Xmobar.Plugins.Common , Xmobar.Plugins.Common
, Xmobar.Plugins.BacklightCommon , Xmobar.Plugins.BacklightCommon
@ -78,4 +78,4 @@ executable xmobar
, xmonad-contrib >= 0.13 , xmonad-contrib >= 0.13
, directory >= 1.3.3.0 , directory >= 1.3.3.0
default-language: Haskell2010 default-language: Haskell2010
ghc-options: -Wall -Werror -fno-warn-missing-signatures -threaded ghc-options: -Wall -Werror -fno-warn-missing-signatures -threaded