mirror of
https://github.com/srid/nixos-config.git
synced 2026-01-09 09:50:14 +08:00
refactor
This commit is contained in:
parent
824efdad96
commit
d19e4dceaf
1 changed files with 8 additions and 8 deletions
|
|
@ -93,17 +93,17 @@ enableDebugLogging = do
|
|||
getLogger "System.Taffybar.Widget.Battery"
|
||||
]
|
||||
|
||||
-- More reliable than taffybar's version:
|
||||
-- https://github.com/taffybar/taffybar/issues/403#issuecomment-870403234
|
||||
|
||||
handleException :: WindowIconPixbufGetter -> WindowIconPixbufGetter
|
||||
handleException getter = \size windowData ->
|
||||
ReaderT $ \c ->
|
||||
catch (runReaderT (getter size windowData) c) $ \(_ :: SomeException) ->
|
||||
return Nothing
|
||||
|
||||
myGetWindowIconPixbuf :: WindowIconPixbufGetter
|
||||
myGetWindowIconPixbuf =
|
||||
scaledWindowIconPixbufGetter $
|
||||
handleException getWindowIconPixbufFromDesktopEntry
|
||||
<|||> handleException getWindowIconPixbufFromClass
|
||||
<|||> handleException getWindowIconPixbufFromEWMH
|
||||
<|||> handleException getWindowIconPixbufFromEWMH
|
||||
where
|
||||
handleException :: WindowIconPixbufGetter -> WindowIconPixbufGetter
|
||||
handleException getter = \size windowData ->
|
||||
ReaderT $ \c ->
|
||||
catch (runReaderT (getter size windowData) c) $ \(_ :: SomeException) ->
|
||||
return Nothing
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue