[twitch] Revise layer

This includes fixing the documentation as well as
making the connection to erc and streamlink layer
non-optional.
This commit is contained in:
Maxi Wolff 2021-09-11 23:16:14 +02:00
parent 06cfd27276
commit 471b6939c8
No known key found for this signature in database
GPG Key ID: 2DD07025BFDBD89A
4 changed files with 34 additions and 23 deletions

View File

@ -11,8 +11,7 @@
* Description
This layer adds support for twitch. You can search for streamers and open the stream in the browser.
If the =erc= layer is enabled you are able to connect to twitch irc and join the streamer channel.
If the =streamlink= layer is enabled the streams are opened with streamlink.
You are also able to connect to twitch irc and join the streamer channel.
** Features:
- Connect to Twitch irc via erc
@ -29,7 +28,6 @@ You can get an OAUTH token for twitch [[http://twitchapps.com/tmi/][here]]. Remo
#+BEGIN_SRC emacs-lisp
erc ;; optional
streamlink ;; optional
(twitch :variables
twitch-api-username "USERNAME"
twitch-api-oauth-token "TOKEN") ;; remove oauth: prefix
@ -40,14 +38,12 @@ You can get an OAUTH token for twitch [[http://twitchapps.com/tmi/][here]]. Remo
| Key Binding | Description |
|---------------+------------------------------------------|
| ~SPC a c i t~ | Connect to Twitch irc via erc |
| ~SPC a w s h~ | Start twitch helm and search for streams |
| ~SPC a w s t~ | Start twitch helm and search for streams |
** Twitch helm
When enabling =erc= and =streamlink= layers helm-twitch has the following keybindings.
| Key Binding | Description |
|---------------+-----------------------------------------|
| ~SPC a w s h~ | Start twitch helm |
| ~F1~ or ~RET~ | Open stream in streamlink |
| ~F2~ | Join this stream in irc Twitch channel |
| ~F3~ | Open this stream in a browser (default) |

View File

@ -1,6 +1,6 @@
;;; config.el --- erc Layer configuration File for Spacemacs
;;; config.el --- twitch Layer Configuration File For Spacemacs
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;; Copyright (c) 2021 Sylvain Benner & Contributors
;;
;; Author: Benedikt Broich <b.broich@posteo.de>
;; URL: https://github.com/syl20bnr/spacemacs

View File

@ -0,0 +1,23 @@
;;; layers.el --- twitch Layer layers File for Spacemacs
;;
;; Copyright (c) 2021 Sylvain Benner & Contributors
;;
;; Author: Maximilian Wolff <smile13241324@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;; 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/>.
(configuration-layer/declare-layer-dependencies '(erc streamlink))

View File

@ -1,6 +1,6 @@
;;; packages.el --- twitch layer packages file for Spacemacs.
;;; packages.el --- twitch Layer Packages File For Spacemacs.
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;; Copyright (c) 2021 Sylvain Benner & Contributors
;;
;; Author: Benedikt Broich <b.broich@posteo.de>
;; URL: https://github.com/syl20bnr/spacemacs
@ -20,11 +20,8 @@
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
(defconst twitch-packages
'(
(twitch-api :location (recipe :fetcher github
'((twitch-api :location (recipe :fetcher github
:repo "benediktbroich/twitch-api"))
(helm-twitch :location (recipe :fetcher github
:repo "benediktbroich/helm-twitch")
@ -32,19 +29,14 @@
(defun twitch/init-twitch-api ()
(use-package twitch-api
:init (progn
(when (configuration-layer/package-usedp 'erc)
(spacemacs/set-leader-keys
"acit" 'twitch-api-erc-tls)))))
:init (spacemacs/set-leader-keys
"acit" 'twitch-api-erc-tls)))
(defun twitch/init-helm-twitch ()
(use-package helm-twitch
:defer t
:init (progn
(spacemacs/declare-prefix "aws" "stream")
(spacemacs/set-leader-keys
"awst" 'helm-twitch)
(when (configuration-layer/package-usedp 'streamlink)
(setq helm-twitch-enable-livestreamer-actions t))
(when (configuration-layer/package-usedp 'erc)
(setq helm-twitch-enable-chat-actions t)))))
(setq helm-twitch-enable-livestreamer-actions t
helm-twitch-enable-chat-actions t))))