diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/doom.org | 277 | ||||
-rw-r--r-- | config/elfeed.org | 2 | ||||
-rw-r--r-- | config/qtile.org | 169 | ||||
-rw-r--r-- | config/qutebrowser.org | 5 |
4 files changed, 302 insertions, 151 deletions
diff --git a/config/doom.org b/config/doom.org index 480c4c6..5e77b70 100644 --- a/config/doom.org +++ b/config/doom.org @@ -32,84 +32,92 @@ To display the battery percentage: #+begin_src emacs-lisp :tangle yes (display-battery-mode 1) #+end_src +** Transparency +Let's make emacs transparent. +#+begin_src emacs-lisp :tangle yes +(set-frame-parameter nil 'alpha-background 90) + +(add-to-list 'default-frame-alist '(alpha-background . 90)) +#+end_src ** EXWM First we load our packages: #+begin_src emacs-lisp :tangle yes -(use-package! exwm) -(use-package! exwm-config) -(exwm-config-example) +;; (use-package! exwm) +;; (use-package! exwm-config) +;; (exwm-config-example) #+end_src Now, we set our keybindings: #+begin_src emacs-lisp :tangle yes -(setq exwm-input-global-keys - `( - ([?\s-r] . exwm-reset) - ([?\s-w] . exwm-workspace-switch) - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () - (interactive) - (exwm-workspace-switch-create ,i)))) - (number-sequence 0 9)) - ([?\s-&] . (lambda (command) - (interactive (list (read-shell-command "$ "))) - (start-process-shell-command command nil command))) - - ([?\s-d] . (lambda () - (interactive) - (dired default-directory))) - - ([?\s-f] . (lambda () - (interactive) - (exwm-layout-toggle-mode-line) - (exwm-workspace-toggle-minibuffer))) - - ([?\s-b] . exwm-workspace-switch-to-buffer) - - - ([?\s-w] . (lambda () - (interactive) - (start-process "" nil "qutebrowser"))) - ([?\s-n] . (lambda () - (interactive) - (start-process "" nil "nyxt"))) - ([?\s-k] . (lambda () - (interactive) - (start-process "" nil "krita"))) - ([?\s-g] . (lambda () - (interactive) - (start-process "" nil "gimp"))) - ([?\s-b] . (lambda () - (interactive) - (start-process "" nil "blender"))) - ([?\s-c] . (lambda () - (interactive) - (start-process "" nil "chromium"))) - ([s-f2] . (lambda () - (interactive) - (start-process "" nil "/usr/bin/slock"))))) +;; (setq exwm-input-global-keys +;; `( +;; ([?\s-r] . exwm-reset) +;; ([?\s-w] . exwm-workspace-switch) +;; ,@(mapcar (lambda (i) +;; `(,(kbd (format "s-%d" i)) . +;; (lambda () +;; (interactive) +;; (exwm-workspace-switch-create ,i)))) +;; (number-sequence 0 9)) +;; ([?\s-&] . (lambda (command) +;; (interactive (list (read-shell-command "$ "))) +;; (start-process-shell-command command nil command))) + +;; ([?\s-d] . (lambda () +;; (interactive) +;; (dired default-directory))) + +;; ([?\s-f] . (lambda () +;; (interactive) +;; (exwm-layout-toggle-mode-line) +;; (exwm-workspace-toggle-minibuffer))) + +;; ([?\s-b] . exwm-workspace-switch-to-buffer) + + +;; ([?\s-w] . (lambda () +;; (interactive) +;; (start-process "" nil "qutebrowser"))) +;; ([?\s-n] . (lambda () +;; (interactive) +;; (start-process "" nil "nyxt"))) +;; ([?\s-k] . (lambda () +;; (interactive) +;; (start-process "" nil "krita"))) +;; ([?\s-g] . (lambda () +;; (interactive) +;; (start-process "" nil "gimp"))) +;; ([?\s-b] . (lambda () +;; (interactive) +;; (start-process "" nil "blender"))) +;; ([?\s-c] . (lambda () +;; (interactive) +;; (start-process "" nil "chromium"))) +;; ([s-f2] . (lambda () +;; (interactive) +;; (start-process "" nil "/usr/bin/slock"))))) #+end_src And we also need to set up our media keys: #+begin_src emacs-lisp :tangle yes -(exwm-input-set-key (kbd "<XF86AudioNext>") 'emms-next) -(exwm-input-set-key (kbd "<XF86AudioPrev>") 'emms-previous) -(exwm-input-set-key (kbd "<XF86AudioPlay>") 'emms-pause) -(exwm-input-set-key - (kbd "<XF86AudioRaiseVolume>") - (lambda () - (interactive) (start-process-shell-command - "pactl" nil "pactl set-sink-volume 0 +5% && pactl set-sink-volume 1 +5%"))) -(exwm-input-set-key - (kbd "<XF86AudioLowerVolume>") - (lambda () - (interactive) (start-process-shell-command - "pactl" nil "pactl set-sink-volume 0 -5% && pactl set-sink-volume 1 -5%"))) -(exwm-input-set-key - (kbd "<XF86AudioMute>") - (lambda () - (interactive) (start-process-shell-command - "pactl" nil "pactl set-sink-mute 0 toggle && pactl set-sink-mute 1 toggle"))) +;; (exwm-input-set-key (kbd "<XF86AudioNext>") 'emms-next) +;; (exwm-input-set-key (kbd "<XF86AudioPrev>") 'emms-previous) +;; (exwm-input-set-key (kbd "<XF86AudioPlay>") 'emms-pause) +;; (exwm-input-set-key +;; (kbd "<XF86AudioRaiseVolume>") +;; (lambda () +;; (interactive) (start-process-shell-command +;; "pactl" nil "pactl set-sink-volume 0 +5% && pactl set-sink-volume 1 +5%"))) +;; (exwm-input-set-key +;; (kbd "<XF86AudioLowerVolume>") +;; (lambda () +;; (interactive) (start-process-shell-command +;; "pactl" nil "pactl set-sink-volume 0 -5% && pactl set-sink-volume 1 -5%"))) +;; (exwm-input-set-key +;; (kbd "<XF86AudioMute>") +;; (lambda () +;; (interactive) (start-process-shell-command +;; "pactl" nil "pactl set-sink-mute 0 tog +;; gle && pactl set-sink-mute 1 toggle"))) ;; Things to implement in exwm: ;;Key([], 'XF86MonBrightnessUp', lazy.spawn("light -A 10")), ;;Key([], 'XF86MonBrightnessDown', lazy.spawn("light -U 10")), @@ -118,24 +126,26 @@ And we also need to set up our media keys: ** Font Now we configure fonts: #+begin_src emacs-lisp :tangle yes -(setq doom-font (font-spec :family "FiraCode Nerd Font" :size 14 :weight 'semi-light) - doom-variable-pitch-font (font-spec :family "Fira Sans" :size 14) - doom-unicode-font (font-spec :family "Symbola" :size 14) - doom-serif-font (font-spec :family "Fira Sans" :size 14) - doom-big-font (font-spec :family "FiraCode Nerd Font" :size 28)) +(setq doom-font (font-spec :family "Hack" :size 16 :weight 'semi-light) + doom-variable-pitch-font (font-spec :family "Fira Sans" :size 16) + doom-unicode-font (font-spec :family "Symbola" :size 16) + doom-serif-font (font-spec :family "Fira Sans" :size 16) + doom-big-font (font-spec :family "Hack" :size 28)) #+end_src ** Color Scheme I'm experimenting with many themes right now. One of these themes is the city-lights theme, another one of them is the catppuccin theme. #+begin_src emacs-lisp :tangle yes -(setq doom-theme 'doom-ayu-light) -;; (setq doom-theme 'doom-rouge) +;; (setq doom-theme 'doom-ayu-light) +(setq doom-theme 'doom-miramare) ;; (setq catppuccin-flavor 'mocha) +;; (load-theme 'catppuccin) #+end_src ** Doom Module and Programs Configuration *** Agenda Now we add these two files to our agenda search path: #+begin_src emacs-lisp :tangle yes +(require 'org-habit) (setq org-agenda-files (list "~/org/agenda.org" "~/org/contacts.org" "~/org/notes.org")) @@ -148,23 +158,29 @@ And we also want to set up org-habit to start graphing our habits as soon as pos *** IRC Set up circe to connect to my bouncer: #+begin_src emacs-lisp :tangle yes -(after! circe - (set-irc-server! "nullring.xyz" - `(:tls t - :port 4095 - :nick "LiCoO2/AndreiNet" - :user "LiCoO2/AndreiNet" - :pass ,(+pass-get-secret "ZNC")))) +;; (after! circe +;; (set-irc-server! "nullring.xyz" +;; `(:tls t +;; :port 4095 +;; :nick "LiCoO2/AndreiNet" +;; :user "LiCoO2/AndreiNet" +;; :pass ,(+pass-get-secret "ZNC")))) #+end_src And another to connect to libera: #+begin_src emacs-lisp :tangle yes -(set-irc-server! "irc.libera.chat" +(after! circe (set-irc-server! "irc.libera.chat" `(:tls t :port 6697 :nick "ret2pop" :sasl-username "ret2pop" :sasl-password (lambda (&rest _) (+pass-get-secret "libera.chat")) - :channels ("#emacs" "#rwx"))) + :channels ("#emacs" "#rwx")))) +#+end_src +#+begin_src emacs-lisp :tangle yes +(after! circe (set-irc-server! "nullring.xyz" + `(:tls t + :port 6697 + :nick "LiCoO2"))) #+end_src *** Email In order to use this configuration, you must install and configure mu and mbsync. @@ -210,6 +226,7 @@ We want the default search engine of eww to be google because duckduckgo is bad: (setq search-engine-default "google") (setq eww-search-prefix "https://google.com/search?q=") +(setq browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "qutebrowser") (setq browse-url-browser-function 'eww-browse-url) (add-hook 'eww-mode-hook (lambda () (local-set-key (kbd "y Y") #'eww-copy-page-url))) @@ -218,11 +235,41 @@ We want the default search engine of eww to be google because duckduckgo is bad: In order to use this configuration, you must have mpd configured to use the same directory. We automatically connect to mpd. #+begin_src emacs-lisp :tangle yes +(emms-all) +(setq emms-source-file-default-directory (expand-file-name "~/music/")) (setq emms-player-mpd-music-directory "~/music/") +(setq emms-player-mpd-server-name "localhost") +(setq emms-player-mpd-server-port "6600") (setq emms-player-list '(emms-player-mpd)) -(emms-all) +(add-to-list 'emms-info-functions 'emms-info-mpd) +(add-to-list 'emms-player-list 'emms-player-mpd) (emms-player-mpd-connect) #+end_src +** Keybindings +Now we set up our keybindings for our applications: +#+begin_src emacs-lisp :tangle yes +(map! :leader + :desc "Open irc" + "i c" #'circe) +(map! :leader + :desc "Open audio manager" + "m m" #'emms) +(map! :leader + :desc "Open RSS feed reader" + "r s" #'elfeed) +(map! :leader + :desc "Open password manager" + "p w" #'ivy-pass) +(map! :leader + :desc "Open dictionary program" + "d i" #'dictionary) +(map! :leader + :desc "Open rtorrent frontend" + "r t" #'mentor) +(map! :leader + :desc "Open eww web browser" + "e w" #'eww) +#+end_src *** Journal First we set the journal to be in the website directory: #+begin_src emacs-lisp :tangle yes @@ -241,6 +288,7 @@ And then we add the headers needed to export the journal automatically: (`yearly "#+TITLE: Yearly Journal\n#+STARTUP: folded")))) (setq org-journal-file-header 'org-journal-file-header-func) +(setq org-export-with-section-numbers nil) (setq org-journal-file-format "%Y%m%d.org") #+end_src To add everything to the agenda search path, we toggle: @@ -276,13 +324,12 @@ In order to publish my website, we need to configure emacs to publish it somewhe :auto-preamble t) ("website-static" :base-directory "~/org/website" - :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf" + :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|ico" :publishing-directory "~/website_html/" :recursive t :publishing-function org-publish-attachment) - ("website" :components ("website-org" "website-static")))) - - + ("website" :auto-sitemap t :components ("website-org" "website-static")))) +(setq org-html-postamble "Copyright (c) 2024 Preston Pan") #+end_src *** Contacts Now we configure org-contacts, which allows me to store contacts in an org mode file: @@ -308,31 +355,6 @@ Sometimes I want a timer to help me keep track of the time. #+begin_src emacs-lisp :tangle yes (setq org-clock-sound "~/audio/ding.wav") #+end_src -** Keybindings -Now we set up our keybindings for our applications: -#+begin_src emacs-lisp :tangle yes -(map! :leader - :desc "Open irc" - "i c" #'circe) -(map! :leader - :desc "Open audio manager" - "m m" #'emms) -(map! :leader - :desc "Open RSS feed reader" - "r s" #'elfeed) -(map! :leader - :desc "Open password manager" - "p w" #'ivy-pass) -(map! :leader - :desc "Open dictionary program" - "d i" #'dictionary) -(map! :leader - :desc "Open rtorrent frontend" - "r t" #'mentor) -(map! :leader - :desc "Open eww web browser" - "e w" #'eww) -#+end_src ** External Packages we want to include some packages that don't come with doom emacs. *** KBD-Mode @@ -393,9 +415,26 @@ We use ednc to manage notifications. #+end_src *** Mastodon #+begin_src emacs-lisp :tangle yes -(setq mastodon-instance-url "https://types.pl" - mastodon-active-user "ret2pop") +(setq mastodon-instance-url "https://types.pl") +(setq mastodon-active-user "ret2pop") +#+end_src +*** Ement +#+begin_src emacs-lisp :tangle yes +;; (ement-connect :uri-prefix "http://localhost:8009") #+end_src +*** Stem +I wrote a [[https://github.com/ret2pop/stem-mode][major mode]] for my programming language [[https://github.com/ret2pop/stem][stem]]. +#+begin_src emacs-lisp :tangle yes +(use-package stem-mode) +(add-to-list 'auto-mode-alist '("\\.stem\\'" . stem-mode)) +#+end_src +*** Tufte +Our website uses the tufte css styling and we must therefore tell emacs to generate html that is compliant with this html: +#+begin_src emacs-lisp +(use-package! ox-tufte) +(use-package! plan9-theme) +#+end_src + * packages.el Configuration These are some external packages that I use that are not provided by doom modules. #+begin_src emacs-lisp :tangle packages.el @@ -424,6 +463,8 @@ These are some external packages that I use that are not provided by doom module (package! go-translate) (package! ts) (package! chess) +(package! ox-tufte) +(package! plan9-theme) #+end_src * init.el Configuration @@ -552,7 +593,7 @@ This installs all the doom modules that we are going to be configuring: ;;gdscript ; the language you waited for (go +lsp) ;;(graphql +lsp) ; Give queries a REST - ;;(haskell +lsp) ; a language that's lazier than I am + (haskell +lsp) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on (json +lsp) @@ -584,7 +625,7 @@ This installs all the doom modules that we are going to be configuring: (scheme +guile) (sh +fish +lsp) ;;sml - ;;solidity ; do you need a blockchain? No. + solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. (web +lsp) diff --git a/config/elfeed.org b/config/elfeed.org index ca942ea..94fdbf5 100644 --- a/config/elfeed.org +++ b/config/elfeed.org @@ -18,6 +18,8 @@ Here are some interesting blogs, many of which are from substack. ** News :news: These are the news articles that I subscribe to. Some of these are politics related but I mostly just want to inform myself about technology subjects. +*** https://www.wired.com/feed/tag/ai/latest/rss +*** https://www.wired.com/feed/category/science/latest/rss *** https://feeds.washingtonpost.com/rss/politics?itid=lk_inline_manual_2 *** https://news.ycombinator.com/rss diff --git a/config/qtile.org b/config/qtile.org index 04bcb12..537bab5 100644 --- a/config/qtile.org +++ b/config/qtile.org @@ -30,7 +30,7 @@ import subprocess mod = "mod4" -terminal = guess_terminal() +terminal = "kitty" wl_import_rules = None auto_minimize = True wmname = "LG3D" @@ -38,8 +38,9 @@ wmname = "LG3D" ** Hex Colors We then load the catppuccin colors for the bar and window borders. #+begin_src python :tangle config.py -def get_colors(): - return [ +def get_colors(theme): + if theme == "city-lights": + return [ # Normal colors '#45475a', '#f38ba8', @@ -65,8 +66,33 @@ def get_colors(): # foreground '#cdd6f4', ] + elif theme == "gruvbox": + return [ + # normal colors + '#282828', + '#cc241d', + '#98971a', + '#d79921', + '#458588', + '#b16286', + '#689d6a', + '#a89984', + #bright colors + '#928374', + '#fb4934', + '#b8bb26', + '#fabd2f', + '#83a598', + '#d3869b', + '#8ec07c', + '#ebdbb2', + # background + '#282828', + # foreground + '#ebdbb2', + ] -colors = get_colors() +colors = get_colors("gruvbox") #+end_src ** Keybindings The _keys_ variable is going to be our final list of keybindings. We start by initializing it @@ -123,6 +149,7 @@ keys.extend([ Key([mod], "g", lazy.spawn("gimp"), desc="Run GIMP"), Key([mod], "t", lazy.spawn("torbrowser-launcher"), desc="Run Tor Browser"), Key([mod], "i", lazy.spawn("emacsclient --eval \"(emacs-everywhere)\""), desc="Emacs Everywhere!"), + Key([mod], "d", lazy.spawn("dmenu_run"), desc="dmenu"), ]) #+end_src *** XF86 @@ -173,7 +200,7 @@ layouts = [ # layout.Stack(num_stacks=2), # layout.Bsp(), # layout.Matrix(), - # layout.MonadTall(), + layout.MonadTall(border_focus=colors[2], border_normal=colors[0], border_width=4, margin=7), # layout.MonadWide(), # layout.RatioTile(), # layout.Tile(), @@ -195,40 +222,120 @@ widget_defaults = dict( ) extension_defaults = widget_defaults.copy() +# screens = [ +# Screen( +# top=bar.Bar( +# [ +# # widget.CurrentLayout(), +# widget.GroupBox(active=colors[6], inactive=colors[15], this_current_screen_border=colors[4], highlight_colorsr=colors[3]), +# widget.Prompt(), +# widget.WindowName(), +# widget.Chord( +# chords_colors={ +# "launch": ("#ff0000", "#ffffff"), +# }, +# name_transform=lambda name: name.upper(), +# ), +# # widget.StatusNotifier(), + +# widget.Systray(), +# widget.Battery(charge_char="🔋", discharge_char="🔋", full_char="🔋", format="{char} {percent:2.0%}"), +# # widget.TextBox("|", foreground=colors[1]), +# widget.Sep(padding=16, size_percent=80, foreground=colors[1]), +# widget.Clock(format="🕒 %a %I:%M %p"), +# widget.Sep(padding=16, size_percent=80, foreground=colors[1]), +# widget.Mpd2(), +# widget.TextBox(" "), + +# ], +# 24, + +# # border_width=[2, 0, 2, 0], # Draw top and bottom borders +# # border_colorsr=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta +# ), +# bottom=bar.Gap(4), +# left=bar.Gap(3), +# right=bar.Gap(3), +# ), +# ] + +def pline(rl, fg, bg): + if rl == 0: + uc = "" + else: + uc = "" + return widget.TextBox(text = uc, + padding = 0, + fontsize = 22, + foreground=fg, + background=bg) + screens = [ Screen( + wallpaper="~/.config/qtile/wallpaper", + wallpaper_mode="fill", top=bar.Bar( [ - # widget.CurrentLayout(), - widget.GroupBox(active=colors[6], inactive=colors[15], this_current_screen_border=colors[4], highlight_color=colors[3]), - widget.Prompt(), - widget.WindowName(), - widget.Chord( - chords_colors={ - "launch": ("#ff0000", "#ffffff"), - }, - name_transform=lambda name: name.upper(), + widget.CurrentLayoutIcon( + scale=0.75, + background=colors[3] ), - # widget.StatusNotifier(), - - widget.Systray(), - widget.Battery(charge_char="🔋", discharge_char="🔋", full_char="🔋", format="{char} {percent:2.0%}"), - # widget.TextBox("|", foreground=colors[1]), - widget.Sep(padding=16, size_percent=80, foreground=colors[1]), - widget.Clock(format="🕒 %a %I:%M %p"), - widget.Sep(padding=16, size_percent=80, foreground=colors[1]), - widget.Mpd2(), - widget.TextBox(" "), + pline(0, colors[3], colors[6]), + widget.GroupBox( + highlight_method="block", + background=colors[6], + this_current_screen_border="#7daea3" + ), + pline(0, colors[6], colors[7]), + widget.TaskList( + highlight_method="block", + max_title_width=300, + border="#d3869b", + padding=2, + background=colors[7] + ), + pline(0, colors[7], colors[0]), + widget.Spacer(), + pline(1, colors[2], colors[0]), + widget.Net( # requires python-psutil + interface="wlp0s20f3", + format="📡 {total}", + update_interval=30, + background=colors[2] + ), + pline(1, colors[5], colors[2]), + widget.Backlight( + format="💡 {percent:2.0%}", + backlight_name="intel_backlight", + background=colors[5] + ), + pline(1, colors[3], colors[5]), + widget.Volume( + emoji=True, + background=colors[3] + ), + widget.Volume( + background=colors[3] + ), + pline(1, colors[4], colors[3]), + widget.BatteryIcon( + background=colors[4] + ), + widget.Battery( + charge_char="now ", + discharge_char="left", + format="{percent:2.0%} {char}", + background=colors[4] + ), + pline(1, colors[1], colors[4]), + widget.Clock( + format="%Y-%m-%d %a %I:%M %p", + background=colors[1] + ), ], - 24, - - # border_width=[2, 0, 2, 0], # Draw top and bottom borders - # border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta + 26, ), - bottom=bar.Gap(4), - left=bar.Gap(3), - right=bar.Gap(3), ), ] #+end_src diff --git a/config/qutebrowser.org b/config/qutebrowser.org index 03741b0..1deb37a 100644 --- a/config/qutebrowser.org +++ b/config/qutebrowser.org @@ -18,7 +18,8 @@ We import pathlib to get our home directory. I am experimenting with many themes right now, and one of them is the [[https://github.com/gicrisf/qute-city-lights][city-lights]] theme. Another one I have used is the [[https://github.com/catppuccin/catppuccin][catppuccin]] theme. #+begin_src python :tangle config.py -config.source('themes/qute-city-lights/city-lights-theme.py') +# config.source('themes/qute-city-lights/city-lights-theme.py') +config.source('gruvbox.py') #+end_src ** Variables We need the location of the home directory. @@ -96,7 +97,7 @@ for item in js_blacklist: ** Misc. Doing mundane things like setting the downloads directory to not use an upper case letter. #+begin_src python :tangle config.py -c.downloads.location.directory = "~/downloads" +c.downloads.location.directory = "~/Downloads" #+end_src ** End of Config #+begin_src python :tangle config.py |