aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/init/ycp-client.el
blob: d35898c840e7cd867b48efab1af4bf968966e26c (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
;;; ycp-client.el -- My config for non-http clients -*- lexical-binding: t -*-

;; Copyright (C) 2023 Free Software Foundation.

;; Author: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))

;; This file is part of dotfiles.

;; dotfiles is free software: you can redistribute it and/or modify it under
;; the terms of the GNU Affero General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; dotfiles 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 Affero General
;; Public License for more details.

;; You should have received a copy of the GNU Affero General Public
;; License along with dotfiles.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; My config for non-http clients. like wget, ytdl, sql, irc, etc


;;; Code:

;;; Note: erc is only allowed when `my-profile' is erc, as assigned in early-init.el
(my-package erc
  (setq erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
  (setq erc-disable-ctcp-replies t)
  (setq erc-modules
        '(button completion irccontrols list match menu move-to-prompt
                 netsplit networks noncommands notifications readonly
                 ring stamp track))
  (my-setq-from-local erc-track-exclude erc-server erc-nick erc-port)
  ;; use auth-source for authentication
  (setq erc-prompt-for-password nil)
  (setq erc-paranoid t)
  (setq erc-fill-mode t)
  (require 'erc-match)
  (set-face-attribute 'erc-fool-face nil :foreground "white")
  (setq erc-fool-highlight-type 'all)
  (my-setq-from-local erc-fools)
  (erc-tls))

(my-package dictionary
  (:delay 15)
  (autoload 'dictionary-search "dictionary"
    "Ask for a word and search it in all dictionaries" t)
  (autoload 'dictionary-match-words "dictionary"
    "Ask for a word and search all matching words in the dictionaries" t)
  (autoload 'dictionary-lookup-definition "dictionary"
    "Unconditionally lookup the word at point." t)
  (autoload 'dictionary "dictionary"
    "Create a new dictionary buffer" t)
  (autoload 'dictionary-mouse-popup-matching-words "dictionary"
    "Display entries matching the word at the cursor" t)
  (autoload 'dictionary-popup-matching-words "dictionary"
    "Display entries matching the word at the point" t)
  (autoload 'dictionary-tooltip-mode "dictionary"
    "Display tooltips for the current word" t)
  (autoload 'global-dictionary-tooltip-mode "dictionary"
    "Enable/disable dictionary-tooltip-mode for all buffers" t)
  (my-keybind global-map
    "C-h y" #'dictionary-search
    "C-h Y" #'dictionary-match-words)
  ;; Install dictd locally to serve lookups
  (setq dictionary-server "localhost"
        dictionary-default-popup-strategy "lev" ; read doc string
        dictionary-create-buttons nil
        dictionary-use-single-buffer t))

(my-package ange-ftp
  (:delay 15)
  (setq ange-ftp-try-passive-mode t))

(my-package wget
  (:delay 60)
  (require 'my-utils)
  (setq wget-download-directory my-incoming-dir)
  (setq my-wget-size-threshold (* 20 1024 1024))
  (require 'my-wget)
  (my-setq-from-local my-wget-video-archive-directory)
  (my-keybind eww-mode-map "s" #'my-eww-wget-save-page)
  )

(my-package my-ytdl
  (:delay 60)
  (require 'my-utils)
  (setq my-ytdl-audio-download-dir my-audio-incoming-dir
        my-ytdl-video-download-dir my-video-incoming-dir))

(my-package my-media-segment
  (:delay 60))

(my-package detached
  (:install t)
  (:delay 60)
  (my-keybind detached-shell-mode-map
    "C-<return>" nil
    "C-S-<return>" #'detached-attach-session)
  (require 'my-detached)
  (my-keybind global-map "\M-z" #'my-execute-external-command)
)

(my-package pactl (:delay 60))

(provide 'ycp-client)
;;; ycp-client.el ends here