ENH make getItems not depend on the reader config
This commit is contained in:
parent
dbf48ad771
commit
930685f095
|
@ -171,9 +171,10 @@ runClient a = do
|
||||||
browseLogins :: RofiConf c => RofiIO c ()
|
browseLogins :: RofiConf c => RofiIO c ()
|
||||||
browseLogins = do
|
browseLogins = do
|
||||||
session <- io callGetSession
|
session <- io callGetSession
|
||||||
forM_ session $ getItems >=> selectItem
|
forM_ session $ (io . getItems) >=> selectItem
|
||||||
|
|
||||||
getItems :: RofiConf c => String -> RofiIO c [Item]
|
-- TODO use this in rofi-dev to mount thing using BW passwords
|
||||||
|
getItems :: String -> IO [Item]
|
||||||
getItems session = do
|
getItems session = do
|
||||||
items <- io $ readProcess "bw" ["list", "items", "--session", session] ""
|
items <- io $ readProcess "bw" ["list", "items", "--session", session] ""
|
||||||
return $ filter notEmpty $ fromMaybe [] $ decode $ fromString items
|
return $ filter notEmpty $ fromMaybe [] $ decode $ fromString items
|
||||||
|
|
Loading…
Reference in New Issue