Skip to content

Commit

Permalink
Merge pull request #221 from S-NA/fix-missing-etc-deadd-css
Browse files Browse the repository at this point in the history
src/NotificationCenter.hs: read deadd.css from /etc and XDG config
  • Loading branch information
phuhl authored May 30, 2023
2 parents 361d221 + be0f5c5 commit 8c3a20a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/NotificationCenter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import System.Process (spawnCommand, interruptProcessGroupOf, waitForProcess)
import System.Locale.Current
import System.Posix.Signals (sigUSR1)
import System.Posix.Daemonize (serviced, daemonize)
import System.Directory (getXdgDirectory, XdgDirectory(..))
import System.Directory (doesFileExist, getXdgDirectory, XdgDirectory(..))

import DBus ( fromVariant )

Expand Down Expand Up @@ -135,8 +135,8 @@ deleteInCenter tState = do
setWindowStyle tState = do
state <- readTVarIO tState
homeDir <- getXdgDirectory XdgConfig ""
style <- fromEither <$> (readFile ("/etc/xdg/deadd/deadd.css"))
<*> (tryIOError $ readFile (homeDir ++ "/deadd/deadd.css"))
let paths = [ "/etc/xdg/deadd/deadd.css", homeDir ++ "/deadd/deadd.css" ]
style <- readFile =<< (filterM doesFileExist paths >>= return . head)
screen <- windowGetScreen $ stMainWindow state
setStyle screen $ BS.pack $ style
return False
Expand Down

0 comments on commit 8c3a20a

Please sign in to comment.