Kaynağa Gözat

Added the i3 commands and a commented header

Samuel W. Flint 7 yıl önce
ebeveyn
işleme
378e7f5233
1 değiştirilmiş dosya ile 16 ekleme ve 0 silme
  1. 16 0
      i3wm.el

+ 16 - 0
i3wm.el

@@ -18,6 +18,8 @@
 (require 'json)
 (require 'cl-lib)
 
+;;; Primitive functions:
+
 (defun i3wm-command (command &rest arguments)
   "I3wm-command COMMAND &rest ARGUMENTS.
 
@@ -47,6 +49,20 @@ Retrieve i3 version."
   (json-read-from-string
    (shell-command-to-string "i3-msg -t get_version")))
 
+;;; i3 commands
+
+(defun i3wm-exec (program)
+  "I3wm-exec PROGRAM.
+
+Executes the given PROGRAM."
+  (i3wm-command "exec %s" program))
+
+(defun i3wm-exec-no-startup-id (program)
+  "I3wm-exec-no-startup-id PROGRAM.
+
+Execute the given PROGRAM with --no-startup-id."
+  (i3wm-command "exec --no-startup-id %s" program))
+
 (provide 'i3wm)
 
 ;;; i3wm.el ends here