mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-30 19:56:10 +00:00
merge master to v4 (#83)
* update ghc version to 8.10.4 for Docker build (#67) * make broader check for WSL on notifications (#68) * update readme: network topology and disclaimer on encryption design (#73) * update readme with the disclaimer on encryption design and explanation of the network topology * corrections * remove old disclaimer Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com> * create appDir if absent (#79) Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com> Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f1a44383fa
commit
94f89ed8f7
@@ -9,7 +9,7 @@ import Data.Char (toLower)
|
||||
import Data.List (isInfixOf)
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import System.Directory (doesFileExist, getAppUserDataDirectory)
|
||||
import System.Directory (createDirectoryIfMissing, doesFileExist, getAppUserDataDirectory)
|
||||
import System.FilePath (combine)
|
||||
import System.Info (os)
|
||||
import System.Process (readCreateProcess, shell)
|
||||
@@ -25,7 +25,7 @@ initializeNotifications = case os of
|
||||
False -> pure $ notify linuxScript
|
||||
True -> do
|
||||
v <- readFile "/proc/sys/kernel/osrelease"
|
||||
if "wsl" `isInfixOf` map toLower v
|
||||
if "Microsoft" `isInfixOf` v || "WSL" `isInfixOf` v
|
||||
then initWinNotify
|
||||
else pure $ notify linuxScript
|
||||
_ -> pure . const $ pure ()
|
||||
@@ -49,6 +49,7 @@ winScript path Notification {title, text} = "powershell.exe \"" <> T.pack path <
|
||||
savePowershellScript :: IO FilePath
|
||||
savePowershellScript = do
|
||||
appDir <- getAppUserDataDirectory "simplex"
|
||||
createDirectoryIfMissing False appDir
|
||||
let psScript = combine appDir "win-toast-notify.ps1"
|
||||
writeFile
|
||||
psScript
|
||||
|
||||
Reference in New Issue
Block a user