Notifications for the server stopping and starting
This commit is contained in:
parent
9168cecfd4
commit
65887da8da
1 changed files with 13 additions and 8 deletions
19
gomuks.el
19
gomuks.el
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;; Depends on websocket and request.
|
;; Depends on websocket, request, and notifications.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
|
@ -34,7 +34,11 @@
|
||||||
(defvar gomuks-socket-buffer "*gomuks-socket-frame*")
|
(defvar gomuks-socket-buffer "*gomuks-socket-frame*")
|
||||||
(defvar gomuks-server-name "*gomuks-server*")
|
(defvar gomuks-server-name "*gomuks-server*")
|
||||||
|
|
||||||
(defcustom gomuks-server-binary "~/Downloads/gomuks"
|
(defvar gomuks-auth-cookie nil)
|
||||||
|
(defvar gomuks-websocket nil)
|
||||||
|
(defvar gomuks-ping-timer nil)
|
||||||
|
|
||||||
|
(defcustom gomuks-server-binary "~/tmp/gomuks"
|
||||||
"The Gomuks backend binary."
|
"The Gomuks backend binary."
|
||||||
:type 'string
|
:type 'string
|
||||||
:group 'gomuks)
|
:group 'gomuks)
|
||||||
|
|
@ -42,12 +46,16 @@
|
||||||
(defun gomuks-server-start ()
|
(defun gomuks-server-start ()
|
||||||
"Start the gomuks server process"
|
"Start the gomuks server process"
|
||||||
(interactive)
|
(interactive)
|
||||||
(start-process gomuks-server-name (get-buffer-create gomuks-server-buffer) gomuks-server-bin))
|
(start-process gomuks-server-name (get-buffer-create gomuks-server-buffer) gomuks-server-binary)
|
||||||
|
(notifications-notify :title "Gomuks Server Running" :app-name "gomuks.el"))
|
||||||
|
|
||||||
(defun gomuks-server-kill ()
|
(defun gomuks-server-kill ()
|
||||||
"Kill the gomuks server process"
|
"Kill the gomuks server process"
|
||||||
(interactive)
|
(interactive)
|
||||||
(kill-process gomuks-server-name))
|
(when (websocket-openp gomuks-websocket)
|
||||||
|
(gomuks-disconnect))
|
||||||
|
(kill-process gomuks-server-name)
|
||||||
|
(notifications-notify :title "Gomuks Server Closed" :app-name "gomuks.el"))
|
||||||
|
|
||||||
(defvar gomuks-url "http://localhost:29325")
|
(defvar gomuks-url "http://localhost:29325")
|
||||||
(defvar gomuks-auth-endpoint (concat gomuks-url "/_gomuks/auth"))
|
(defvar gomuks-auth-endpoint (concat gomuks-url "/_gomuks/auth"))
|
||||||
|
|
@ -55,9 +63,6 @@
|
||||||
|
|
||||||
(defvar gomuks-ws-endpoint (concat gomuks-url "/_gomuks/websocket"))
|
(defvar gomuks-ws-endpoint (concat gomuks-url "/_gomuks/websocket"))
|
||||||
|
|
||||||
(defvar gomuks-auth-cookie nil)
|
|
||||||
(defvar gomuks-websocket nil)
|
|
||||||
(defvar gomuks-ping-timer nil)
|
|
||||||
(defun gomuks-connect (gomuks-username)
|
(defun gomuks-connect (gomuks-username)
|
||||||
"Opens a websocket connection with the specified gomuks endpoint"
|
"Opens a websocket connection with the specified gomuks endpoint"
|
||||||
(interactive "sGomuks Username: \n")
|
(interactive "sGomuks Username: \n")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue