Compare commits

..

No commits in common. "54651e2fe9b5225bf8586cd9530b3869aa27caf6" and "d352e4d49b46a02d94b27f7ae815ec9cd0cce23c" have entirely different histories.

4 changed files with 9 additions and 16 deletions

View File

@ -732,16 +732,9 @@ runMountSudoMaybe' useSudo cmd args environ =
-- runSudoMount rootpass cmd args stdin = runSudoMount' rootpass cmd args stdin []
runSudoMount' :: MonadIO m => T.Text -> T.Text -> [T.Text] -> [(T.Text, T.Text)] -> m MountResult
runSudoMount' rootpass cmd args environ = do
-- This needs Default timestamp_type=global in sudoers to have any effect
-- since these are all separate shells
isCached <- isJust <$> readCmdSuccess "sudo" ["-n", "true"] ""
if isCached then run else do
cacheSuccess <- isJust <$> readCmdSuccess "sudo" ["-S", "true"] rootpass
if cacheSuccess then run else return $ MountError "Could not cache password"
runSudoMount' rootpass cmd args environ = runMount "sudo" args' rootpass
where
run = runMount "sudo" args' ""
args' = ["-n"] ++ environ' ++ [cmd] ++ args
args' = ["-S"] ++ environ' ++ [cmd] ++ args
environ' = fmap (\(k, v) -> T.concat [k, "=", v]) environ
eitherToMountResult :: Either (Int, T.Text, T.Text) T.Text -> MountResult

View File

@ -47,7 +47,7 @@ let CIFSData =
, default =
{ cifsSudo = False
, cifsPassword = None PasswordConfig
, cifsOpts = Some CIFSOpts::{=}
, cifsOpts = CIFSOpts::{=}
}
}

View File

@ -69,8 +69,8 @@ hotkeyMsg hs = ["-mesg", T.intercalate " | " $ fmap hotkeyMsg1 hs]
hotkeyArgs :: [Hotkey c] -> [T.Text]
hotkeyArgs hks =
hotkeyMsg hks
++ concatMap (uncurry hotkeyBinding) (take 19 $ zip [1 ..] hks)
(hotkeyMsg hks)
++ (concatMap (uncurry hotkeyBinding) $ take 19 $ zip [1 ..] hks)
data RofiMenu c = RofiMenu
{ groups :: ![RofiGroup c]
@ -129,7 +129,7 @@ selectAction rm = do
-- keybindings are labeled 1-19 and thus need to be explicitly
-- indexed, and the program itself tells the world which key was
-- pressed via return code (any possible integer)
(V.fromList (hotkeys rm) V.!? (n - 10))
((V.fromList $ hotkeys rm) V.!? (n - 10))
runRofi :: (MonadIO m, HasRofiConf c) => c -> RofiMenu c -> m ()
runRofi c = runRIO c . selectAction
@ -171,7 +171,7 @@ readCmdEither'
-> m (Either (Int, T.Text, T.Text) T.Text)
readCmdEither' cmd args input environ =
resultToEither
<$> liftIO (readCreateProcessWithExitCode p (T.unpack input))
<$> (liftIO $ readCreateProcessWithExitCode p (T.unpack input))
where
e = case environ of
[] -> Nothing

View File

@ -16,8 +16,8 @@ notify icon summary body =
liftIO $
void $
spawnProcess "notify-send" $
maybe args ((\b -> args ++ [b]) . T.unpack)
body
maybe args (\b -> args ++ [b]) $
fmap T.unpack body
where
args = ["-i", show icon, T.unpack summary]