Add pinentry and rcirc cubes

This commit is contained in:
Sameer Rahmani 2021-05-06 09:29:34 +01:00
parent 9031d2ef34
commit 16c2ad9fe8
4 changed files with 100 additions and 3 deletions

View File

@ -28,6 +28,16 @@
"Enable the support for font icones in FG42.") "Enable the support for font icones in FG42.")
(defcube fg42/pinentry-cube
(:docs "cubes/fg42/pinentry-cube.org"
:flag pinentry)
(fpkg/use pinentry
:init
(progn
(setq epa-pinentry-mode 'loopback)
(pinentry-start))))
(defcube fg42/exec-path-cube (defcube fg42/exec-path-cube
(:docs "cubes/fg42/exec-path-cube.org" (:docs "cubes/fg42/exec-path-cube.org"
:flag exec-path-from-shell) :flag exec-path-from-shell)

39
core/cubes/irc.el Normal file
View File

@ -0,0 +1,39 @@
;;; IrcCubes --- The IRC related cubes for FG42 -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2010-2021 Sameer Rahmani & Contributors
;;
;; Author: Sameer Rahmani <lxsameer@gnu.org>
;; URL: https://gitlab.com/FG42/FG42
;; Version: 3.0.0
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;
;;; Commentary:
;;; Code:
(require 'fpkg)
(require 'fg42/cube)
(defcube fg42/rcirc-cube
(:docs "cubes/fg42/rcirc-cube.org"
:flag rcirc)
(autoload-cube 'fg42/rcirc-connect "irc/core.el" "Connect to IRC via RCIRC." t)
(defun fg42/connect-to-irc ()
(interactive)
(fg42/rcirc-connect)))
(provide 'cubes/irc)
;;; irc.el ends here

46
core/cubes/irc/core.el Normal file
View File

@ -0,0 +1,46 @@
;;; IrcCubes --- The IRC related cubes for FG42 -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2010-2021 Sameer Rahmani & Contributors
;;
;; Author: Sameer Rahmani <lxsameer@gnu.org>
;; URL: https://gitlab.com/FG42/FG42
;; Version: 3.0.0
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;
;;; Commentary:
;;; Code:
(defvar fg42/default-rcirc-servers
'(("chat.freenode.net"
:channels ("#fg42"))))
(defun fg42/rcirc-connect ()
"Connect to IRC servers."
(interactive)
(require 'rcirc)
(let ((servers (or (plist-get fg42/rcirc-cube-params :server)
fg42/default-rcirc-servers)))
(setq rcirc-enable-authinfo-support t)
(setq rcirc-server-alist servers)
(add-hook 'rcirc-mode-hook
(lambda ()
(rcirc-track-minor-mode 1)))
(irc nil)))
(provide 'cubes/irc/core)
;;; core.el ends here

View File

@ -163,10 +163,12 @@ last item in second form, etc."
(load-file file))) (load-file file)))
(defmacro autoload-cube (fn file docstring) (defmacro autoload-cube (fn file docstring &optional interactive)
"A wrapper for autloading FN at FILE with the given DOCSTRING. "A wrapper for autloading FN at FILE with the given DOCSTRING.
This macro looks inside of the cubes directories." This macro looks inside of the cubes directories. If the INTERACTIVE param
`(autoload ,fn (expand-file-name (format "core/cubes/%s" ,file) fg42-home) ,docstring)) is non-nil value it means that the function can be called interactively."
`(autoload ,fn (expand-file-name (format "core/cubes/%s" ,file) fg42-home)
,docstring ,interactive))
(provide 'fg42/utils) (provide 'fg42/utils)