summaryrefslogtreecommitdiffstats
path: root/src/Flameshot/Internal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Flameshot/Internal.hs')
-rw-r--r--src/Flameshot/Internal.hs18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/Flameshot/Internal.hs b/src/Flameshot/Internal.hs
index 56a35b4..b01b145 100644
--- a/src/Flameshot/Internal.hs
+++ b/src/Flameshot/Internal.hs
@@ -10,19 +10,17 @@ import Control.Concurrent.Async (race)
import Control.Concurrent.Extended
import Control.Exception
import Data.ByteString (ByteString)
-import qualified Data.ByteString as BS
import qualified Data.Char as C
import Data.Function (on)
import Data.Maybe (fromMaybe)
-import Data.Time.Clock
import Data.Time.Clock.System
-import Data.Time.Format
import Data.Time.ISO8601
import DBus
import DBus.Internal.Message
import DBus.Socket
import Data.Text (Text)
import qualified Data.Text.Extended as T
+import qualified Flameshot.Internal.Process as P
blessBusName :: BusName -> Blessings Text
@@ -110,14 +108,6 @@ showUnprintable =
. T.groupBy ((==) `on` p)
-saveImage :: FilePath -> ByteString -> IO ()
-saveImage cGuiPath rawImage = do
- t <- formatISO8601Seconds . systemToUTCTime <$> getSystemTime
- let path = cGuiPath <> "/" <> baseName
- baseName = t <> "_flameshot.png"
- BS.writeFile path rawImage
-
-
-formatISO8601Seconds :: UTCTime -> String
-formatISO8601Seconds =
- formatTime defaultTimeLocale (iso8601DateFormat $ Just "%H:%M:%SZ")
+copyToClipboard :: String -> ByteString -> IO ()
+copyToClipboard mimetype =
+ P.writeDaemon "xclip" ["-selection", "clipboard", "-t", mimetype, "-i"]