feat(autostart): use some async processes
This commit is contained in:
parent
8f33221d1d
commit
d7186976a8
@ -7,11 +7,22 @@
|
|||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(local awful (require :awful))
|
(local awful (require :awful))
|
||||||
|
(local beautiful (require :beautiful))
|
||||||
|
(local naughty (require :naughty))
|
||||||
|
|
||||||
(local spawn awful.spawn.with_shell)
|
(local spawn awful.spawn.with_shell)
|
||||||
|
(local async awful.spawn.easy_async_with_shell)
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;; Functions
|
;; Functions
|
||||||
|
|
||||||
|
(fn cb [prog]
|
||||||
|
(lambda [stdout stderr exitreason exitcode]
|
||||||
|
(when (not (= 0 exitcode))
|
||||||
|
(naughty.notify
|
||||||
|
{:title (.. "async startup handler: " prog)
|
||||||
|
:text stderr}))))
|
||||||
|
|
||||||
(fn run-once [cmds]
|
(fn run-once [cmds]
|
||||||
(each [_ cmd (ipairs cmds)]
|
(each [_ cmd (ipairs cmds)]
|
||||||
(let [first-space (: cmd :find " ")
|
(let [first-space (: cmd :find " ")
|
||||||
@ -19,13 +30,15 @@
|
|||||||
(: cmd :sub 0 (- first-space 1))
|
(: cmd :sub 0 (- first-space 1))
|
||||||
cmd)]
|
cmd)]
|
||||||
(spawn
|
(spawn
|
||||||
(string.format "pgrep -u $USER -x %s >/dev/null || (%s)" findme cmd))) ))
|
(string.format "pgrep -u $USER -x %s >/dev/null || (%s)" findme cmd)))))
|
||||||
|
|
||||||
;; Keyboard
|
;; Keyboard
|
||||||
(spawn "tpset 'Natural Scrolling' 1")
|
(async "tpset \"Natural Scrolling\" 1" (cb "tpset"))
|
||||||
(spawn "tpset 'Tapping' 1")
|
(async "tpset \"Tapping\" 1" (cb "tpset"))
|
||||||
(spawn "setxkbmap -option caps:ctrl_modifier")
|
(spawn "setxkbmap -option caps:ctrl_modifier")
|
||||||
|
|
||||||
|
(async (.. "feh --bg-fill " beautiful.wallpaper) (cb "feh"))
|
||||||
|
|
||||||
(run-once
|
(run-once
|
||||||
["nm-applet" ;; WiFi
|
["nm-applet" ;; WiFi
|
||||||
"pa-applet" ;; Sound manager
|
"pa-applet" ;; Sound manager
|
||||||
|
Loading…
Reference in New Issue
Block a user