From cd9e250a0122f84c60f9cc49bab81801d71284ec Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 Jul 2017 23:03:06 -0400 Subject: Added Propellor.Property.FreeDesktop module. This commit was sponsored by Trenton Cronholm on Patreon. --- src/Propellor/Property/FreeDesktop.hs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/Propellor/Property/FreeDesktop.hs (limited to 'src/Propellor/Property/FreeDesktop.hs') diff --git a/src/Propellor/Property/FreeDesktop.hs b/src/Propellor/Property/FreeDesktop.hs new file mode 100644 index 00000000..75dcbdfa --- /dev/null +++ b/src/Propellor/Property/FreeDesktop.hs @@ -0,0 +1,29 @@ +-- | Freedesktop.org configuration file properties. + +module Propellor.Property.FreeDesktop where + +import Propellor.Base +import Propellor.Property.ConfFile + +desktopFile :: String -> FilePath +desktopFile s = s ++ ".desktop" + +-- | Name used in a desktop file; user visible. +type Name = String + +-- | Command that a dekstop file runs. May include parameters. +type Exec = String + +-- | Specifies an autostart file. By default it will be located in the +-- system-wide autostart directory. +autostart :: FilePath -> Name -> Exec -> RevertableProperty UnixLike UnixLike +autostart f n e = ("/etc/xdg/autostart" f) `iniFileContains` + [ ("Desktop Entry", + [ ("Type", "Application") + , ("Version", "1.0") + , ("Name", n) + , ("Comment", "Autostart") + , ("Terminal", "False") + , ("Exec", e) + ] ) + ] -- cgit v1.3-2-g0d8e