blob: 48aa5d637fb601ca68815d9f0e23976cdf903377 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
;;; screen-brightness.el --- Control laptop screen brightness -*- lexical-binding: t -*-
;; Author: William Carroll <wpcarro@gmail.com>
;; Version: 0.0.1
;; URL: https://git.wpcarro.dev/wpcarro/briefcase
;; Package-Requires: ((emacs "24"))
;;; Commentary:
;; Control your laptop's screen brightness.
;;; Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Dependencies
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'prelude)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgroup screen-brightness nil "Configuration for screen-brightness.")
(defcustom screen-brightness-increase-cmd
"light -A 3"
"The shell command to run to increase screen brightness."
:group 'screen-brightness
:type 'string)
(defcustom screen-brightness-decrease-cmd
"light -U 3"
"The shell command to run to decrease screen brightness."
:group 'screen-brightness
:type 'string)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Library
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun screen-brightness-increase ()
"Increase the screen brightness."
(interactive)
(prelude-start-process
:name "screen-brightness-increase"
:command screen-brightness-increase-cmd)
(message "[screen-brightness.el] Increased screen brightness."))
(defun screen-brightness-decrease ()
"Decrease the screen brightness."
(interactive)
(prelude-start-process
:name "screen-brightness-decrease"
:command screen-brightness-decrease-cmd)
(message "[screen-brightness.el] Decreased screen brightness."))
(provide 'screen-brightness)
;;; screen-brightness.el ends here
|