diff --git a/lib/Data/Internal/XIO.hs b/lib/Data/Internal/XIO.hs index b516e6a..d35d0af 100644 --- a/lib/Data/Internal/XIO.hs +++ b/lib/Data/Internal/XIO.hs @@ -140,7 +140,7 @@ runXIO logfile x = withLogFile logfile $ \h -> hRunXIO True h x withLogFile :: MonadUnliftIO m => FilePath -> (Handle -> m a) -> m a withLogFile logfile f = do p <- ( logfile) . dataDir <$> liftIO getDirectories - catchIO (withFile p AppendMode f) $ \e -> do + catchIO (withBinaryFile p AppendMode f) $ \e -> do liftIO $ print e liftIO $ putStrLn "could not open log file, falling back to stderr" f stderr diff --git a/lib/Xmobar/Plugins/Bluetooth.hs b/lib/Xmobar/Plugins/Bluetooth.hs index 3b396e0..2734bcb 100644 --- a/lib/Xmobar/Plugins/Bluetooth.hs +++ b/lib/Xmobar/Plugins/Bluetooth.hs @@ -91,6 +91,8 @@ startAdapter is cs cb cl = do forM_ devices $ \d -> addAndInitDevice d -- after setting things up, show the icon based on the initialized state dpy + -- keep file descriptors open in callback threads + forever $ threadDelay 1000000 -------------------------------------------------------------------------------- -- Icon Display