feat(autostart): implement in awesome itself

This commit is contained in:
xeals 2019-01-15 17:21:27 +11:00
parent d377a56780
commit e6fd7b5613
2 changed files with 40 additions and 3 deletions

View File

@ -9,6 +9,7 @@
(require :module.decorate)
(require :module.sidebar)
(require :module.autostart)
(require :conf.client)
(require :conf.tags)
@ -36,7 +37,4 @@
:unfocus (lambda [c] (set c.border_color beautiful.border_normal))}
(fun.each (fn [event callback] (client.connect_signal event callback))))
;; (awful.spawn.with_shell "~/.config/awesome/autostart")
;; Empty return
{}

39
module/autostart.fnl Normal file
View File

@ -0,0 +1,39 @@
;;; module/auto-start.fnl --- Auto-start utilities
;;; Commentary:
;; Largely copied from
;; https://github.com/PapyElGringo/material-awesome/blob/master/module/auto-start.lua
;;; Code:
(local awful (require :awful))
(local spawn awful.spawn.with_shell)
;;;
;; Functions
(fn run-once [cmds]
(each [_ cmd (ipairs cmds)]
(let [first-space (: cmd :find " ")
findme (if first-space
(: cmd :sub 0 (- first-space 1))
cmd)]
(spawn
(string.format "pgrep -u $USER -x %s >/dev/null || (%s)" findme cmd))) ))
;; Keyboard
(spawn "tpset 'Natural Scrolling' 1")
(spawn "tpset 'Tapping' 1")
(spawn "setxkbmap -option caps:ctrl_modifier")
(run-once
["nm-applet" ;; WiFi
"pa-applet" ;; Sound manager
"blueman-applet" ;; Bluetooth
"compton -b" ;; Compositor
"libinput-gestures"
"fcitx-autostart" ;; Keyboard
])
{}
;;; module/auto-start.fnl ends here