diff --git a/bin/xmonad.hs b/bin/xmonad.hs index 710312d..fc19049 100644 --- a/bin/xmonad.hs +++ b/bin/xmonad.hs @@ -798,14 +798,14 @@ externalBindings :: (XIO () -> IO ()) -> X () -> DBusState -> [KeyGroup FeatureX externalBindings runIO cleanup db = [ KeyGroup "Launchers" - [ KeyBinding "" "select/launch app" $ Left runAppMenu - , KeyBinding "M-g" "launch clipboard manager" $ Left runClipMenu - , KeyBinding "M-a" "launch network selector" $ Left $ runNetMenu sys - , KeyBinding "M-w" "launch window selector" $ Left runWinMenu - , KeyBinding "M-u" "launch device selector" $ Left runDevMenu - , KeyBinding "M-b" "launch bitwarden selector" $ Left $ runBwMenu ses - , KeyBinding "M-v" "launch ExpressVPN selector" $ Left runVPNMenu - , KeyBinding "M-e" "launch bluetooth selector" $ Left runBTMenu + [ KeyBinding "" "select/launch app" $ Left $ toX runAppMenu + , KeyBinding "M-g" "launch clipboard manager" $ Left $ toX runClipMenu + , KeyBinding "M-a" "launch network selector" $ Left $ toX $ runNetMenu sys + , KeyBinding "M-w" "launch window selector" $ Left $ toX runWinMenu + , KeyBinding "M-u" "launch device selector" $ Left $ toX runDevMenu + , KeyBinding "M-b" "launch bitwarden selector" $ Left $ toX $ runBwMenu ses + , KeyBinding "M-v" "launch ExpressVPN selector" $ Left $ toX runVPNMenu + , KeyBinding "M-e" "launch bluetooth selector" $ Left $ toX runBTMenu , KeyBinding "M-C-e" "launch editor" $ Left $ toX runEditor , KeyBinding "M-C-w" "launch browser" $ Left $ toX runBrowser , KeyBinding "M-C-t" "launch terminal with tmux" $ Left $ toX runTMux @@ -816,7 +816,7 @@ externalBindings runIO cleanup db = , KeyGroup "Actions" [ KeyBinding "M-q" "close window" $ ftrAlways "kill window function" kill1 - , KeyBinding "M-r" "run program" $ Left runCmdMenu + , KeyBinding "M-r" "run program" $ Left $ toX runCmdMenu , KeyBinding "M-" "warp pointer" $ ftrAlways "warp function" $ warpToWindow 0.5 0.5 , KeyBinding "M-C-s" "capture area" $ Left $ toX $ runAreaCapture ses , KeyBinding "M-C-S-s" "capture screen" $ Left $ toX $ runScreenCapture ses @@ -857,7 +857,7 @@ externalBindings runIO cleanup db = , -- M- reserved for showing the keymap KeyBinding "M-" "restart xmonad" restartf , KeyBinding "M-" "recompile xmonad" recompilef - , KeyBinding "M-" "select autorandr profile" $ Left runAutorandrMenu + , KeyBinding "M-" "select autorandr profile" $ Left $ toX runAutorandrMenu , KeyBinding "M-" "toggle ethernet" $ Left $ toX runToggleEthernet , KeyBinding "M-" "toggle bluetooth" $ Left $ toX $ runToggleBluetooth sys , KeyBinding "M-" "toggle screensaver" $ Left $ toX $ callToggle ses diff --git a/lib/XMonad/Internal/Command/DMenu.hs b/lib/XMonad/Internal/Command/DMenu.hs index 2614feb..7a6c605 100644 --- a/lib/XMonad/Internal/Command/DMenu.hs +++ b/lib/XMonad/Internal/Command/DMenu.hs @@ -22,6 +22,7 @@ import DBus import Data.Internal.DBus import Data.Internal.XIO import Graphics.X11.Types +import RIO hiding (hClose) import RIO.Directory ( XdgDirectory (..) , getXdgDirectory @@ -74,7 +75,7 @@ clipboardPkgs = [Package AUR "rofi-greenclip"] -------------------------------------------------------------------------------- -- Other internal functions -spawnDmenuCmd :: T.Text -> [T.Text] -> SometimesX +spawnDmenuCmd :: MonadUnliftIO m => T.Text -> [T.Text] -> Sometimes (m ()) spawnDmenuCmd n = sometimesExeArgs n "rofi preset" dmenuPkgs True myDmenuCmd @@ -97,7 +98,7 @@ dmenuDep = sysExe dmenuPkgs myDmenuCmd -- Exported Commands -- TODO test that veracrypt and friends are installed -runDevMenu :: SometimesX +runDevMenu :: MonadUnliftIO m => Sometimes (m ()) runDevMenu = sometimesIO_ "device manager" "rofi devices" t x where t = dmenuTree $ Only_ (localExe [] myDmenuDevices) @@ -110,7 +111,7 @@ runDevMenu = sometimesIO_ "device manager" "rofi devices" t x ++ myDmenuMatchingArgs -- TODO test that bluetooth interface exists -runBTMenu :: SometimesX +runBTMenu :: MonadUnliftIO m => Sometimes (m ()) runBTMenu = Sometimes "bluetooth selector" @@ -120,7 +121,7 @@ runBTMenu = cmd = spawnCmd myDmenuBluetooth $ "-c" : themeArgs "#0044bb" tree = dmenuTree $ Only_ $ sysExe [] myDmenuBluetooth -runVPNMenu :: SometimesX +runVPNMenu :: MonadUnliftIO m => Sometimes (m ()) runVPNMenu = Sometimes "VPN selector" @@ -136,16 +137,16 @@ runVPNMenu = socketExists "expressVPN" [] $ return "/var/lib/expressvpn/expressvpnd.socket" -runCmdMenu :: SometimesX +runCmdMenu :: MonadUnliftIO m => Sometimes (m ()) runCmdMenu = spawnDmenuCmd "command menu" ["-show", "run"] -runAppMenu :: SometimesX +runAppMenu :: MonadUnliftIO m => Sometimes (m ()) runAppMenu = spawnDmenuCmd "app launcher" ["-show", "drun"] -runWinMenu :: SometimesX +runWinMenu :: MonadUnliftIO m => Sometimes (m ()) runWinMenu = spawnDmenuCmd "window switcher" ["-show", "window"] -runNetMenu :: Maybe SysClient -> SometimesX +runNetMenu :: MonadUnliftIO m => Maybe SysClient -> Sometimes (m ()) runNetMenu cl = Sometimes "network control menu" @@ -161,7 +162,7 @@ runNetMenu cl = DBusIO $ sysExe [Package AUR "networkmanager-dmenu-git"] myDmenuNetworks -runAutorandrMenu :: SometimesX +runAutorandrMenu :: MonadUnliftIO m => Sometimes (m ()) runAutorandrMenu = sometimesIO_ "autorandr menu" "rofi autorandr" tree cmd where cmd = spawnCmd myDmenuMonitors $ themeArgs "#ff0066" @@ -170,7 +171,7 @@ runAutorandrMenu = sometimesIO_ "autorandr menu" "rofi autorandr" tree cmd -------------------------------------------------------------------------------- -- Password manager -runBwMenu :: Maybe SesClient -> SometimesX +runBwMenu :: MonadUnliftIO m => Maybe SesClient -> Sometimes (m ()) runBwMenu cl = sometimesDBus cl "password manager" "rofi bitwarden" tree cmd where cmd _ = @@ -183,7 +184,7 @@ runBwMenu cl = sometimesDBus cl "password manager" "rofi bitwarden" tree cmd -------------------------------------------------------------------------------- -- Clipboard -runClipMenu :: SometimesX +runClipMenu :: MonadUnliftIO m => Sometimes (m ()) runClipMenu = sometimesIO_ "clipboard manager" "rofi greenclip" tree act where act = spawnCmd myDmenuCmd args