aboutsummaryrefslogtreecommitdiff
path: root/home-manager/programs
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/programs')
-rw-r--r--home-manager/programs/ags/bar/config.js203
-rw-r--r--home-manager/programs/ags/bar/style.css26
-rw-r--r--home-manager/programs/ags/default.nix8
-rw-r--r--home-manager/programs/alacritty/default.nix23
-rw-r--r--home-manager/programs/default.nix11
-rw-r--r--home-manager/programs/default.nix~28
-rw-r--r--home-manager/programs/emacs/config.org882
-rw-r--r--home-manager/programs/emacs/default.nix99
-rw-r--r--home-manager/programs/emacs/early-init.el4
-rw-r--r--home-manager/programs/emacs/init.el690
-rw-r--r--home-manager/programs/emacs/init.old.el592
-rw-r--r--home-manager/programs/firefox/default.nix109
-rw-r--r--home-manager/programs/firefox/user.js262
-rw-r--r--home-manager/programs/firefox/userChrome.css98
-rw-r--r--home-manager/programs/fish/default.nix45
-rw-r--r--home-manager/programs/foot/default.nix9
-rw-r--r--home-manager/programs/kitty/default.nix14
-rw-r--r--home-manager/programs/kitty/default.nix~10
-rw-r--r--home-manager/programs/ranger/commands.py183
-rw-r--r--home-manager/programs/ranger/default.nix11
-rw-r--r--home-manager/programs/ranger/default.nix~7
-rw-r--r--home-manager/programs/ranger/plugins/__init__.py0
-rw-r--r--home-manager/programs/ranger/plugins/__pycache__/__init__.cpython-310.pycbin139 -> 0 bytes
-rw-r--r--home-manager/programs/ranger/plugins/__pycache__/__init__.cpython-311.pycbin155 -> 0 bytes
-rw-r--r--home-manager/programs/ranger/plugins/__pycache__/fd.cpython-311.pycbin6322 -> 0 bytes
-rw-r--r--home-manager/programs/ranger/plugins/__pycache__/quit_cd_wd.cpython-310.pycbin1682 -> 0 bytes
-rw-r--r--home-manager/programs/ranger/plugins/__pycache__/quit_cd_wd.cpython-311.pycbin3030 -> 0 bytes
-rw-r--r--home-manager/programs/ranger/plugins/quit_cd_wd.py38
-rw-r--r--home-manager/programs/ranger/plugins/ranger_fzf_filter/.gitignore132
-rw-r--r--home-manager/programs/ranger/plugins/ranger_fzf_filter/LICENSE21
-rw-r--r--home-manager/programs/ranger/plugins/ranger_fzf_filter/README.md47
-rw-r--r--home-manager/programs/ranger/plugins/ranger_fzf_filter/__init__.py35
-rw-r--r--home-manager/programs/ranger/plugins/ranger_fzf_filter/command.py59
-rw-r--r--home-manager/programs/ranger/plugins/ranger_fzf_filter/filter.py84
-rw-r--r--home-manager/programs/ranger/rc.conf12
-rw-r--r--home-manager/programs/ranger/rifle.conf284
-rwxr-xr-xhome-manager/programs/ranger/scope.sh351
-rw-r--r--home-manager/programs/rofi/config.rasi156
-rw-r--r--home-manager/programs/rofi/default.nix22
-rw-r--r--home-manager/programs/rofi/squared-material-pine.rasi96
-rw-r--r--home-manager/programs/waybar/config.jsonc94
-rw-r--r--home-manager/programs/waybar/default.nix19
-rw-r--r--home-manager/programs/waybar/style.css31
43 files changed, 0 insertions, 4795 deletions
diff --git a/home-manager/programs/ags/bar/config.js b/home-manager/programs/ags/bar/config.js
deleted file mode 100644
index 8abf671..0000000
--- a/home-manager/programs/ags/bar/config.js
+++ /dev/null
@@ -1,203 +0,0 @@
-// importing
-import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
-import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js';
-import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
-import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
-import Battery from 'resource:///com/github/Aylur/ags/service/battery.js';
-import SystemTray from 'resource:///com/github/Aylur/ags/service/systemtray.js';
-import App from 'resource:///com/github/Aylur/ags/app.js';
-import Widget from 'resource:///com/github/Aylur/ags/widget.js';
-import { exec, execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
-
-// widgets can be only assigned as a child in one container
-// so to make a reuseable widget, just make it a function
-// then you can use it by calling simply calling it
-
-const Workspaces = () => Widget.Box({
- className: 'workspaces',
- connections: [[Hyprland.active.workspace, self => {
- // generate an array [1..10] then make buttons from the index
- const arr = Array.from({ length: 10 }, (_, i) => i + 1);
- self.children = arr.map(i => Widget.Button({
- onClicked: () => execAsync(`hyprctl dispatch workspace ${i}`),
- child: Widget.Label(`${i}`),
- className: Hyprland.active.workspace.id == i ? 'focused' : '',
- }));
- }]],
-});
-
-const ClientTitle = () => Widget.Label({
- className: 'client-title',
- binds: [
- ['label', Hyprland.active.client, 'title'],
- ],
-});
-
-const Clock = () => Widget.Label({
- className: 'clock',
- connections: [
- // this is bad practice, since exec() will block the main event loop
- // in the case of a simple date its not really a problem
- [1000, self => self.label = exec('date "+%H:%M:%S %b %e."')],
-
- // this is what you should do
- [1000, self => execAsync(['date', '+%H:%M:%S %b %e.'])
- .then(date => self.label = date).catch(console.error)],
- ],
-});
-
-// we don't need dunst or any other notification daemon
-// because the Notifications module is a notification daemon itself
-const Notification = () => Widget.Box({
- className: 'notification',
- children: [
- Widget.Icon({
- icon: 'preferences-system-notifications-symbolic',
- connections: [
- [Notifications, self => self.visible = Notifications.popups.length > 0],
- ],
- }),
- Widget.Label({
- connections: [[Notifications, self => {
- self.label = Notifications.popups[0]?.summary || '';
- }]],
- }),
- ],
-});
-
-const Media = () => Widget.Button({
- className: 'media',
- onPrimaryClick: () => Mpris.getPlayer('')?.playPause(),
- onScrollUp: () => Mpris.getPlayer('')?.next(),
- onScrollDown: () => Mpris.getPlayer('')?.previous(),
- child: Widget.Label({
- connections: [[Mpris, self => {
- const mpris = Mpris.getPlayer('');
- // mpris player can be undefined
- if (mpris)
- self.label = `${mpris.trackArtists.join(', ')} - ${mpris.trackTitle}`;
- else
- self.label = 'Nothing is playing';
- }]],
- }),
-});
-
-const Volume = () => Widget.Box({
- className: 'volume',
- css: 'min-width: 180px',
- children: [
- Widget.Stack({
- items: [
- // tuples of [string, Widget]
- ['101', Widget.Icon('audio-volume-overamplified-symbolic')],
- ['67', Widget.Icon('audio-volume-high-symbolic')],
- ['34', Widget.Icon('audio-volume-medium-symbolic')],
- ['1', Widget.Icon('audio-volume-low-symbolic')],
- ['0', Widget.Icon('audio-volume-muted-symbolic')],
- ],
- connections: [[Audio, self => {
- if (!Audio.speaker)
- return;
-
- if (Audio.speaker.isMuted) {
- self.shown = '0';
- return;
- }
-
- const show = [101, 67, 34, 1, 0].find(
- threshold => threshold <= Audio.speaker.volume * 100);
-
- self.shown = `${show}`;
- }, 'speaker-changed']],
- }),
- Widget.Slider({
- hexpand: true,
- drawValue: false,
- onChange: ({ value }) => Audio.speaker.volume = value,
- connections: [[Audio, self => {
- self.value = Audio.speaker?.volume || 0;
- }, 'speaker-changed']],
- }),
- ],
-});
-
-const BatteryLabel = () => Widget.Box({
- className: 'battery',
- children: [
- Widget.Icon({
- connections: [[Battery, self => {
- self.icon = `battery-level-${Math.floor(Battery.percent / 10) * 10}-symbolic`;
- }]],
- }),
- Widget.ProgressBar({
- vpack: 'center',
- connections: [[Battery, self => {
- if (Battery.percent < 0)
- return;
-
- self.fraction = Battery.percent / 100;
- }]],
- }),
- ],
-});
-
-const SysTray = () => Widget.Box({
- connections: [[SystemTray, self => {
- self.children = SystemTray.items.map(item => Widget.Button({
- child: Widget.Icon({ binds: [['icon', item, 'icon']] }),
- onPrimaryClick: (_, event) => item.activate(event),
- onSecondaryClick: (_, event) => item.openMenu(event),
- binds: [['tooltip-markup', item, 'tooltip-markup']],
- }));
- }]],
-});
-
-// layout of the bar
-const Left = () => Widget.Box({
- children: [
- Workspaces(),
- ClientTitle(),
- ],
-});
-
-const Center = () => Widget.Box({
- children: [
- Media(),
- Notification(),
- ],
-});
-
-const Right = () => Widget.Box({
- hpack: 'end',
- children: [
- Volume(),
- BatteryLabel(),
- Clock(),
- SysTray(),
- ],
-});
-
-const Bar = ({ monitor } = {}) => Widget.Window({
- name: `bar-${monitor}`, // name has to be unique
- className: 'bar',
- monitor,
- anchor: ['top', 'left', 'right'],
- exclusive: true,
- child: Widget.CenterBox({
- startWidget: Left(),
- centerWidget: Center(),
- endWidget: Right(),
- }),
-})
-
-// exporting the config so ags can manage the windows
-export default {
- style: App.configDir + '/style.css',
- windows: [
- Bar(),
-
- // you can call it, for each monitor
- // Bar({ monitor: 0 }),
- // Bar({ monitor: 1 })
- ],
-};
diff --git a/home-manager/programs/ags/bar/style.css b/home-manager/programs/ags/bar/style.css
deleted file mode 100644
index 900d84f..0000000
--- a/home-manager/programs/ags/bar/style.css
+++ /dev/null
@@ -1,26 +0,0 @@
-* {
- font-family: Material Design Icons, Rubik Medium;
- font-size: 14px;
- color: #6e6a86;
-}
-
-.window {
- border-radius: 10px;
- background: #1f1d2e;
- border: 3px solid #363a4f;
-}
-
-.battery {
- margin-right: 6px;
-}
-
-.workspaces button {
- font-size: 15px;
- transition: all 100ms ease-out;
-}
-
-.workspaces button:active {
- font-weight: bolder;
- color: #908caa;
- transition: all 100ms ease-out;
-}
diff --git a/home-manager/programs/ags/default.nix b/home-manager/programs/ags/default.nix
deleted file mode 100644
index dbb8228..0000000
--- a/home-manager/programs/ags/default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ pkgs, ... }:
-
-{
- programs.ags = {
- enable = true;
- configDir = ./bar;
- };
-}
diff --git a/home-manager/programs/alacritty/default.nix b/home-manager/programs/alacritty/default.nix
deleted file mode 100644
index 930952d..0000000
--- a/home-manager/programs/alacritty/default.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ pkgs, ... }:
-
-{
- home.packages = [ pkgs.alacritty-theme ];
- programs.alacritty = {
- enable = true;
- settings = {
- import = [ "${pkgs.alacritty-theme}/catppuccin_macchiato.yaml" ];
- font = {
- normal = {
- family = "Source Code Pro";
- style = "Medium";
- };
- size = 11.5;
- };
- window.opacity = 0.7;
- cursor = {
- style = "Beam";
- thickness = 0.27;
- };
- };
- };
-}
diff --git a/home-manager/programs/default.nix b/home-manager/programs/default.nix
deleted file mode 100644
index 0381598..0000000
--- a/home-manager/programs/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-[
- ./fish
- ./firefox
- ./rofi
- ./emacs
- ./ranger
- ./waybar
- ./ags
- ./alacritty
- ./kitty
-]
diff --git a/home-manager/programs/default.nix~ b/home-manager/programs/default.nix~
deleted file mode 100644
index c904e18..0000000
--- a/home-manager/programs/default.nix~
+++ /dev/null
@@ -1,28 +0,0 @@
-let
- more = { pkgs, ... }: {
- programs = {
- kitty = {
- enable = true;
- font.name = "Source Code Pro";
- font.size = 11.3;
- theme = "Rosé Pine Moon";
- shellIntegration.enableFishIntegration = true;
- extraConfig = "cursor_shape underline";
- };
- };
- };
- progConfig = { config, ... }: "${config.home.homeDirectory}/.nixfiles/home-manager/home/programs/";
- nonNixConfigs = { config, ... }: {
- xdg.configFile = {
- "ranger".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.nixfiles/home-manager/home/programs/ranger";
- "emacs/init.el".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.nixfiles/home-manager/home/programs/emacs/init.el";
- };
- };
-in
-[
- ./fish
- ./firefox
- ./rofi
- more
- nonNixConfigs
-]
diff --git a/home-manager/programs/emacs/config.org b/home-manager/programs/emacs/config.org
deleted file mode 100644
index 3370e88..0000000
--- a/home-manager/programs/emacs/config.org
+++ /dev/null
@@ -1,882 +0,0 @@
-#+Title: spl3g's Emacs config
-#+AUTHOR: spl3g
-#+STARTUP: showeverything
-#+PROPERTY: header-args :tangle init.el
-#+OPTIONS: toc:2
-#+auto_tangle: t
-
-* Table Of Contents :toc:
-- [[#progs-to-load-first][Progs to load first]]
- - [[#optimise-gc][Optimise gc]]
- - [[#use-package][use-package]]
- - [[#save-history][Save history]]
- - [[#meow-mode][Meow mode]]
- - [[#general-keybindings][General keybindings]]
-- [[#gui-tweaks][GUI tweaks]]
- - [[#disable-gui-shit][Disable gui shit]]
- - [[#fonts][Fonts]]
- - [[#display-line-numbers][Display line numbers]]
- - [[#theme][Theme]]
- - [[#icons][Icons]]
- - [[#modeline][Modeline]]
- - [[#smooth-scroll][Smooth scroll]]
- - [[#dashboard][Dashboard]]
- - [[#disable-ring-bell][Disable ring-bell]]
- - [[#indent-guide][Indent guide]]
- - [[#misc][Misc]]
-- [[#org-mode][Org mode]]
- - [[#enabling-toc][Enabling toc]]
- - [[#org-bullets][Org bullets]]
- - [[#auto-tangle][Auto-tangle]]
- - [[#org-download][Org-download]]
- - [[#direnv][Direnv]]
-- [[#better-ux][Better UX]]
- - [[#vertico][Vertico]]
- - [[#consult][Consult]]
- - [[#pairs][Pairs]]
- - [[#debugging][Debugging]]
- - [[#move-lines][Move lines]]
- - [[#truncate-lines][Truncate lines]]
- - [[#no-littering][No littering]]
- - [[#rainbow-delimiters][Rainbow delimiters]]
- - [[#crux][Crux]]
-- [[#eat-terminal][Eat terminal]]
- - [[#eat][Eat]]
- - [[#eat-toggle][Eat-toggle]]
- - [[#eat-modes][Eat modes]]
-- [[#lsp][LSP]]
- - [[#languages][Languages]]
- - [[#corfu][Corfu]]
- - [[#flycheck][Flycheck]]
- - [[#tree-sitter][Tree-sitter]]
- - [[#snippets][Snippets]]
-- [[#dired][Dired]]
- - [[#bindings][Bindings]]
-- [[#additional-apps][Additional apps]]
- - [[#telegram-lol][Telegram lol]]
- - [[#magit][Magit]]
- - [[#exwm][EXWM]]
- - [[#jupyter][Jupyter]]
- - [[#orgnote][Orgnote]]
- - [[#codeium][Codeium]]
-- [[#runtime-performance][Runtime Performance]]
-
-* Progs to load first
-** Optimise gc
-#+begin_src emacs-lisp
- (setq gc-cons-threshold (* 50 1000 1000))
-#+end_src
-** use-package
-#+begin_src emacs-lisp
- (require 'use-package)
- (eval-and-compile
- (setq use-package-always-ensure t
- use-package-expand-minimally t))
-#+end_src
-** Save history
-#+begin_src emacs-lisp
- (savehist-mode 1)
-#+end_src
-** Meow mode
-#+begin_src emacs-lisp
- (use-package meow
- :config
- (defun meow-setup ()
- (setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty)
- (meow-motion-overwrite-define-key
- '("j" . meow-next)
- '("k" . meow-prev)
- '("<escape>" . ignore))
- (meow-leader-define-key
- ;; SPC j/k will run the original command in MOTION state.
- '("j" . "H-j")
- '("k" . "H-k")
- ;; Use SPC (0-9) for digit arguments.
- '("1" . meow-digit-argument)
- '("2" . meow-digit-argument)
- '("3" . meow-digit-argument)
- '("4" . meow-digit-argument)
- '("5" . meow-digit-argument)
- '("6" . meow-digit-argument)
- '("7" . meow-digit-argument)
- '("8" . meow-digit-argument)
- '("9" . meow-digit-argument)
- '("0" . meow-digit-argument)
- '("/" . meow-keypad-describe-key)
- '("?" . meow-cheatsheet)
- '("bk" . kill-this-buffer))
- (meow-normal-define-key
- '("0" . meow-expand-0)
- '("9" . meow-expand-9)
- '("8" . meow-expand-8)
- '("7" . meow-expand-7)
- '("6" . meow-expand-6)
- '("5" . meow-expand-5)
- '("4" . meow-expand-4)
- '("3" . meow-expand-3)
- '("2" . meow-expand-2)
- '("1" . meow-expand-1)
- '("-" . negative-argument)
- '(";" . meow-reverse)
- '("," . meow-inner-of-thing)
- '("." . meow-bounds-of-thing)
- '("[" . meow-beginning-of-thing)
- '("]" . meow-end-of-thing)
- '("a" . meow-append)
- '("A" . meow-open-below)
- '("b" . meow-back-word)
- '("B" . meow-back-symbol)
- '("c" . meow-change)
- '("d" . meow-delete)
- '("D" . meow-backward-delete)
- '("e" . meow-next-word)
- '("E" . meow-next-symbol)
- '("f" . meow-find)
- '("g" . meow-cancel-selection)
- '("G" . meow-grab)
- '("h" . meow-left)
- '("H" . meow-left-expand)
- '("i" . meow-insert)
- '("I" . meow-open-above)
- '("j" . meow-next)
- '("J" . meow-next-expand)
- '("k" . meow-prev)
- '("K" . meow-prev-expand)
- '("l" . meow-right)
- '("L" . meow-right-expand)
- '("m" . meow-join)
- '("n" . meow-search)
- '("o" . meow-block)
- '("O" . meow-to-block)
- '("p" . meow-yank)
- '("q" . meow-quit)
- '("Q" . meow-goto-line)
- '("r" . meow-replace)
- '("R" . meow-swap-grab)
- '("s" . meow-kill)
- '("t" . meow-till)
- '("u" . meow-undo)
- '("U" . meow-undo-in-selection)
- '("v" . meow-visit)
- '("w" . meow-mark-word)
- '("W" . meow-mark-symbol)
- '("x" . meow-line)
- '("X" . meow-goto-line)
- '("y" . meow-save)
- '("Y" . meow-sync-grab)
- '("z" . meow-pop-selection)
- '("'" . repeat)
- '("<escape>" . ignore)))
- (setq meow-use-enhanced-selection-effect t)
- (meow-setup)
- (meow-global-mode 1))
-#+end_src
-** General keybindings
-#+begin_src emacs-lisp
- (use-package general
- :config
- ;; SPC as the global leader key
- (general-create-definer spl3g/leader-keys
- :prefix "C-c")
-
- (spl3g/leader-keys
- ;; Buffers
- "b" '(:ignore t :wk "Buffer")
- "bi" '(ibuffer :wk "ibuffer")
- "bk" '(kill-this-buffer :wk "Kill this buffer")
- "bn" '(next-buffer :wk "Next buffer")
- "bp" '(previous-buffer :wk "Previous buffer")
- "br" '(revert-buffer :wk "Reload buffer")
- "," '(consult-buffer :wk "Switch to buffer")
- "." '(find-file :wk "Find file")
- ;; Splits
- "w" '(:ignore t :wk "Splits")
- "wv" '(split-window-right :wk "Split vertical")
- "ws" '(split-window-below :wk "Split")
- "ww" '(other-window :wk "Cycle throug windows")
- "wc" '(delete-window :wk "Close window")
- "wd" '(delete-window :wk "Close window")
- "wl" '(evil-window-right :wk "")
- "wj" '(evil-window-down :wk "")
- "wk" '(evil-window-up :wk "")
- "wh" '(evil-window-left :wk "")
- "wo" '(delete-other-windows :wk "")
- ;; Files
- "f" '(:ignore t :wk "Files")
- "fr" '(consult-recent-file :wk "Resent files")
- "fc" '((lambda () (interactive) (find-file "~/.nixfiles/home-manager/programs/emacs/config.org")) :wk "Edit emacs config")
- "fu" '(sudo-edit-find-file :wk "Sudo find file")
- "fU" '(sudo-edit :wk "Sudo edit file")
- ;; Opening.. things
- "o" '(:ignore t)
- "ot" '(eat-toggle :wk "Eat terminal")
- "om" '(magit-status :wk "Magit")))
-
-#+end_src
-* GUI tweaks
-** Disable gui shit
-#+begin_src emacs-lisp
- (defun spl3g/disable-scroll-bars (frame)
- (modify-frame-parameters frame
- '((vertical-scroll-bars . nil)
- (horizontal-scroll-bars . nil))))
- (add-hook 'after-make-frame-functions 'spl3g/disable-scroll-bars)
-#+end_src
-** Fonts
-#+begin_src emacs-lisp
- (setq default-frame-alist '((font . "Source Code Pro")))
- (set-face-attribute 'default nil
- :font "Source Code Pro"
- :height 110
- :weight 'medium)
- (set-face-attribute 'fixed-pitch nil
- :font "Source Code Pro"
- :height 110
- :weight 'medium)
- (set-face-attribute 'variable-pitch nil
- :font "Rubik"
- :height 110
- :weight 'medium)
- (set-face-attribute 'font-lock-comment-face nil
- :slant 'italic)
- (set-face-attribute 'font-lock-keyword-face nil
- :weight 'bold)
-#+end_src
-** Display line numbers
-#+begin_src emacs-lisp
-(add-hook 'prog-mode-hook 'display-line-numbers-mode)
-(visual-line-mode 1)
-#+end_src
-
-** Theme
-#+begin_src emacs-lisp
-(use-package catppuccin-theme
- :ensure t
- :config
- (load-theme 'catppuccin t)
- (setq catppuccin-flavor 'macchiato)
- (catppuccin-reload))
-#+end_src
-
-** Icons
-#+begin_src emacs-lisp
- (use-package all-the-icons
- :ensure t
- :if (display-graphic-p))
-#+end_src
-** Modeline
-#+begin_src emacs-lisp
- (use-package mood-line
-
- ;; Enable mood-line
- :config
- (mood-line-mode)
- :custom
- (mood-line-meow-state-alist
- '((normal "N" . mood-line-meow-normal)
- (insert "I" . mood-line-meow-insert)
- (keypad "K" . mood-line-meow-keypad)
- (beacon "B" . mood-line-meow-beacon)
- (motion "M" . mood-line-meow-motion)))
- (mood-line-glyph-alist mood-line-glyphs-fira-code)
- :custom-face
- (mood-line-meow-beacon ((t (:foreground "#f9e2af" :weight bold))))
- (mood-line-meow-insert ((t (:foreground "#a6e3a1" :weight bold))))
- (mood-line-meow-keypad ((t (:foreground "#cba6f7" :weight bold))))
- (mood-line-meow-motion ((t (:foreground "#fab387" :weight bold))))
- (mood-line-meow-normal ((t (:weight bold))))
- (mode-line-inactive ((t (:box (:line-width (2 . 6) :color "#11111b") :inverse-video nil :foreground "#6c7086" :background "#11111b"))))
- (mode-line ((t (:box (:line-width (2 . 6) :color "#181825") :background "#181825")))))
-#+end_src
-
-** Smooth scroll
-#+begin_src emacs-lisp
- (use-package good-scroll
- :init (good-scroll-mode))
-#+end_src
-
-** Dashboard
-#+begin_src emacs-lisp
- (use-package dashboard
- :init
- (dashboard-setup-startup-hook)
- :config
- (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
- (setq dashboard-banner-logo-title "Yep, it's emacs, not vim")
- (setq dashboard-startup-banner 'logo)
- (setq dashboard-center-content t)
- (add-to-list 'dashboard-item-generators '(config . dashboard-open-config))
- (setq dashboard-items '((recents . 5)
- (agenda . 5))))
-#+end_src
-** Disable ring-bell
-#+begin_src emacs-lisp
- (setq ring-bell-function 'ignore)
-#+end_src
-** Indent guide
-#+begin_src emacs-lisp
- (use-package indent-guide
- :hook (prog-mode . indent-guide-mode))
-#+end_src
-** Misc
-#+begin_src emacs-lisp
- (setq window-resize-pixelwise t)
- (setq frame-resize-pixelwise t)
- (save-place-mode t)
- (defalias 'yes-or-no #'y-or-n-p)
-#+end_src
-* Org mode
-#+begin_src emacs-lisp
- (add-hook 'org-mode-hook 'org-indent-mode)
- (require 'org-tempo)
-#+end_src
-
-** Enabling toc
-#+begin_src emacs-lisp
- (use-package toc-org
- :hook (org-mode-hook . toc-org-mode))
-#+end_src
-
-** Org bullets
-#+begin_src emacs-lisp
- (use-package org-bullets
- :hook (org-mode-hook . (lambda () (org-bullets-mode 1))))
-#+end_src
-** Auto-tangle
-#+begin_src emacs-lisp
- (use-package org-auto-tangle
- :config
- (add-hook 'org-mode-hook 'org-auto-tangle-mode))
-#+end_src
-** Org-download
-#+begin_src emacs-lisp
- ;; (use-package org-download
- ;; :hook
- ;; (dired-mode-hook . org-download-enable))
-#+end_src
-** Direnv
-#+begin_src emacs-lisp
- (use-package direnv
- :config
- (direnv-mode))
-#+end_src
-* Better UX
-** Vertico
-#+begin_src emacs-lisp
- (use-package vertico
- :init
- (vertico-mode)
- :bind (:map vertico-map
- ("M-j" . vertico-next)
- ("M-k" . vertico-previous)
- ("RET" . vertico-directory-enter)
- ("DEL" . vertico-directory-delete-char)
- ("M-DEL" . vertico-directory-delete-word)))
-
- (use-package emacs
- :init
- ;; Add prompt indicator to `completing-read-multiple'.
- ;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
- (defun crm-indicator (args)
- (cons (format "[CRM%s] %s"
- (replace-regexp-in-string
- "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
- crm-separator)
- (car args))
- (cdr args)))
- (advice-add #'completing-read-multiple :filter-args #'crm-indicator)
-
- ;; Do not allow the cursor in the minibuffer prompt
- (setq minibuffer-prompt-properties
- '(read-only t cursor-intangible t face minibuffer-prompt))
- (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
-
- ;; Emacs 28: Hide commands in M-x which do not work in the current mode.
- ;; Vertico commands are hidden in normal buffers.
- ;; (setq read-extended-command-predicate
- ;; #'command-completion-default-include-p)
-
- ;; Enable recursive minibuffers
- (setq enable-recursive-minibuffers t))
-#+end_src
-*** Ordeless
-#+begin_src emacs-lisp
- (use-package orderless
- :init
- (setq completion-styles '(orderless basic)
- completion-category-defaults nil
- completion-category-overrides '((file (styles partial-completion)))))
-#+end_src
-*** Marginalia
-#+begin_src emacs-lisp
- (use-package marginalia
- :bind (:map minibuffer-local-map
- ("M-A" . marginalia-cycle))
- :init
- (marginalia-mode))
-#+end_src
-** Consult
-#+begin_src emacs-lisp
- (use-package consult
- ;; Replace bindings. Lazily loaded due by `use-package'.
- :bind (;; C-c bindings in `mode-specific-map'
- ("C-c k" . consult-kmacro)
- ("C-c m" . consult-man)
- ("C-c i" . consult-info)
- ([remap Info-search] . consult-info)
- ;; C-x bindings in `ctl-x-map'
- ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
- ("C-x b" . consult-buffer) ;; orig. switch-to-buffer
- ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
- ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
- ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
- ;; Custom M-# bindings for fast register access
- ("M-#" . consult-register-load)
- ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
- ("C-M-#" . consult-register)
- ;; Other custom bindings
- ("M-y" . consult-yank-pop) ;; orig. yank-pop
- ;; M-g bindings in `goto-map'
- ("M-g e" . consult-compile-error)
- ("M-g f" . consult-flycheck) ;; Alternative: consult-flycheck
- ("M-g g" . consult-goto-line) ;; orig. goto-line
- ("M-g M-g" . consult-goto-line) ;; orig. goto-line
- ("M-g o" . consult-outline) ;; Alternative: consult-org-heading
- ;; M-s bindings in `search-map'
- ("M-s d" . consult-fd)
- ("M-s g" . consult-grep)
- ("M-s G" . consult-git-grep)
- ("M-s l" . consult-line)
- ("M-s L" . consult-line-multi)
- ("M-s k" . consult-keep-lines)
- ("M-s u" . consult-focus-lines)
- ;; Isearch integration
- ("M-s e" . consult-isearch-history)
- :map isearch-mode-map
- ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
- ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
- ("M-s l" . consult-line) ;; needed by consult-line to detect isearch
- ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
- ;; Minibuffer history
- :map eshell-mode-map
- ("M-r" . consult-history))
-
- ;; Enable automatic preview at point in the *Completions* buffer. This is
- ;; relevant when you use the default completion UI.
- :hook (completion-list-mode . consult-preview-at-point-mode)
-
- ;; The :init configuration is always executed (Not lazy)
- :init
-
- ;; Optionally configure the register formatting. This improves the register
- ;; preview for `consult-register', `consult-register-load',
- ;; `consult-register-store' and the Emacs built-ins.
- (setq register-preview-delay 0.5
- register-preview-function #'consult-register-format)
-
- ;; Optionally tweak the register preview window.
- ;; This adds thin lines, sorting and hides the mode line of the window.
- (advice-add #'register-preview :override #'consult-register-window)
-
- ;; Configure other variables and modes in the :config section,
- ;; after lazily loading the package.
- :config
-
- ;; Optionally configure preview. The default value
- ;; is 'any, such that any key triggers the preview.
- ;; (setq consult-preview-key 'any)
- ;; (setq consult-preview-key "M-.")
- ;; (setq consult-preview-key '("S-<down>" "S-<up>"))
- ;; For some commands and buffer sources it is useful to configure the
- ;; :preview-key on a per-command basis using the `consult-customize' macro.
- (consult-customize
- consult-ripgrep consult-git-grep consult-grep
- consult-bookmark consult-recent-file consult-xref
- consult--source-bookmark consult--source-file-register
- consult--source-recent-file consult--source-project-recent-file)
- ;; :preview-key "M-."
-
- ;; Optionally configure the narrowing key.
- ;; Both < and C-+ work reasonably well.
- (setq consult-narrow-key "<") ;; "C-+"
-
- ;; Optionally make narrowing help available in the minibuffer.
- ;; You may want to use `embark-prefix-help-command' or which-key instead.
- ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help)
-
- ;; By default `consult-project-function' uses `project-root' from project.el.
- ;; Optionally configure a different project root function.
- ;;;; 1. project.el (the default)
- ;; (setq consult-project-function #'consult--default-project--function)
- ;;;; 2. vc.el (vc-root-dir)
- ;; (setq consult-project-function (lambda (_) (vc-root-dir)))
- ;;;; 3. locate-dominating-file
- ;; (setq consult-project-function (lambda (_) (locate-dominating-file "." ".git")))
- ;;;; 4. projectile.el (projectile-project-root)
- ;; (autoload 'projectile-project-root "projectile")
- ;; (setq consult-project-function (lambda (_) (projectile-project-root)))
- ;;;; 5. No project support
- ;; (setq consult-project-function nil)
- )
-#+end_src
-** Pairs
-#+begin_src emacs-lisp
- (use-package smartparens
- :init (smartparens-global-mode)
- :hook (prog-mode-hook . turn-on-smartparens-strict-mode)
- :config
- ;; Snitched from doom
- (let ((unless-list '(sp-point-before-word-p
- sp-point-after-word-p
- sp-point-before-same-p)))
- (sp-pair "'" nil :unless unless-list)
- (sp-pair "\"" nil :unless unless-list))
- (dolist (brace '("(" "{" "["))
- (sp-pair brace nil
- :post-handlers '(("||\n[i]" "RET") ("| " "SPC"))
- :unless '(sp-point-before-word-p sp-point-before-same-p)))
- (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p))
- (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p))
-
- ;; Major-mode specific fixes
- (sp-local-pair 'ruby-mode "{" "}"
- :pre-handlers '(:rem sp-ruby-pre-handler)
- :post-handlers '(:rem sp-ruby-post-handler))
-
- ;; Don't do square-bracket space-expansion where it doesn't make sense to
- (sp-local-pair '(emacs-lisp-mode org-mode markdown-mode gfm-mode)
- "[" nil :post-handlers '(:rem ("| " "SPC")))
-
- ;; Reasonable default pairs for HTML-style comments
- (sp-local-pair (append sp--html-modes '(markdown-mode gfm-mode))
- "<!--" "-->"
- :unless '(sp-point-before-word-p sp-point-before-same-p)
- :actions '(insert) :post-handlers '(("| " "SPC")))
- ;; Expand C-style comment blocks.
- (defun +default-open-doc-comments-block (&rest _ignored)
- (save-excursion
- (newline)
- (indent-according-to-mode)))
- (sp-local-pair
- '(js2-mode typescript-mode rjsx-mode rust-mode c-mode c++-mode objc-mode
- csharp-mode java-mode php-mode css-mode scss-mode less-css-mode
- stylus-mode scala-mode)
- "/*" "*/"
- :actions '(insert)
- :post-handlers '(("| " "SPC")
- (" | " "*")
- ("|[i]\n[i]" "RET"))))
-#+end_src
-
-** Debugging
-#+begin_src emacs-lisp
- ;; (use-package dap-mode
- ;; :defer t
- ;; :config
- ;; (require 'dap-python)
- ;; (setq dap-python-debugger 'debugpy))
-#+end_src
-** Move lines
-#+begin_src emacs-lisp
- (use-package move-text
- :bind (("C-M-k" . move-text-up)
- ("C-M-j" . move-text-down)))
-#+end_src
-** Truncate lines
-#+begin_src emacs-lisp
- (global-visual-line-mode t)
-#+end_src
-** No littering
-#+begin_src emacs-lisp
- (use-package no-littering)
-#+end_src
-** Rainbow delimiters
-#+begin_src emacs-lisp
- (use-package rainbow-delimiters
- :hook (prog-mode . rainbow-delimiters-mode))
-#+end_src
-** Crux
-#+begin_src emacs-lisp
- (use-package crux)
-#+end_src
-* Eat terminal
-** Eat
-#+begin_src emacs-lisp
- (use-package eat
- :custom
- (eat-enable-auto-line-mode t))
-#+end_src
-** Eat-toggle
-#+begin_src emacs-lisp
- (defun eat-toggle()
- "Open eat terminal as a popup."
- (interactive)
- (if (eq major-mode 'eat-mode)
- (delete-window)
- (let ((buff (get-buffer-create eat-buffer-name)))
- (cl-assert (and buff (buffer-live-p buff)))
- (funcall #'pop-to-buffer buff)
- (with-current-buffer buff
- (setq-local split-width-threshold nil)
- (setq-local window-min-height 2)
- (unless (derived-mode-p 'eat-mode)
- (eat))))))
-#+end_src
-** Eat modes
-#+begin_src emacs-lisp
- ;; (defun eat-modes()
- ;; (cond
- ;; ((and (eq major-mode 'eat-mode) (member 'meow-normal-mode local-minor-modes))
- ;; (eat-emacs-mode))
- ;; ((and (eq major-mode 'eat-mode) (member 'meow-insert-mode local-minor-modes))
- ;; (eat-semi-char-mode))))
- ;; (add-hook 'meow-normal-mode-hook #'eat-modes)
- ;; (add-hook 'meow-insert-mode-hook #'eat-modes)
-#+end_src
-** Fish completion
-#+begin_src emacs-lisp
- (use-package fish-completion
- :config
- (global-fish-completion-mode))
-#+end_src
-** Eshell
-#+begin_src emacs-lisp
-#+end_src
-* LSP
-#+begin_src emacs-lisp
- (use-package lsp-mode
- :custom
- (lsp-completion-provider :none) ;; we use Corfu!
-
- :init
- (defun my/orderless-dispatch-flex-first (_pattern index _total)
- (and (eq index 0) 'orderless-flex))
-
- (defun my/lsp-mode-setup-completion ()
- (setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
- '(orderless)))
-
- ;; Optionally configure the first word as flex filtered.
- (add-hook 'orderless-style-dispatchers #'my/orderless-dispatch-flex-first nil 'local)
-
- ;; Optionally configure the cape-capf-buster.
-
- :hook
- (rust-mode-hook . lsp)
- (lsp-mode-hook . (lambda ()
- (setq-local completion-at-point-functions (list (cape-capf-buster #'lsp-completion-at-point)))))
- (lsp-completion-mode . my/lsp-mode-setup-completion))
-#+end_src
-** Languages
-*** Python
-#+begin_src emacs-lisp
- (use-package lsp-pyright
- :hook (python-mode . (lambda ()
- (require 'lsp-pyright)
- (lsp))))
- (use-package py-autopep8
- :hook (python-mode . py-autopep8-mode))
-#+end_src
-*** Rust
-#+begin_src emacs-lisp
- (use-package rust-mode
- :mode "\\.rs\\'")
- (use-package flycheck-rust
- :config
- (with-eval-after-load 'rust-mode
- (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)))
-#+end_src
-*** Fish
-#+begin_src emacs-lisp
- (use-package fish-mode
- :mode "\\.fish\\'")
-#+end_src
-*** Nix
-#+begin_src emacs-lisp
- (use-package nix-mode
- :mode ("\\.nix\\'" "\\.nix.in\\'"))
- (use-package nix-drv-mode
- :ensure nix-mode
- :mode "\\.drv\\'")
- (use-package nix-shell
- :ensure nix-mode
- :commands (nix-shell-unpack nix-shell-configure nix-shell-build))
- (use-package nix-repl
- :ensure nix-mode
- :commands (nix-repl))
-#+end_src
-*** Web
-#+begin_src emacs-lisp
- (use-package web-mode
- :mode
- ("\\.phtml\\'"
- "\\.tpl\\.php\\'"
- "\\.[agj]sp\\'"
- "\\.as[cp]x\\'"
- "\\.erb\\'"
- "\\.mustache\\'"
- "\\.djhtml\\'"))
-#+end_src
-*** JavaScript
-#+begin_src emacs-lisp
- (use-package js2-mode)
-#+end_src
-** Corfu
-#+begin_src emacs-lisp
- (use-package corfu
- :custom
- (corfu-cycle t)
- (corfu-preselect 'prompt)
- (corfu-auto t)
- (corfu-popupinfo-delay 0.0)
- :bind
- (:map corfu-map
- ("TAB" . corfu-next)
- ([tab] . corfu-next)
- ("S-TAB" . corfu-previous)
- ([backtab] . corfu-previous))
-
- :init
- (global-corfu-mode)
- (corfu-history-mode)
- (corfu-popupinfo-mode)
- :config
- (add-to-list 'savehist-additional-variables 'corfu-history))
- (use-package emacs
- :init
- (setq completion-cycle-threshold 3)
-
- (setq read-extended-command-predicate
- #'command-completion-default-include-p)
-
- (setq tab-always-indent 'complete))
-#+end_src
-*** Cape
-#+begin_src emacs-lisp
- (use-package cape
- ;; Bind dedicated completion commands
- ;; :bind (("C-c p p" . completion-at-point) ;; capf
- ;; ("C-c p t" . complete-tag) ;; etags
- ;; ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion
- ;; ("C-c p h" . cape-history)
- ;; ("C-c p f" . cape-file)
- ;; ("C-c p k" . cape-keyword)
- ;; ("C-c p s" . cape-elisp-symbol)
- ;; ("C-c p e" . cape-elisp-block)
- ;; ("C-c p a" . cape-abbrev)
- ;; ("C-c p l" . cape-line)
- ;; ("C-c p w" . cape-dict)
- ;; ("C-c p :" . cape-emoji))
- :config
- (add-to-list 'completion-at-point-functions #'cape-dabbrev)
- (add-to-list 'completion-at-point-functions #'cape-file)
- (add-to-list 'completion-at-point-functions #'cape-elisp-block)
- )
-#+end_src
-** Flycheck
-#+begin_src emacs-lisp
- (use-package flycheck
- :init (global-flycheck-mode))
-#+end_src
-** Tree-sitter
-#+begin_src emacs-lisp
- (use-package tree-sitter
- :init
- (global-tree-sitter-mode)
- :config
- (add-hook 'tree-sitter-mode-hook 'tree-sitter-hl-mode))
-#+end_src
-*** Additional langs
-#+begin_src emacs-lisp
- (use-package tree-sitter-langs)
-#+end_src
-** Snippets
-#+begin_src emacs-lisp
- ;; (use-package yasnippet
- ;; :init (yas-global-mode))
- ;; (use-package yasnippet-snippets)
-#+end_src
-* Dired
-** Bindings
-#+begin_src emacs-lisp
- (use-package dirvish
- :init
- (dirvish-override-dired-mode)
- :custom
- (dired-listing-switches "-Al --group-directories-first")
- :bind (:map dired-mode-map
- ("h" . 'dired-up-directory)
- ("l" . 'dired-find-file)
- ("v" . 'meow-visit)))
-#+end_src
-* Additional apps
-** Telegram lol
-#+begin_src emacs-lisp
- ;; (add-to-list 'load-path "~/telega.el")
- ;; (require 'telega)
-#+end_src
-** Magit
-#+begin_src emacs-lisp
- (use-package magit)
-#+end_src
-** EXWM
-#+begin_src emacs-lisp
- ;; (use-package exwm)
- ;; (require 'exwm)
- ;; (require 'exwm-config)
- ;; (exwm-config-example)
-#+end_src
-** Jupyter
-#+begin_src emacs-lisp
- ;; (use-package code-cells)
-#+end_src
-** Orgnote
-#+begin_src emacs-lisp
- ;; (use-package orgnote
- ;; :defer t)
-#+end_src
-** Codeium
-#+begin_src emacs-lisp
- ;; (use-package codeium
- ;; :init
- ;; ;; use globally
- ;; (add-to-list 'completion-at-point-functions #'codeium-completion-at-point)
- ;; :config
- ;; (setq use-dialog-box nil) ;; do not use popup boxes
-
- ;; ;; if you don't want to use customize to save the api-key
- ;; ;; (setq codeium/metadata/api_key "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
-
- ;; ;; get codeium status in the modeline
- ;; (setq codeium-mode-line-enable
- ;; (lambda (api) (not (memq api '(CancelRequest Heartbeat AcceptCompletion)))))
- ;; (add-to-list 'mode-line-format '(:eval (car-safe codeium-mode-line)) t)
- ;; ;; alternatively for a more extensive mode-line
- ;; ;; (add-to-list 'mode-line-format '(-50 "" codeium-mode-line) t)
-
- ;; ;; use M-x codeium-diagnose to see apis/fields that would be sent to the local language server
- ;; (setq codeium-api-enabled
- ;; (lambda (api)
- ;; (memq api '(GetCompletions Heartbeat CancelRequest GetAuthToken RegisterUser auth-redirect AcceptCompletion))))
- ;; ;; you can also set a config for a single buffer like this:
- ;; ;; (add-hook 'python-mode-hook
- ;; ;; (lambda ()
- ;; ;; (setq-local codeium/editor_options/tab_size 4)))
-
- ;; ;; You can overwrite all the codeium configs!
- ;; ;; for example, we recommend limiting the string sent to codeium for better performance
- ;; (defun my-codeium/document/text ()
- ;; (buffer-substring-no-properties (max (- (point) 3000) (point-min)) (min (+ (point) 1000) (point-max))))
- ;; ;; if you change the text, you should also change the cursor_offset
- ;; ;; warning: this is measured by UTF-8 encoded bytes
- ;; (defun my-codeium/document/cursor_offset ()
- ;; (codeium-utf8-byte-length
- ;; (buffer-substring-no-properties (max (- (point) 3000) (point-min)) (point))))
- ;; (setq codeium/document/text 'my-codeium/document/text)
- ;; (setq codeium/document/cursor_offset 'my-codeium/document/cursor_offset))
-#+end_src
-* Runtime Performance
-#+begin_src emacs-lisp
- (setq gc-cons-threshold (* 2 1000 1000))
- (setq read-process-output-max (* 1024 1024))
-#+end_src
diff --git a/home-manager/programs/emacs/default.nix b/home-manager/programs/emacs/default.nix
deleted file mode 100644
index 27688fa..0000000
--- a/home-manager/programs/emacs/default.nix
+++ /dev/null
@@ -1,99 +0,0 @@
-{ pkgs, ... }:
-let
- pkgsForEmacs = with pkgs; [
- tree-sitter
- gcc
- cmake
- nodePackages_latest.bash-language-server
- gnumake
- tdlib
- emacs-all-the-icons-fonts
- libappindicator
- libwebp
- tgs2png
- pkg-config
- ffmpeg_6-full
- rustc
- cargo
- rust-analyzer
- nodejs_20
- ];
- pythonPkgs = with pkgs.python311Packages; [
- flake8
- python-lsp-server
- autopep8
- matplotlib
- ];
-
- pkgsUsePackage = with pkgs; [
- (pkgs.emacsWithPackagesFromUsePackage {
- package = pkgs.emacs29-pgtk;
- config = ./init.el;
- alwaysEnsure = true;
- extraEmacsPackages = epkgs: [
- epkgs.use-package
- (epkgs.melpaBuild rec {
- pname = "codeium";
- version = "1.2.102";
-
- src = fetchFromGitHub {
- owner = "Exafunction";
- repo = "codeium.el";
- rev = "1.4.4";
- sha256 = "1jjix7fn73ihjnhfivf72wris72f4kwf7xb6k5hxs41fm4kr9hdd";
- };
-
- commit = "ddc9927ea231ecc5a32f7c9905f92fdfb7912e75";
-
- recipe = writeText "recipe" ''
- (codeium
- :repo "${src.owner}/${src.repo}"
- :fetcher github)
- '';
- })
- (epkgs.melpaBuild rec {
- pname = "telega";
- version = "0.8.216";
- src = fetchFromGitHub {
- owner = "zevlg";
- repo = "telega.el";
- rev = "3899aa8648b9e6deddbb34a2a817ca18acb9d97a";
- sha256 = "05xrm86gp185mgwb62w720hcbn87salk8z0whq6zf2r2f24l6xbw";
- };
- commit = "3899aa8648b9e6deddbb34a2a817ca18acb9d97a";
- recipe = writeText "recipe" ''
- (telega :fetcher github
- :repo "zevlg/telega.el"
- :files (:defaults "etc" "server" "contrib" "Makefile"))
- '';
- })
- # (epkgs.melpaBuild rec {
- # pname = "orgnote";
- # version = "0.7.17";
-
- # src = fetchFromGitHub {
- # owner = "Artawower";
- # repo = "orgnote.el";
- # rev = "v${version}";
- # sha256 = "1lrj47h244z4dqq2wyhpww7p3b4sy6bayk8lwlka517lhbcdgh33";
- # };
-
- # commit = "ccc40cc346ebf5a6e6a55e3d4a147f0230337350";
-
- # recipe = writeText "recipe" ''
- # (orgnote
- # :repo "${src.owner}/${src.repo}"
- # :fetcher github)
- # '';
- # })
- ];
- })
- ];
-in
-{
- home.packages = pkgsForEmacs ++ pkgsUsePackage ++ pythonPkgs;
- xdg.configFile = {
- # "emacs/init.el".text = builtins.readFile ./init.el;
- "emacs/early-init.el".text = builtins.readFile ./early-init.el;
- };
-}
diff --git a/home-manager/programs/emacs/early-init.el b/home-manager/programs/emacs/early-init.el
deleted file mode 100644
index 6e306a1..0000000
--- a/home-manager/programs/emacs/early-init.el
+++ /dev/null
@@ -1,4 +0,0 @@
-(menu-bar-mode -1)
-(tool-bar-mode -1)
-(scroll-bar-mode -1)
-(setq-default pgtk-wait-for-event-timeout 0)
diff --git a/home-manager/programs/emacs/init.el b/home-manager/programs/emacs/init.el
deleted file mode 100644
index 1103b57..0000000
--- a/home-manager/programs/emacs/init.el
+++ /dev/null
@@ -1,690 +0,0 @@
-(setq gc-cons-threshold (* 50 1000 1000))
-
-(require 'use-package)
-(eval-and-compile
- (setq use-package-always-ensure t
- use-package-expand-minimally t))
-
-(savehist-mode 1)
-
-(use-package meow
- :config
- (defun meow-setup ()
- (setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty)
- (meow-motion-overwrite-define-key
- '("j" . meow-next)
- '("k" . meow-prev)
- '("<escape>" . ignore))
- (meow-leader-define-key
- ;; SPC j/k will run the original command in MOTION state.
- '("j" . "H-j")
- '("k" . "H-k")
- ;; Use SPC (0-9) for digit arguments.
- '("1" . meow-digit-argument)
- '("2" . meow-digit-argument)
- '("3" . meow-digit-argument)
- '("4" . meow-digit-argument)
- '("5" . meow-digit-argument)
- '("6" . meow-digit-argument)
- '("7" . meow-digit-argument)
- '("8" . meow-digit-argument)
- '("9" . meow-digit-argument)
- '("0" . meow-digit-argument)
- '("/" . meow-keypad-describe-key)
- '("?" . meow-cheatsheet)
- '("bk" . kill-this-buffer))
- (meow-normal-define-key
- '("0" . meow-expand-0)
- '("9" . meow-expand-9)
- '("8" . meow-expand-8)
- '("7" . meow-expand-7)
- '("6" . meow-expand-6)
- '("5" . meow-expand-5)
- '("4" . meow-expand-4)
- '("3" . meow-expand-3)
- '("2" . meow-expand-2)
- '("1" . meow-expand-1)
- '("-" . negative-argument)
- '(";" . meow-reverse)
- '("," . meow-inner-of-thing)
- '("." . meow-bounds-of-thing)
- '("[" . meow-beginning-of-thing)
- '("]" . meow-end-of-thing)
- '("a" . meow-append)
- '("A" . meow-open-below)
- '("b" . meow-back-word)
- '("B" . meow-back-symbol)
- '("c" . meow-change)
- '("d" . meow-delete)
- '("D" . meow-backward-delete)
- '("e" . meow-next-word)
- '("E" . meow-next-symbol)
- '("f" . meow-find)
- '("g" . meow-cancel-selection)
- '("G" . meow-grab)
- '("h" . meow-left)
- '("H" . meow-left-expand)
- '("i" . meow-insert)
- '("I" . meow-open-above)
- '("j" . meow-next)
- '("J" . meow-next-expand)
- '("k" . meow-prev)
- '("K" . meow-prev-expand)
- '("l" . meow-right)
- '("L" . meow-right-expand)
- '("m" . meow-join)
- '("n" . meow-search)
- '("o" . meow-block)
- '("O" . meow-to-block)
- '("p" . meow-yank)
- '("q" . meow-quit)
- '("Q" . meow-goto-line)
- '("r" . meow-replace)
- '("R" . meow-swap-grab)
- '("s" . meow-kill)
- '("t" . meow-till)
- '("u" . meow-undo)
- '("U" . meow-undo-in-selection)
- '("v" . meow-visit)
- '("w" . meow-mark-word)
- '("W" . meow-mark-symbol)
- '("x" . meow-line)
- '("X" . meow-goto-line)
- '("y" . meow-save)
- '("Y" . meow-sync-grab)
- '("z" . meow-pop-selection)
- '("'" . repeat)
- '("<escape>" . ignore)))
- (setq meow-use-enhanced-selection-effect t)
- (meow-setup)
- (meow-global-mode 1))
-
-(use-package general
- :config
- ;; SPC as the global leader key
- (general-create-definer spl3g/leader-keys
- :prefix "C-c")
-
- (spl3g/leader-keys
- ;; Buffers
- "b" '(:ignore t :wk "Buffer")
- "bi" '(ibuffer :wk "ibuffer")
- "bk" '(kill-this-buffer :wk "Kill this buffer")
- "bn" '(next-buffer :wk "Next buffer")
- "bp" '(previous-buffer :wk "Previous buffer")
- "br" '(revert-buffer :wk "Reload buffer")
- "," '(consult-buffer :wk "Switch to buffer")
- "." '(find-file :wk "Find file")
- ;; Splits
- "w" '(:ignore t :wk "Splits")
- "wv" '(split-window-right :wk "Split vertical")
- "ws" '(split-window-below :wk "Split")
- "ww" '(other-window :wk "Cycle throug windows")
- "wc" '(delete-window :wk "Close window")
- "wd" '(delete-window :wk "Close window")
- "wl" '(evil-window-right :wk "")
- "wj" '(evil-window-down :wk "")
- "wk" '(evil-window-up :wk "")
- "wh" '(evil-window-left :wk "")
- "wo" '(delete-other-windows :wk "")
- ;; Files
- "f" '(:ignore t :wk "Files")
- "fr" '(consult-recent-file :wk "Resent files")
- "fc" '((lambda () (interactive) (find-file "~/.nixfiles/home-manager/programs/emacs/config.org")) :wk "Edit emacs config")
- "fu" '(sudo-edit-find-file :wk "Sudo find file")
- "fU" '(sudo-edit :wk "Sudo edit file")
- ;; Opening.. things
- "o" '(:ignore t)
- "ot" '(eat-toggle :wk "Eat terminal")
- "om" '(magit-status :wk "Magit")))
-
-(defun spl3g/disable-scroll-bars (frame)
- (modify-frame-parameters frame
- '((vertical-scroll-bars . nil)
- (horizontal-scroll-bars . nil))))
-(add-hook 'after-make-frame-functions 'spl3g/disable-scroll-bars)
-
-(setq default-frame-alist '((font . "Source Code Pro")))
-(set-face-attribute 'default nil
- :font "Source Code Pro"
- :height 110
- :weight 'medium)
-(set-face-attribute 'fixed-pitch nil
- :font "Source Code Pro"
- :height 110
- :weight 'medium)
-(set-face-attribute 'variable-pitch nil
- :font "Rubik"
- :height 110
- :weight 'medium)
-(set-face-attribute 'font-lock-comment-face nil
- :slant 'italic)
-(set-face-attribute 'font-lock-keyword-face nil
- :weight 'bold)
-
-(add-hook 'prog-mode-hook 'display-line-numbers-mode)
-(visual-line-mode 1)
-
-(use-package catppuccin-theme
- :ensure t
- :config
- (load-theme 'catppuccin t)
- (setq catppuccin-flavor 'macchiato)
- (catppuccin-reload))
-
-(use-package all-the-icons
- :ensure t
- :if (display-graphic-p))
-
-(use-package mood-line
-
- ;; Enable mood-line
- :config
- (mood-line-mode)
- :custom
- (mood-line-meow-state-alist
- '((normal "N" . mood-line-meow-normal)
- (insert "I" . mood-line-meow-insert)
- (keypad "K" . mood-line-meow-keypad)
- (beacon "B" . mood-line-meow-beacon)
- (motion "M" . mood-line-meow-motion)))
- (mood-line-glyph-alist mood-line-glyphs-fira-code)
- :custom-face
- (mood-line-meow-beacon ((t (:foreground "#f9e2af" :weight bold))))
- (mood-line-meow-insert ((t (:foreground "#a6e3a1" :weight bold))))
- (mood-line-meow-keypad ((t (:foreground "#cba6f7" :weight bold))))
- (mood-line-meow-motion ((t (:foreground "#fab387" :weight bold))))
- (mood-line-meow-normal ((t (:weight bold))))
- (mode-line-inactive ((t (:box (:line-width (2 . 6) :color "#11111b") :inverse-video nil :foreground "#6c7086" :background "#11111b"))))
- (mode-line ((t (:box (:line-width (2 . 6) :color "#181825") :background "#181825")))))
-
-(use-package good-scroll
- :init (good-scroll-mode))
-
-(use-package dashboard
- :init
- (dashboard-setup-startup-hook)
- :config
- (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
- (setq dashboard-banner-logo-title "Yep, it's emacs, not vim")
- (setq dashboard-startup-banner 'logo)
- (setq dashboard-center-content t)
- (add-to-list 'dashboard-item-generators '(config . dashboard-open-config))
- (setq dashboard-items '((recents . 5)
- (agenda . 5))))
-
-(setq ring-bell-function 'ignore)
-
-(use-package indent-guide
- :hook (prog-mode . indent-guide-mode))
-
-(setq window-resize-pixelwise t)
-(setq frame-resize-pixelwise t)
-(save-place-mode t)
-(defalias 'yes-or-no #'y-or-n-p)
-
-(add-hook 'org-mode-hook 'org-indent-mode)
-(require 'org-tempo)
-
-(use-package toc-org
- :hook (org-mode-hook . toc-org-mode))
-
-(use-package org-bullets
- :hook (org-mode-hook . (lambda () (org-bullets-mode 1))))
-
-(use-package org-auto-tangle
- :config
- (add-hook 'org-mode-hook 'org-auto-tangle-mode))
-
-;; (use-package org-download
-;; :hook
-;; (dired-mode-hook . org-download-enable))
-
-(use-package direnv
- :config
- (direnv-mode))
-
-(use-package vertico
- :init
- (vertico-mode)
- :bind (:map vertico-map
- ("M-j" . vertico-next)
- ("M-k" . vertico-previous)
- ("RET" . vertico-directory-enter)
- ("DEL" . vertico-directory-delete-char)
- ("M-DEL" . vertico-directory-delete-word)))
-
-(use-package emacs
- :init
- ;; Add prompt indicator to `completing-read-multiple'.
- ;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
- (defun crm-indicator (args)
- (cons (format "[CRM%s] %s"
- (replace-regexp-in-string
- "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
- crm-separator)
- (car args))
- (cdr args)))
- (advice-add #'completing-read-multiple :filter-args #'crm-indicator)
-
- ;; Do not allow the cursor in the minibuffer prompt
- (setq minibuffer-prompt-properties
- '(read-only t cursor-intangible t face minibuffer-prompt))
- (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
-
- ;; Emacs 28: Hide commands in M-x which do not work in the current mode.
- ;; Vertico commands are hidden in normal buffers.
- ;; (setq read-extended-command-predicate
- ;; #'command-completion-default-include-p)
-
- ;; Enable recursive minibuffers
- (setq enable-recursive-minibuffers t))
-
-(use-package orderless
- :init
- (setq completion-styles '(orderless basic)
- completion-category-defaults nil
- completion-category-overrides '((file (styles partial-completion)))))
-
-(use-package marginalia
- :bind (:map minibuffer-local-map
- ("M-A" . marginalia-cycle))
- :init
- (marginalia-mode))
-
-(use-package consult
- ;; Replace bindings. Lazily loaded due by `use-package'.
- :bind (;; C-c bindings in `mode-specific-map'
- ("C-c k" . consult-kmacro)
- ("C-c m" . consult-man)
- ("C-c i" . consult-info)
- ([remap Info-search] . consult-info)
- ;; C-x bindings in `ctl-x-map'
- ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
- ("C-x b" . consult-buffer) ;; orig. switch-to-buffer
- ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
- ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
- ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
- ;; Custom M-# bindings for fast register access
- ("M-#" . consult-register-load)
- ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
- ("C-M-#" . consult-register)
- ;; Other custom bindings
- ("M-y" . consult-yank-pop) ;; orig. yank-pop
- ;; M-g bindings in `goto-map'
- ("M-g e" . consult-compile-error)
- ("M-g f" . consult-flycheck) ;; Alternative: consult-flycheck
- ("M-g g" . consult-goto-line) ;; orig. goto-line
- ("M-g M-g" . consult-goto-line) ;; orig. goto-line
- ("M-g o" . consult-outline) ;; Alternative: consult-org-heading
- ;; M-s bindings in `search-map'
- ("M-s d" . consult-fd)
- ("M-s g" . consult-grep)
- ("M-s G" . consult-git-grep)
- ("M-s l" . consult-line)
- ("M-s L" . consult-line-multi)
- ("M-s k" . consult-keep-lines)
- ("M-s u" . consult-focus-lines)
- ;; Isearch integration
- ("M-s e" . consult-isearch-history)
- :map isearch-mode-map
- ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
- ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
- ("M-s l" . consult-line) ;; needed by consult-line to detect isearch
- ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
- ;; Minibuffer history
- :map eshell-mode-map
- ("M-r" . consult-history))
-
- ;; Enable automatic preview at point in the *Completions* buffer. This is
- ;; relevant when you use the default completion UI.
- :hook (completion-list-mode . consult-preview-at-point-mode)
-
- ;; The :init configuration is always executed (Not lazy)
- :init
-
- ;; Optionally configure the register formatting. This improves the register
- ;; preview for `consult-register', `consult-register-load',
- ;; `consult-register-store' and the Emacs built-ins.
- (setq register-preview-delay 0.5
- register-preview-function #'consult-register-format)
-
- ;; Optionally tweak the register preview window.
- ;; This adds thin lines, sorting and hides the mode line of the window.
- (advice-add #'register-preview :override #'consult-register-window)
-
- ;; Configure other variables and modes in the :config section,
- ;; after lazily loading the package.
- :config
-
- ;; Optionally configure preview. The default value
- ;; is 'any, such that any key triggers the preview.
- ;; (setq consult-preview-key 'any)
- ;; (setq consult-preview-key "M-.")
- ;; (setq consult-preview-key '("S-<down>" "S-<up>"))
- ;; For some commands and buffer sources it is useful to configure the
- ;; :preview-key on a per-command basis using the `consult-customize' macro.
- (consult-customize
- consult-ripgrep consult-git-grep consult-grep
- consult-bookmark consult-recent-file consult-xref
- consult--source-bookmark consult--source-file-register
- consult--source-recent-file consult--source-project-recent-file)
- ;; :preview-key "M-."
-
- ;; Optionally configure the narrowing key.
- ;; Both < and C-+ work reasonably well.
- (setq consult-narrow-key "<") ;; "C-+"
-
- ;; Optionally make narrowing help available in the minibuffer.
- ;; You may want to use `embark-prefix-help-command' or which-key instead.
- ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help)
-
- ;; By default `consult-project-function' uses `project-root' from project.el.
- ;; Optionally configure a different project root function.
-;;;; 1. project.el (the default)
- ;; (setq consult-project-function #'consult--default-project--function)
-;;;; 2. vc.el (vc-root-dir)
- ;; (setq consult-project-function (lambda (_) (vc-root-dir)))
-;;;; 3. locate-dominating-file
- ;; (setq consult-project-function (lambda (_) (locate-dominating-file "." ".git")))
-;;;; 4. projectile.el (projectile-project-root)
- ;; (autoload 'projectile-project-root "projectile")
- ;; (setq consult-project-function (lambda (_) (projectile-project-root)))
-;;;; 5. No project support
- ;; (setq consult-project-function nil)
-)
-
-(use-package smartparens
- :init (smartparens-global-mode)
- :hook (prog-mode-hook . turn-on-smartparens-strict-mode)
- :config
- ;; Snitched from doom
- (let ((unless-list '(sp-point-before-word-p
- sp-point-after-word-p
- sp-point-before-same-p)))
- (sp-pair "'" nil :unless unless-list)
- (sp-pair "\"" nil :unless unless-list))
- (dolist (brace '("(" "{" "["))
- (sp-pair brace nil
- :post-handlers '(("||\n[i]" "RET") ("| " "SPC"))
- :unless '(sp-point-before-word-p sp-point-before-same-p)))
- (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p))
- (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p))
-
- ;; Major-mode specific fixes
- (sp-local-pair 'ruby-mode "{" "}"
- :pre-handlers '(:rem sp-ruby-pre-handler)
- :post-handlers '(:rem sp-ruby-post-handler))
-
- ;; Don't do square-bracket space-expansion where it doesn't make sense to
- (sp-local-pair '(emacs-lisp-mode org-mode markdown-mode gfm-mode)
- "[" nil :post-handlers '(:rem ("| " "SPC")))
-
- ;; Reasonable default pairs for HTML-style comments
- (sp-local-pair (append sp--html-modes '(markdown-mode gfm-mode))
- "<!--" "-->"
- :unless '(sp-point-before-word-p sp-point-before-same-p)
- :actions '(insert) :post-handlers '(("| " "SPC")))
- ;; Expand C-style comment blocks.
- (defun +default-open-doc-comments-block (&rest _ignored)
- (save-excursion
- (newline)
- (indent-according-to-mode)))
- (sp-local-pair
- '(js2-mode typescript-mode rjsx-mode rust-mode c-mode c++-mode objc-mode
- csharp-mode java-mode php-mode css-mode scss-mode less-css-mode
- stylus-mode scala-mode)
- "/*" "*/"
- :actions '(insert)
- :post-handlers '(("| " "SPC")
- (" | " "*")
- ("|[i]\n[i]" "RET"))))
-
-;; (use-package dap-mode
-;; :defer t
-;; :config
-;; (require 'dap-python)
-;; (setq dap-python-debugger 'debugpy))
-
-(use-package move-text
- :bind (("C-M-k" . move-text-up)
- ("C-M-j" . move-text-down)))
-
-(global-visual-line-mode t)
-
-(use-package no-littering)
-
-(use-package rainbow-delimiters
- :hook (prog-mode . rainbow-delimiters-mode))
-
-(use-package crux)
-
-(use-package eat
- :custom
- (eat-enable-auto-line-mode t))
-
-(defun eat-toggle()
- "Open eat terminal as a popup."
- (interactive)
- (if (eq major-mode 'eat-mode)
- (delete-window)
- (let ((buff (get-buffer-create eat-buffer-name)))
- (cl-assert (and buff (buffer-live-p buff)))
- (funcall #'pop-to-buffer buff)
- (with-current-buffer buff
- (setq-local split-width-threshold nil)
- (setq-local window-min-height 2)
- (unless (derived-mode-p 'eat-mode)
- (eat))))))
-
-;; (defun eat-modes()
-;; (cond
-;; ((and (eq major-mode 'eat-mode) (member 'meow-normal-mode local-minor-modes))
-;; (eat-emacs-mode))
-;; ((and (eq major-mode 'eat-mode) (member 'meow-insert-mode local-minor-modes))
-;; (eat-semi-char-mode))))
-;; (add-hook 'meow-normal-mode-hook #'eat-modes)
-;; (add-hook 'meow-insert-mode-hook #'eat-modes)
-
-(use-package fish-completion
- :config
- (global-fish-completion-mode))
-
-
-
-(use-package lsp-mode
- :custom
- (lsp-completion-provider :none) ;; we use Corfu!
-
- :init
- (defun my/orderless-dispatch-flex-first (_pattern index _total)
- (and (eq index 0) 'orderless-flex))
-
- (defun my/lsp-mode-setup-completion ()
- (setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
- '(orderless)))
-
- ;; Optionally configure the first word as flex filtered.
- (add-hook 'orderless-style-dispatchers #'my/orderless-dispatch-flex-first nil 'local)
-
- ;; Optionally configure the cape-capf-buster.
-
- :hook
- (rust-mode-hook . lsp)
- (lsp-mode-hook . (lambda ()
- (setq-local completion-at-point-functions (list (cape-capf-buster #'lsp-completion-at-point)))))
- (lsp-completion-mode . my/lsp-mode-setup-completion))
-
-(use-package lsp-pyright
- :hook (python-mode . (lambda ()
- (require 'lsp-pyright)
- (lsp))))
-(use-package py-autopep8
- :hook (python-mode . py-autopep8-mode))
-
-(use-package rust-mode
- :mode "\\.rs\\'")
-(use-package flycheck-rust
- :config
- (with-eval-after-load 'rust-mode
- (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)))
-
-(use-package fish-mode
- :mode "\\.fish\\'")
-
-(use-package nix-mode
- :mode ("\\.nix\\'" "\\.nix.in\\'"))
-(use-package nix-drv-mode
- :ensure nix-mode
- :mode "\\.drv\\'")
-(use-package nix-shell
- :ensure nix-mode
- :commands (nix-shell-unpack nix-shell-configure nix-shell-build))
-(use-package nix-repl
- :ensure nix-mode
- :commands (nix-repl))
-
-(use-package web-mode
- :mode
- ("\\.phtml\\'"
- "\\.tpl\\.php\\'"
- "\\.[agj]sp\\'"
- "\\.as[cp]x\\'"
- "\\.erb\\'"
- "\\.mustache\\'"
- "\\.djhtml\\'"))
-
-(use-package js2-mode)
-
-(use-package corfu
- :custom
- (corfu-cycle t)
- (corfu-preselect 'prompt)
- (corfu-auto t)
- (corfu-popupinfo-delay 0.0)
- :bind
- (:map corfu-map
- ("TAB" . corfu-next)
- ([tab] . corfu-next)
- ("S-TAB" . corfu-previous)
- ([backtab] . corfu-previous))
-
- :init
- (global-corfu-mode)
- (corfu-history-mode)
- (corfu-popupinfo-mode)
- :config
- (add-to-list 'savehist-additional-variables 'corfu-history))
-(use-package emacs
- :init
- (setq completion-cycle-threshold 3)
-
- (setq read-extended-command-predicate
- #'command-completion-default-include-p)
-
- (setq tab-always-indent 'complete))
-
-(use-package cape
- ;; Bind dedicated completion commands
- ;; :bind (("C-c p p" . completion-at-point) ;; capf
- ;; ("C-c p t" . complete-tag) ;; etags
- ;; ("C-c p d" . cape-dabbrev) ;; or dabbrev-completion
- ;; ("C-c p h" . cape-history)
- ;; ("C-c p f" . cape-file)
- ;; ("C-c p k" . cape-keyword)
- ;; ("C-c p s" . cape-elisp-symbol)
- ;; ("C-c p e" . cape-elisp-block)
- ;; ("C-c p a" . cape-abbrev)
- ;; ("C-c p l" . cape-line)
- ;; ("C-c p w" . cape-dict)
- ;; ("C-c p :" . cape-emoji))
- :config
- (add-to-list 'completion-at-point-functions #'cape-dabbrev)
- (add-to-list 'completion-at-point-functions #'cape-file)
- (add-to-list 'completion-at-point-functions #'cape-elisp-block)
- )
-
-(use-package flycheck
- :init (global-flycheck-mode))
-
-(use-package tree-sitter
- :init
- (global-tree-sitter-mode)
- :config
- (add-hook 'tree-sitter-mode-hook 'tree-sitter-hl-mode))
-
-(use-package tree-sitter-langs)
-
-;; (use-package yasnippet
-;; :init (yas-global-mode))
-;; (use-package yasnippet-snippets)
-
-(use-package dirvish
- :init
- (dirvish-override-dired-mode)
- :custom
- (dired-listing-switches "-Al --group-directories-first")
- :bind (:map dired-mode-map
- ("h" . 'dired-up-directory)
- ("l" . 'dired-find-file)
- ("v" . 'meow-visit)))
-
-;; (add-to-list 'load-path "~/telega.el")
-;; (require 'telega)
-
-(use-package magit)
-
-;; (use-package exwm)
-;; (require 'exwm)
-;; (require 'exwm-config)
-;; (exwm-config-example)
-
-;; (use-package code-cells)
-
-;; (use-package orgnote
-;; :defer t)
-
-;; (use-package codeium
-;; :init
-;; ;; use globally
-;; (add-to-list 'completion-at-point-functions #'codeium-completion-at-point)
-;; :config
-;; (setq use-dialog-box nil) ;; do not use popup boxes
-
-;; ;; if you don't want to use customize to save the api-key
-;; ;; (setq codeium/metadata/api_key "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
-
-;; ;; get codeium status in the modeline
-;; (setq codeium-mode-line-enable
-;; (lambda (api) (not (memq api '(CancelRequest Heartbeat AcceptCompletion)))))
-;; (add-to-list 'mode-line-format '(:eval (car-safe codeium-mode-line)) t)
-;; ;; alternatively for a more extensive mode-line
-;; ;; (add-to-list 'mode-line-format '(-50 "" codeium-mode-line) t)
-
-;; ;; use M-x codeium-diagnose to see apis/fields that would be sent to the local language server
-;; (setq codeium-api-enabled
-;; (lambda (api)
-;; (memq api '(GetCompletions Heartbeat CancelRequest GetAuthToken RegisterUser auth-redirect AcceptCompletion))))
-;; ;; you can also set a config for a single buffer like this:
-;; ;; (add-hook 'python-mode-hook
-;; ;; (lambda ()
-;; ;; (setq-local codeium/editor_options/tab_size 4)))
-
-;; ;; You can overwrite all the codeium configs!
-;; ;; for example, we recommend limiting the string sent to codeium for better performance
-;; (defun my-codeium/document/text ()
-;; (buffer-substring-no-properties (max (- (point) 3000) (point-min)) (min (+ (point) 1000) (point-max))))
-;; ;; if you change the text, you should also change the cursor_offset
-;; ;; warning: this is measured by UTF-8 encoded bytes
-;; (defun my-codeium/document/cursor_offset ()
-;; (codeium-utf8-byte-length
-;; (buffer-substring-no-properties (max (- (point) 3000) (point-min)) (point))))
-;; (setq codeium/document/text 'my-codeium/document/text)
-;; (setq codeium/document/cursor_offset 'my-codeium/document/cursor_offset))
-
-(use-package helm)
-(use-package helm-fish-completion)
-(use-package telega)
-
-(setq gc-cons-threshold (* 2 1000 1000))
-(setq read-process-output-max (* 1024 1024))
diff --git a/home-manager/programs/emacs/init.old.el b/home-manager/programs/emacs/init.old.el
deleted file mode 100644
index 766d86d..0000000
--- a/home-manager/programs/emacs/init.old.el
+++ /dev/null
@@ -1,592 +0,0 @@
-(require 'use-package)
-
-;; Evil
-;; (use-package evil
-;; :init
-;; (setq evil-want-integration t)
-;; (setq evil-want-keybinding nil)
-;; (setq evil-split-window-below t)
-;; (setq evil-vsplit-window-right t)
-;; (evil-mode))
-;; (use-package evil-collection
-;; :after evil
-;; :config
-;; (setq evil-collection-mode-list '(dashboard dired ibuffer))
-;; (evil-collection-init))
-
-;; Meow
-(use-package meow
- :config
-(defun meow-setup ()
- (setq meow-use-clipboard t)
- (setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty)
- (meow-motion-overwrite-define-key
- '("j" . meow-next)
- '("k" . meow-prev)
- '("<escape>" . ignore))
- (meow-leader-define-key
- ;; SPC j/k will run the original command in MOTION state.
- '("j" . "H-j")
- '("k" . "H-k")
- ;; Use SPC (0-9) for digit arguments.
- '("1" . meow-digit-argument)
- '("2" . meow-digit-argument)
- '("3" . meow-digit-argument)
- '("4" . meow-digit-argument)
- '("5" . meow-digit-argument)
- '("6" . meow-digit-argument)
- '("7" . meow-digit-argument)
- '("8" . meow-digit-argument)
- '("9" . meow-digit-argument)
- '("0" . meow-digit-argument)
- '("/" . meow-keypad-describe-key)
- '("?" . meow-cheatsheet)
- '("bk" . kill-this-buffer))
- (meow-normal-define-key
- '("0" . meow-expand-0)
- '("9" . meow-expand-9)
- '("8" . meow-expand-8)
- '("7" . meow-expand-7)
- '("6" . meow-expand-6)
- '("5" . meow-expand-5)
- '("4" . meow-expand-4)
- '("3" . meow-expand-3)
- '("2" . meow-expand-2)
- '("1" . meow-expand-1)
- '("-" . negative-argument)
- '(";" . meow-reverse)
- '("," . meow-inner-of-thing)
- '("." . meow-bounds-of-thing)
- '("[" . meow-beginning-of-thing)
- '("]" . meow-end-of-thing)
- '("a" . meow-append)
- '("A" . meow-open-below)
- '("b" . meow-back-word)
- '("B" . meow-back-symbol)
- '("c" . meow-change)
- '("d" . meow-delete)
- '("D" . meow-backward-delete)
- '("e" . meow-next-word)
- '("E" . meow-next-symbol)
- '("f" . meow-find)
- '("g" . meow-cancel-selection)
- '("G" . meow-grab)
- '("h" . meow-left)
- '("H" . meow-left-expand)
- '("i" . meow-insert)
- '("I" . meow-open-above)
- '("j" . meow-next)
- '("J" . meow-next-expand)
- '("k" . meow-prev)
- '("K" . meow-prev-expand)
- '("l" . meow-right)
- '("L" . meow-right-expand)
- '("m" . meow-join)
- '("n" . meow-search)
- '("o" . meow-block)
- '("O" . meow-to-block)
- '("p" . meow-yank)
- '("q" . meow-quit)
- '("Q" . meow-goto-line)
- '("r" . meow-replace)
- '("R" . meow-swap-grab)
- '("s" . meow-kill)
- '("t" . meow-till)
- '("u" . meow-undo)
- '("U" . meow-undo-in-selection)
- '("v" . meow-visit)
- '("w" . meow-mark-word)
- '("W" . meow-mark-symbol)
- '("x" . meow-line)
- '("X" . meow-goto-line)
- '("y" . meow-save)
- '("Y" . meow-sync-grab)
- '("z" . meow-pop-selection)
- '("'" . repeat)
- '("<escape>" . ignore)))
-(meow-setup)
-(meow-global-mode 1))
-
-;; General Keybindings
-(use-package general
- :config
-
- ;; SPC as the global leader key
- (general-create-definer spl3g/leader-keys
- :prefix "C-c")
-
- (spl3g/leader-keys
- ;; Buffers
- "b" '(:ignore t :wk "Buffer")
- "bi" '(ibuffer :wk "ibuffer")
- "bk" '(kill-this-buffer :wk "Kill this buffer")
- "bn" '(next-buffer :wk "Next buffer")
- "bp" '(previous-buffer :wk "Previous buffer")
- "br" '(revert-buffer :wk "Reload buffer")
- "," '(consult-buffer :wk "Switch to buffer")
- "." '(find-file :wk "Find file")
- ;; Splits
- "w" '(:ignore t :wk "Evil splits")
- "wv" '(evil-window-vsplit :wk "Split vertical")
- "ws" '(evil-window-split :wk "Split")
- "ww" '(evil-window-next :wk "Cycle throug windows")
- "wc" '(evil-window-delete :wk "Close window")
- "wd" '(evil-window-delete :wk "Close window")
- ;; Files
- "f" '(:ignore t :wk "Files")
- "fr" '(consult-recent-file :wk "Resent files")
- "fc" '((lambda () (interactive) (find-file "~/.config/emacs/init.el")) :wk "Edit emacs config")
- "fu" '(sudo-edit-find-file :wk "Sudo find file")
- "fU" '(sudo-edit :wk "Sudo edit file")
- ;; Quiting
- "q" '(:ignore t :wk "Quiting")
- "qq" '(:ignore t :wk "Quit TBD")
- "qr" '(:ignore t :wk "Restart TBD")
- "qe" '(eval-buffer :wk "Eval buffer")
- "r" '(reload-init-file :wk "Reload config")
- "l" '(lsp-keymap-prefix :wk "LSP")))
-
-;; Which key
-(use-package which-key
- :init
- (which-key-mode 1)
- :config
- (setq which-key-side-window-location 'bottom
- which-key-sort-order #'which-key-key-order-alpha
- which-key-sort-uppercase-first nil
- which-key-add-column-padding 1
- which-key-max-display-columns nil
- which-key-side-window-slot -10
- which-key-side-window-max-height 0.25
- which-key-idle-deley 0.8
- which-key-max-description-length 25
- which-key-allow-imprecise-window-fit t
- which-key-separator " -> "))
-
-
-
-
-;; Vertico
-(use-package vertico
- :init
- (vertico-mode))
-
-;; For persistent history
-(savehist-mode 1)
-;; Idk what it means but they said that i need it
-(use-package emacs
- :init
- ;; Add prompt indicator to `completing-read-multiple'.
- ;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
- (defun crm-indicator (args)
- (cons (format "[CRM%s] %s"
- (replace-regexp-in-string
- "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
- crm-separator)
- (car args))
- (cdr args)))
- (advice-add #'completing-read-multiple :filter-args #'crm-indicator)
-
- ;; Do not allow the cursor in the minibuffer prompt
- (setq minibuffer-prompt-properties
- '(read-only t cursor-intangible t face minibuffer-prompt))
- (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
-
- ;; Emacs 28: Hide commands in M-x which do not work in the current mode.
- ;; Vertico commands are hidden in normal buffers.
- ;; (setq read-extended-command-predicate
- ;; #'command-completion-default-include-p)
-
- ;; Enable recursive minibuffers
- (setq enable-recursive-minibuffers t))
-;; Orderless
-(use-package orderless
- :init
- (setq completion-styles '(orderless basic)
- completion-category-defaults nil
- completion-category-overrides '((file (styles partial-completion)))))
-(use-package marginalia
- :bind (:map minibuffer-local-map
- ("M-A" . marginalia-cycle))
- :init
- (marginalia-mode))
-
-;; Consult
-(use-package consult
- ;; Replace bindings. Lazily loaded due by `use-package'.
- :bind (;; C-c bindings in `mode-specific-map'
- ("C-c M-x" . consult-mode-command)
- ("C-c h" . consult-history)
- ("C-c k" . consult-kmacro)
- ("C-c m" . consult-man)
- ("C-c i" . consult-info)
- ([remap Info-search] . consult-info)
- ;; C-x bindings in `ctl-x-map'
- ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
- ("C-x b" . consult-buffer) ;; orig. switch-to-buffer
- ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
- ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
- ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
- ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
- ;; Custom M-# bindings for fast register access
- ("M-#" . consult-register-load)
- ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
- ("C-M-#" . consult-register)
- ;; Other custom bindings
- ("M-y" . consult-yank-pop) ;; orig. yank-pop
- ;; M-g bindings in `goto-map'
- ("M-g e" . consult-compile-error)
- ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
- ("M-g g" . consult-goto-line) ;; orig. goto-line
- ("M-g M-g" . consult-goto-line) ;; orig. goto-line
- ("M-g o" . consult-outline) ;; Alternative: consult-org-heading
- ("M-g m" . consult-mark)
- ("M-g k" . consult-global-mark)
- ("M-g i" . consult-imenu)
- ("M-g I" . consult-imenu-multi)
- ;; M-s bindings in `search-map'
- ("M-s d" . consult-find)
- ("M-s D" . consult-locate)
- ("M-s g" . consult-grep)
- ("M-s G" . consult-git-grep)
- ("M-s r" . consult-ripgrep)
- ("M-s l" . consult-line)
- ("M-s L" . consult-line-multi)
- ("M-s k" . consult-keep-lines)
- ("M-s u" . consult-focus-lines)
- ;; Isearch integration
- ("M-s e" . consult-isearch-history)
- :map isearch-mode-map
- ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
- ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
- ("M-s l" . consult-line) ;; needed by consult-line to detect isearch
- ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
- ;; Minibuffer history
- :map minibuffer-local-map
- ("M-s" . consult-history) ;; orig. next-matching-history-element
- ("M-r" . consult-history)) ;; orig. previous-matching-history-element
-
- ;; Enable automatic preview at point in the *Completions* buffer. This is
- ;; relevant when you use the default completion UI.
- :hook (completion-list-mode . consult-preview-at-point-mode)
-
- ;; The :init configuration is always executed (Not lazy)
- :init
-
- ;; Optionally configure the register formatting. This improves the register
- ;; preview for `consult-register', `consult-register-load',
- ;; `consult-register-store' and the Emacs built-ins.
- (setq register-preview-delay 0.5
- register-preview-function #'consult-register-format)
-
- ;; Optionally tweak the register preview window.
- ;; This adds thin lines, sorting and hides the mode line of the window.
- (advice-add #'register-preview :override #'consult-register-window)
-
- ;; Use Consult to select xref locations with preview
- (setq xref-show-xrefs-function #'consult-xref
- xref-show-definitions-function #'consult-xref)
-
- ;; Configure other variables and modes in the :config section,
- ;; after lazily loading the package.
- :config
-
- ;; Optionally configure preview. The default value
- ;; is 'any, such that any key triggers the preview.
- ;; (setq consult-preview-key 'any)
- ;; (setq consult-preview-key "M-.")
- ;; (setq consult-preview-key '("S-<down>" "S-<up>"))
- ;; For some commands and buffer sources it is useful to configure the
- ;; :preview-key on a per-command basis using the `consult-customize' macro.
- (consult-customize
- consult-ripgrep consult-git-grep consult-grep
- consult-bookmark consult-recent-file consult-xref
- consult--source-bookmark consult--source-file-register
- consult--source-recent-file consult--source-project-recent-file)
- ;; :preview-key "M-."
-
- ;; Optionally configure the narrowing key.
- ;; Both < and C-+ work reasonably well.
- (setq consult-narrow-key "<") ;; "C-+"
-
- ;; Optionally make narrowing help available in the minibuffer.
- ;; You may want to use `embark-prefix-help-command' or which-key instead.
- ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help)
-
- ;; By default `consult-project-function' uses `project-root' from project.el.
- ;; Optionally configure a different project root function.
- ;;;; 1. project.el (the default)
- ;; (setq consult-project-function #'consult--default-project--function)
- ;;;; 2. vc.el (vc-root-dir)
- ;; (setq consult-project-function (lambda (_) (vc-root-dir)))
- ;;;; 3. locate-dominating-file
- ;; (setq consult-project-function (lambda (_) (locate-dominating-file "." ".git")))
- ;;;; 4. projectile.el (projectile-project-root)
- ;; (autoload 'projectile-project-root "projectile")
- ;; (setq consult-project-function (lambda (_) (projectile-project-root)))
- ;;;; 5. No project support
- ;; (setq consult-project-function nil)
-)
-
-;; Hotfuzz
-;; (use-package hotfuzz
-;; :config
-;; (setq completion-styles '(hotfuzz))
-;; (setq completion-ignore-case t))
-
-;; Lsp
-(use-package lsp-mode
- :hook
- (python-mode . lsp)
- (rust-mode . lsp)
- (lsp-mode . lsp-enable-which-key-integration)
- (sh-mode . lsp)
- :commands lsp)
-(use-package lsp-pyright
- :ensure t)
-(use-package lsp-ui
- :hook (lsp-mode-hook . lsp-ui-mode)
- :custom
- (lsp-ui-peek-always-show t)
- (lsp-ui-sideline-show-hover t)
- (lsp-ui-doc-enable t))
-
-(use-package lsp-treemacs)
-
-;; Flycheck
-(use-package flycheck)
-
-;; Corfu + Cape
-(use-package corfu
- :custom
- (corfu-cycle t)
- (corfu-auto t)
- (corfu-preselect 'prompt)
- :bind
- (:map corfu-map
- ("TAB" . corfu-next)
- ([tab] . corfu-next)
- ("S-TAB" . corfu-previous)
- ([backtab] . corfu-previous))
- :init
- (global-corfu-mode))
- ;;(use-package cape
- ;; :bind (("C-c a f" . cape-file))
- ;; :init
- ;; (add-to-list 'completion-at-point-functions # 'cape-file)))
-(use-package cape
- :init
- (add-to-list 'completion-at-point-functions #'cape-file))
-(use-package emacs
- :init
- (setq completion-cycle-threshold 3)
- (setq tab-always-indent 'complete))
-
-;; Treemacs
-(use-package treemacs
- :config
- (setq treemacs-no-png-images t))
-(use-package treemacs-evil)
-(use-package treemacs-all-the-icons)
-
-;; Resent files
-(recentf-mode 1)
-(setq recentf-max-menu-items 25)
-(setq recentf-max-saved-items 50)
-
-;; Sudo
-(use-package sudo-edit)
-
-;; (defun sudo-find-file-hook ()
-;; (when (and (not (file-writable-p buffer-file-name))
-;; (y-or-n-p-with-timeout "File not writable. Open as root?" 2 t))
-;; (let ((obuf (current-buffer)))
-;; (sudo-edit)
-;; (unless (equal (current-buffer) obuf)
-;; (let)
-
-;; Parinfer
-(electric-pair-mode 1)
-
-;; NixOS
-(use-package nix-mode
- :mode "(.nix)$")
-;; (use-package nix-drv-mode :elpaca nil
-;; :ensure nix-mode
-;; :mode ".drv")
-;; (use-package nix-shell :elpaca nil
-;; :ensure nix-mode
-;; :commands (nix-shell-unpack nix-shell-configure nix-shell-build))
-;; (use-package nix-repl :elpaca nil
-;; :ensure nix-mode
-;; :commands (nix-repl))
-
-;; Reload config
-(defun reload-init-file () (interactive)
- (load-file user-init-file)
- (load-file user-init-file))
-
-;; Magit
-(use-package magit)
-
-;; Fish
-(use-package fish-mode
- :mode "(.fish)$")
-
-;; Rust
-(use-package rustic
- :ensure
- :bind (:map rustic-mode-map
- ("M-j" . lsp-ui-imenu)
- ("M-?" . lsp-find-references)
- ("C-c C-c l" . flycheck-list-errors)
- ("C-c C-c a" . lsp-execute-code-action)
- ("C-c C-c r" . lsp-rename)
- ("C-c C-c q" . lsp-workspace-restart)
- ("C-c C-c Q" . lsp-workspace-shutdown)
- ("C-c C-c s" . lsp-rust-analyzer-status))
- :config
- ;; uncomment for less flashiness
- ;; (setq lsp-eldoc-hook nil)
- ;; (setq lsp-enable-symbol-highlighting nil)
- ;; (setq lsp-signature-auto-activate nil)
-
- ;; comment to disable rustfmt on save
- (setq rustic-format-on-save t)
- (add-hook 'rustic-mode-hook 'rk/rustic-mode-hook))
-
-(defun rk/rustic-mode-hook ()
- ;; so that run C-c C-c C-r works without having to confirm, but don't try to
- ;; save rust buffers that are not file visiting. Once
- ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should
- ;; no longer be necessary.
- (when buffer-file-name
- (setq-local buffer-save-without-query t))
- (add-hook 'before-save-hook 'lsp-format-buffer nil t))
-
-;; Tree-sitter
-(use-package treesit-auto
- :config
- (global-treesit-auto-mode)
- (setq treesit-auto-install t))
-
-;; Vterm
-(use-package vterm)
-
-;; Org mode
-(use-package toc-org
- :hook (org-mode-hook . toc-org-enable))
-(add-hook 'org-mode-hook 'org-indent-mode)
-(use-package org-bullets
- :hook (org-mode-hook . (lambda () (org-bullets-mode))))
-
-;; GUI tweaks
-;; Display numbers
-(global-display-line-numbers-mode 1)
-(global-visual-line-mode t)
-
-;; Theme
-(use-package autothemer)
-(use-package catppuccin-theme
- :ensure t
- :config
- (load-theme 'catppuccin t)
- (setq catppuccin-flavor 'mocha)
- (catppuccin-reload))
-
-;; Fonts
-(set-face-attribute 'default nil
- :font "Source Code Pro"
- :height 113
- :weight 'medium)
-(set-face-attribute 'fixed-pitch nil
- :font "Source Code Pro"
- :height 113
- :weight 'medium)
-(set-face-attribute 'variable-pitch nil
- :font "Rubik"
- :height 113
- :weight 'medium)
-(set-face-attribute 'font-lock-comment-face nil
- :slant 'italic)
-(set-face-attribute 'font-lock-keyword-face nil
- :weight 'bold)
-
-;; Icons
-(use-package all-the-icons
- :ensure t
- :if (display-graphic-p))
-(use-package all-the-icons-dired
- :hook (dired-mode . (lambda ()
- all-the-icons-dired-mode t)))
-
-;; Modeline
-(use-package mood-line
- :init
- (mood-line-mode)
- :config
- (setq mood-line-glyph-alist mood-line-glyphs-unicode))
-
-;; Scrolling
-(use-package good-scroll
- :init (good-scroll-mode))
-
-;; Dashboard
-(use-package dashboard
- :init
- (dashboard-setup-startup-hook)
- :config
- (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
- (setq dashboard-banner-logo-title "Yep, it's emacs, not vim")
- (setq dashboard-startup-banner 'logo)
- (setq dashboard-center-content t))
-
-;; Vterm
-
-
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(package-selected-packages '(nix-mode))
- '(warning-suppress-types
- '((comp)
- (comp)
- (comp)
- (comp)
- (comp)
- (comp)
- (comp)
- (comp)
- (comp)
- (comp)
- (comp)
- (comp)
- (comp))))
-(custom-set-faces)
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
-
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
-
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
-
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
-
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
-
diff --git a/home-manager/programs/firefox/default.nix b/home-manager/programs/firefox/default.nix
deleted file mode 100644
index b08ae0c..0000000
--- a/home-manager/programs/firefox/default.nix
+++ /dev/null
@@ -1,109 +0,0 @@
-{ pkgs, config, inputs, ... }:
-let
- nur = import inputs.nurpkgs {
- inherit pkgs;
- nurpkgs = pkgs;
- };
- extensions = with nur.repos.rycee.firefox-addons; [
- bitwarden
- ublock-origin
- switchyomega
- sponsorblock
- return-youtube-dislikes
- firefox-color
- tampermonkey
- duckduckgo-privacy-essentials
- sidebery
- ];
- userConfig = builtins.readFile ./user.js;
- configOverrides = ''
- user_pref("browser.search.suggest.enabled", true);
- user_pref("mousewheel.default.delta_multiplier_y", 75);
- user_pref("network.captive-portal-service.enabled", true);
- user_pref("captivedetect.canonicalURL", "http://detectportal.firefox.com/canonical.html");
- user_pref("network.connectivity-service.enabled", true);
- '';
- extraConfig = userConfig + configOverrides;
- engines = {
- "Brave" = {
- urls = [{ template = "https://search.brave.com/search?q={searchTerms}"; }];
- iconUpdateURL = "https://cdn.search.brave.com/serp/v2/_app/immutable/assets/safari-pinned-tab.539899c7.svg";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!br" ];
- };
- "NixOS" = {
- urls = [{ template = "https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query={searchTerms}"; }];
- iconUpdateURL = "https://nixos.org/favicon.png";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!ns" ];
- };
- "HomeManager" = {
- urls = [{ template = "https://mipmip.github.io/home-manager-option-search/?query={searchTerms}"; }];
- iconUpdateURL = "https://github.com/mipmip/home-manager-option-search/blob/main/images/favicon.png";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!hs" ];
- };
- "ai question" = {
- urls = [{ template = "https://iask.ai/?mode=question&q={searchTerms}"; }];
- iconUpdateURL = "https://iask.ai/favicons/favicon-32x32-650bd8771fdea8866630408578e381cc.png?vsn=d";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!aq" ];
- };
- "ai forums" = {
- urls = [{ template = "https://iask.ai/?mode=forums&q={searchTerms}"; }];
- iconUpdateURL = "https://iask.ai/favicons/favicon-32x32-650bd8771fdea8866630408578e381cc.png?vsn=d";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!af" ];
- };
- "ai wiki" = {
- urls = [{ template = "https://iask.ai/?mode=wiki&q={searchTerms}"; }];
- iconUpdateURL = "https://iask.ai/favicons/favicon-32x32-650bd8771fdea8866630408578e381cc.png?vsn=d";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!aw" ];
- };
- "FastGPT" = {
- urls = [{ template = "https://labs.kagi.com/fastgpt?query={searchTerms}"; }];
- definedAliases = [ "!fq" ];
- };
- "NixWiki" = {
- urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}&go=Go"; }];
- iconUpdateURL = "https://nixos.org/favicon.png";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!nw" ];
- };
- "Kinopoisk" = {
- urls = [{ template = "https://www.kinopoisk.ru/index.php?kp_query={searchTerms}"; }];
- iconUpdateURL = "https://www.kinopoisk.ru/favicon.ico";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!ks" ];
- };
- "AnimeGo" = {
- urls = [{ template = "https://animego.org/search/all?q={searchTerms}"; }];
- iconUpdateURL = "https://animego.org/favicon-32x32.png";
- updateInterval = 24 * 60 * 60 * 1000;
- definedAliases = [ "!as" ];
- };
- };
- force = true;
-in
-{
- programs.firefox = {
- enable = true;
- profiles.nothing = {
- isDefault = false;
- id = 1;
- };
- profiles.Betterfox = {
- isDefault = true;
- inherit extensions extraConfig;
- search = {
- inherit engines force;
- default = "Brave";
- };
- };
- };
- home.file."chrome" = {
- source = ./userChrome.css;
- target = ".mozilla/firefox/Betterfox/chrome/userChrome.css";
- };
-}
diff --git a/home-manager/programs/firefox/user.js b/home-manager/programs/firefox/user.js
deleted file mode 100644
index cbf15bb..0000000
--- a/home-manager/programs/firefox/user.js
+++ /dev/null
@@ -1,262 +0,0 @@
-//
-/* You may copy+paste this file and use it as it is.
- *
- * If you make changes to your about:config while the program is running, the
- * changes will be overwritten by the user.js when the application restarts.
- *
- * To make lasting changes to preferences, you will have to edit the user.js.
- */
-
-/****************************************************************************
- * Betterfox *
- * "Ad meliora" *
- * version: 115 *
- * url: https://github.com/yokoffing/Betterfox *
-****************************************************************************/
-
-/****************************************************************************
- * SECTION: FASTFOX *
-****************************************************************************/
-user_pref("nglayout.initialpaint.delay", 0);
-user_pref("nglayout.initialpaint.delay_in_oopif", 0);
-user_pref("content.notify.interval", 100000);
-user_pref("browser.startup.preXulSkeletonUI", false);
-
-/** EXPERIMENTAL ***/
-user_pref("layout.css.grid-template-masonry-value.enabled", true);
-user_pref("dom.enable_web_task_scheduling", true);
-
-/** GFX ***/
-user_pref("gfx.webrender.all", true);
-user_pref("gfx.webrender.precache-shaders", true);
-user_pref("gfx.webrender.compositor", true);
-user_pref("layers.gpu-process.enabled", true);
-user_pref("media.hardware-video-decoding.enabled", true);
-user_pref("gfx.canvas.accelerated", true);
-user_pref("gfx.canvas.accelerated.cache-items", 32768);
-user_pref("gfx.canvas.accelerated.cache-size", 4096);
-user_pref("gfx.content.skia-font-cache-size", 80);
-user_pref("image.cache.size", 10485760);
-user_pref("image.mem.decode_bytes_at_a_time", 131072);
-user_pref("image.mem.shared.unmap.min_expiration_ms", 120000);
-user_pref("media.memory_cache_max_size", 1048576);
-user_pref("media.memory_caches_combined_limit_kb", 2560000);
-user_pref("media.cache_readahead_limit", 9000);
-user_pref("media.cache_resume_threshold", 6000);
-
-/** BROWSER CACHE ***/
-user_pref("browser.cache.memory.max_entry_size", 153600);
-
-/** NETWORK ***/
-user_pref("network.buffer.cache.size", 262144);
-user_pref("network.buffer.cache.count", 128);
-user_pref("network.http.max-connections", 1800);
-user_pref("network.http.max-persistent-connections-per-server", 10);
-user_pref("network.ssl_tokens_cache_capacity", 32768);
-
-/****************************************************************************
- * SECTION: SECUREFOX *
-****************************************************************************/
-/** TRACKING PROTECTION ***/
-user_pref("browser.contentblocking.category", "strict");
-user_pref("urlclassifier.trackingSkipURLs", "*.reddit.com, *.twitter.com, *.twimg.com, *.tiktok.com");
-user_pref("urlclassifier.features.socialtracking.skipURLs", "*.instagram.com, *.twitter.com, *.twimg.com");
-user_pref("privacy.query_stripping.strip_list", "__hsfp __hssc __hstc __s _hsenc _openstat dclid fbclid gbraid gclid hsCtaTracking igshid mc_eid ml_subscriber ml_subscriber_hash msclkid oft_c oft_ck oft_d oft_id oft_ids oft_k oft_lk oft_sk oly_anon_id oly_enc_id rb_clickid s_cid twclid vero_conv vero_id wbraid wickedid yclid");
-user_pref("browser.uitour.enabled", false);
-user_pref("privacy.globalprivacycontrol.enabled", true);
-user_pref("privacy.globalprivacycontrol.functionality.enabled", true);
-
-/** OCSP & CERTS / HPKP ***/
-user_pref("security.OCSP.enabled", 0);
-user_pref("security.remote_settings.crlite_filters.enabled", true);
-user_pref("security.pki.crlite_mode", 2);
-user_pref("security.cert_pinning.enforcement_level", 2);
-
-/** SSL / TLS ***/
-user_pref("security.ssl.treat_unsafe_negotiation_as_broken", true);
-user_pref("browser.xul.error_pages.expert_bad_cert", true);
-user_pref("security.tls.enable_0rtt_data", false);
-
-/** DISK AVOIDANCE ***/
-user_pref("browser.cache.disk.enable", false);
-user_pref("browser.privatebrowsing.forceMediaMemoryCache", true);
-user_pref("browser.sessionstore.privacy_level", 2);
-
-/** SHUTDOWN & SANITIZING ***/
-user_pref("privacy.history.custom", true);
-
-/** SPECULATIVE CONNECTIONS ***/
-user_pref("network.http.speculative-parallel-limit", 0);
-user_pref("network.dns.disablePrefetch", true);
-user_pref("browser.urlbar.speculativeConnect.enabled", false);
-user_pref("browser.places.speculativeConnect.enabled", false);
-user_pref("network.prefetch-next", false);
-user_pref("network.predictor.enabled", false);
-user_pref("network.predictor.enable-prefetch", false);
-
-/** SEARCH / URL BAR ***/
-user_pref("browser.search.separatePrivateDefault.ui.enabled", true);
-user_pref("browser.urlbar.update2.engineAliasRefresh", true);
-user_pref("browser.search.suggest.enabled", false);
-user_pref("browser.urlbar.suggest.quicksuggest.sponsored", false);
-user_pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false);
-user_pref("security.insecure_connection_text.enabled", true);
-user_pref("security.insecure_connection_text.pbmode.enabled", true);
-user_pref("network.IDN_show_punycode", true);
-
-/** HTTPS-FIRST MODE ***/
-user_pref("dom.security.https_first", true);
-
-/** PROXY / SOCKS / IPv6 ***/
-user_pref("network.proxy.socks_remote_dns", true);
-user_pref("network.file.disable_unc_paths", true);
-user_pref("network.gio.supported-protocols", "");
-
-/** PASSWORDS AND AUTOFILL ***/
-user_pref("signon.formlessCapture.enabled", false);
-user_pref("signon.privateBrowsingCapture.enabled", false);
-user_pref("signon.autofillForms", false);
-user_pref("signon.rememberSignons", false);
-user_pref("editor.truncate_user_pastes", false);
-
-/** ADDRESS + CREDIT CARD MANAGER ***/
-user_pref("extensions.formautofill.addresses.enabled", false);
-user_pref("extensions.formautofill.creditCards.enabled", false);
-user_pref("extensions.formautofill.heuristics.enabled", false);
-user_pref("browser.formfill.enable", false);
-
-/** MIXED CONTENT + CROSS-SITE ***/
-user_pref("network.auth.subresource-http-auth-allow", 1);
-user_pref("pdfjs.enableScripting", false);
-user_pref("extensions.postDownloadThirdPartyPrompt", false);
-user_pref("permissions.delegation.enabled", false);
-
-/** HEADERS / REFERERS ***/
-user_pref("network.http.referer.XOriginTrimmingPolicy", 2);
-
-/** CONTAINERS ***/
-user_pref("privacy.userContext.ui.enabled", true);
-
-/** WEBRTC ***/
-user_pref("media.peerconnection.ice.proxy_only_if_behind_proxy", true);
-user_pref("media.peerconnection.ice.default_address_only", true);
-
-/** SAFE BROWSING ***/
-user_pref("browser.safebrowsing.downloads.remote.enabled", false);
-
-/** MOZILLA ***/
-user_pref("accessibility.force_disabled", 1);
-user_pref("identity.fxaccounts.enabled", false);
-user_pref("browser.tabs.firefox-view", false);
-user_pref("permissions.default.desktop-notification", 2);
-user_pref("permissions.default.geo", 2);
-user_pref("geo.provider.network.url", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
-user_pref("geo.provider.ms-windows-location", false); // WINDOWS
-user_pref("geo.provider.use_corelocation", false); // MAC
-user_pref("geo.provider.use_gpsd", false); // LINUX
-user_pref("geo.provider.use_geoclue", false); // LINUX
-user_pref("permissions.manager.defaultsUrl", "");
-user_pref("webchannel.allowObject.urlWhitelist", "");
-
-/** TELEMETRY ***/
-user_pref("toolkit.telemetry.unified", false);
-user_pref("toolkit.telemetry.enabled", false);
-user_pref("toolkit.telemetry.server", "data:,");
-user_pref("toolkit.telemetry.archive.enabled", false);
-user_pref("toolkit.telemetry.newProfilePing.enabled", false);
-user_pref("toolkit.telemetry.shutdownPingSender.enabled", false);
-user_pref("toolkit.telemetry.updatePing.enabled", false);
-user_pref("toolkit.telemetry.bhrPing.enabled", false);
-user_pref("toolkit.telemetry.firstShutdownPing.enabled", false);
-user_pref("toolkit.telemetry.coverage.opt-out", true);
-user_pref("toolkit.coverage.opt-out", true);
-user_pref("datareporting.healthreport.uploadEnabled", false);
-user_pref("datareporting.policy.dataSubmissionEnabled", false);
-user_pref("app.shield.optoutstudies.enabled", false);
-user_pref("browser.discovery.enabled", false);
-user_pref("breakpad.reportURL", "");
-user_pref("browser.tabs.crashReporting.sendReport", false);
-user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false);
-user_pref("captivedetect.canonicalURL", "");
-user_pref("network.captive-portal-service.enabled", false);
-user_pref("network.connectivity-service.enabled", false);
-user_pref("default-browser-agent.enabled", false);
-user_pref("app.normandy.enabled", false);
-user_pref("app.normandy.api_url", "");
-user_pref("browser.ping-centre.telemetry", false);
-user_pref("browser.newtabpage.activity-stream.feeds.telemetry", false);
-user_pref("browser.newtabpage.activity-stream.telemetry", false);
-
-/****************************************************************************
- * SECTION: PESKYFOX *
-****************************************************************************/
-/** MOZILLA UI ***/
-user_pref("layout.css.prefers-color-scheme.content-override", 2);
-user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
-user_pref("app.update.suppressPrompts", true);
-user_pref("browser.compactmode.show", true);
-user_pref("browser.privatebrowsing.vpnpromourl", "");
-user_pref("extensions.getAddons.showPane", false);
-user_pref("extensions.htmlaboutaddons.recommendations.enabled", false);
-user_pref("browser.shell.checkDefaultBrowser", false);
-user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false);
-user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false);
-user_pref("browser.preferences.moreFromMozilla", false);
-user_pref("browser.tabs.tabmanager.enabled", false);
-user_pref("browser.aboutwelcome.enabled", false);
-user_pref("findbar.highlightAll", true);
-user_pref("middlemouse.contentLoadURL", false);
-user_pref("browser.privatebrowsing.enable-new-indicator", false);
-
-/** FULLSCREEN ***/
-user_pref("full-screen-api.transition-duration.enter", "0 0");
-user_pref("full-screen-api.transition-duration.leave", "0 0");
-user_pref("full-screen-api.warning.delay", -1);
-user_pref("full-screen-api.warning.timeout", 0);
-
-/** URL BAR ***/
-user_pref("browser.urlbar.suggest.engines", false);
-user_pref("browser.urlbar.suggest.topsites", false);
-user_pref("browser.urlbar.suggest.calculator", true);
-user_pref("browser.urlbar.unitConversion.enabled", true);
-
-/** NEW TAB PAGE ***/
-user_pref("browser.newtabpage.activity-stream.feeds.topsites", false);
-user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
-
-/*** POCKET ***/
-user_pref("extensions.pocket.enabled", false);
-
-/** DOWNLOADS ***/
-user_pref("browser.download.useDownloadDir", false);
-user_pref("browser.download.alwaysOpenPanel", false);
-user_pref("browser.download.manager.addToRecentDocs", false);
-user_pref("browser.download.always_ask_before_handling_new_types", true);
-
-/** PDF ***/
-user_pref("browser.download.open_pdf_attachments_inline", true);
-
-/** TAB BEHAVIOR ***/
-user_pref("browser.tabs.loadBookmarksInTabs", true);
-user_pref("browser.bookmarks.openInTabClosesMenu", false);
-user_pref("layout.css.has-selector.enabled", true);
-user_pref("cookiebanners.service.mode", 2);
-user_pref("cookiebanners.service.mode.privateBrowsing", 2);
-
-/****************************************************************************
- * SECTION: SMOOTHFOX *
-****************************************************************************/
-// visit https://github.com/yokoffing/Betterfox/blob/master/Smoothfox.js
-// Enter your scrolling prefs below this line:
-user_pref("apz.overscroll.enabled", true);
-user_pref("general.smoothScroll", true);
-user_pref("mousewheel.default.delta_multiplier_y", 275);
-
-/****************************************************************************
- * START: MY OVERRIDES *
-****************************************************************************/
-// Enter your personal prefs below this line:
-
-/****************************************************************************
- * END: BETTERFOX *
-****************************************************************************/
diff --git a/home-manager/programs/firefox/userChrome.css b/home-manager/programs/firefox/userChrome.css
deleted file mode 100644
index c4390dc..0000000
--- a/home-manager/programs/firefox/userChrome.css
+++ /dev/null
@@ -1,98 +0,0 @@
-:root[tabsintitlebar]{ --uc-toolbar-height: 40px; }
-:root[tabsintitlebar][uidensity="compact"]{ --uc-toolbar-height: 32px }
-
-#TabsToolbar{ visibility: collapse !important }
-
-:root[sizemode="fullscreen"] #TabsToolbar > :is(#window-controls,.titlebar-buttonbox-container){
- visibility: visible !important;
- z-index: 2;
-}
-
-:root:not([inFullscreen]) #nav-bar{
- margin-top: calc(0px - var(--uc-toolbar-height,0px));
-}
-
-:root[tabsintitlebar] #toolbar-menubar[autohide="true"]{
- min-height: unset !important;
- height: var(--uc-toolbar-height,0px) !important;
- position: relative;
-}
-
-#toolbar-menubar[autohide="false"]{
- margin-bottom: var(--uc-toolbar-height,0px)
-}
-
-:root[tabsintitlebar] #toolbar-menubar[autohide="true"] #main-menubar{
- flex-grow: 1;
- align-items: stretch;
- background-color: var(--toolbar-bgcolor,--toolbar-non-lwt-bgcolor);
- background-clip: padding-box;
- border-right: 30px solid transparent;
- border-image: linear-gradient(to left, transparent, var(--toolbar-bgcolor,--toolbar-non-lwt-bgcolor) 30px) 20 / 30px
-}
-
-
-#toolbar-menubar:not([inactive]){ z-index: 2 }
-#toolbar-menubar[autohide="true"][inactive] > #menubar-items {
- opacity: 0;
- pointer-events: none;
- margin-left: var(--uc-window-drag-space-pre,0px)
-}
-
-.titlebar-close {
- display: none !important;
-}
-
-element {
- --toolbar-bgcolor: var(--lwt-accent-color) !important;
-}
-
-
-#appcontent
-> #tabbrowser-tabbox
-> #tabbrowser-tabpanels
-> .deck-selected
-> .browserContainer
-> .browserStack
-> browser {
- border-radius: 10px;
- margin: 10px;
- border-color: transparent;
-}
-
-.browserStack {
- background: var(--lwt-accent-color);
-}
-
-.browserContainer {
- background-color: var(--lwt-accent-color);
- background-position: right top, var(--lwt-background-alignment);
-}
-
-#sidebar-button {
- margin-left: 10px;
-}
-
-#sidebar-box {
- min-width: 250px;
- max-width: 250px;
- min-height: unset;
- max-height: unset;
- border-right: none;
-}
-
-#sidebar-splitter {
- display: none;
-}
-
-#PersonalToolbar {
- display: none;
-}
-
-#navigator-toolbox {
- border-bottom: none !important;
-}
-
-#sidebar-header {
- display: none;
-}
diff --git a/home-manager/programs/fish/default.nix b/home-manager/programs/fish/default.nix
deleted file mode 100644
index 9cde39d..0000000
--- a/home-manager/programs/fish/default.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ pkgs, ... }:
-
-let
- nixPlugins = [
- { name = "colored-man-output"; src = pkgs.fishPlugins.colored-man-pages.src; }
- { name = "fzf-fish"; src = pkgs.fishPlugins.fzf-fish.src; }
- { name = "pure"; src = pkgs.fishPlugins.pure.src; }
- { name = "autopair"; src = pkgs.fishPlugins.autopair.src; }
- ];
- customPlugins = [];
- plugins = nixPlugins ++ customPlugins;
- interactiveShellInit = ''
- set fish_greeting
- pokemon-colorscripts -r --no-title
- '';
- # loginShellInit = ''
- # Hyprland
- # '';
- functions = {
- ranger_func = ''
- ranger $argv
- set -l quit_cd_wd_file "$HOME/.ranger_quit_cd_wd"
- if test -s "$quit_cd_wd_file"
- cd "$(cat $quit_cd_wd_file)"
- true > "$quit_cd_wd_file"
- end
- '';
- };
- shellAliases = {
- rn = "ranger_func";
- ls = "ls --hyperlink=auto --color=auto";
- iamatomic = "sudo nixos-rebuild switch --flake ~/nixfiles#ltrr";
- };
-
-in
-{
- programs.direnv = {
- enable = true;
- };
-
- programs.fish = {
- enable = true;
- inherit plugins interactiveShellInit functions shellAliases;
- };
-}
diff --git a/home-manager/programs/foot/default.nix b/home-manager/programs/foot/default.nix
deleted file mode 100644
index f22aac8..0000000
--- a/home-manager/programs/foot/default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-{ pkgs, ... }:
-{
- programs.foot = {
- enable = true;
- server.enable = true;
- settings = {
- };
- };
-}
diff --git a/home-manager/programs/kitty/default.nix b/home-manager/programs/kitty/default.nix
deleted file mode 100644
index a1cfbf3..0000000
--- a/home-manager/programs/kitty/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ pkgs, ... }:
-{
- programs.kitty = {
- enable = true;
- font.name = "Source Code Pro";
- font.size = 11.3;
- theme = "Catppuccin-Mocha";
- shellIntegration.enableFishIntegration = true;
- settings = {
- cursor_shape = "underline";
- background_opacity = "0.7";
- };
- };
-}
diff --git a/home-manager/programs/kitty/default.nix~ b/home-manager/programs/kitty/default.nix~
deleted file mode 100644
index e4e62ca..0000000
--- a/home-manager/programs/kitty/default.nix~
+++ /dev/null
@@ -1,10 +0,0 @@
- programs = {
- kitty = {
- enable = true;
- font.name = "Source Code Pro";
- font.size = 11.3;
- theme = "Catppuccin-Mocha";
- shellIntegration.enableFishIntegration = true;
- extraConfig = "cursor_shape underline";
- };
- };
diff --git a/home-manager/programs/ranger/commands.py b/home-manager/programs/ranger/commands.py
deleted file mode 100644
index a41d42f..0000000
--- a/home-manager/programs/ranger/commands.py
+++ /dev/null
@@ -1,183 +0,0 @@
-from ranger.api.commands import Command
-from ranger.container.file import File
-from ranger.ext.get_executables import get_executables
-from collections import deque
-import os
-import subprocess
-
-# fd search
-
-
-class fd_search(Command):
- """
- :fd_search [-d<depth>] <query>
- Executes "fd -d<depth> <query>" in the current directory and focuses the
- first match. <depth> defaults to 1, i.e. only the contents of the current
- directory.
-
- See https://github.com/sharkdp/fd
- """
-
- SEARCH_RESULTS = deque()
-
- def execute(self):
- import re
- import subprocess
- from ranger.ext.get_executables import get_executables
-
- self.SEARCH_RESULTS.clear()
-
- if "fdfind" in get_executables():
- fd = "fdfind"
- elif "fd" in get_executables():
- fd = "fd"
- else:
- self.fm.notify("Couldn't find fd in the PATH.", bad=True)
- return
-
- if self.arg(1):
- if self.arg(1)[:2] == "-d":
- depth = self.arg(1)
- target = self.rest(2)
- else:
- depth = "-d1"
- target = self.rest(1)
- else:
- self.fm.notify(":fd_search needs a query.", bad=True)
- return
-
- hidden = "--hidden" if self.fm.settings.show_hidden else ""
- exclude = "--no-ignore-vcs --exclude '.git' --exclude '*.py[co]' --exclude '__pycache__'"
- command = "{} --follow {} {} {} --print0 {}".format(
- fd, depth, hidden, exclude, target
- )
- fd = self.fm.execute_command(
- command, universal_newlines=True, stdout=subprocess.PIPE
- )
- stdout, _ = fd.communicate()
-
- if fd.returncode == 0:
- results = filter(None, stdout.split("\0"))
- if not self.fm.settings.show_hidden and self.fm.settings.hidden_filter:
- hidden_filter = re.compile(self.fm.settings.hidden_filter)
- results = filter(
- lambda res: not hidden_filter.search(os.path.basename(res)), results
- )
- results = map(
- lambda res: os.path.abspath(os.path.join(self.fm.thisdir.path, res)),
- results,
- )
- self.SEARCH_RESULTS.extend(sorted(results, key=str.lower))
- if len(self.SEARCH_RESULTS) > 0:
- self.fm.notify(
- "Found {} result{}.".format(
- len(self.SEARCH_RESULTS),
- ("s" if len(self.SEARCH_RESULTS) > 1 else ""),
- )
- )
- self.fm.select_file(self.SEARCH_RESULTS[0])
- else:
- self.fm.notify("No results found.")
-
-
-class fd_next(Command):
- """
- :fd_next
- Selects the next match from the last :fd_search.
- """
-
- def execute(self):
- if len(fd_search.SEARCH_RESULTS) > 1:
- fd_search.SEARCH_RESULTS.rotate(-1) # rotate left
- self.fm.select_file(fd_search.SEARCH_RESULTS[0])
- elif len(fd_search.SEARCH_RESULTS) == 1:
- self.fm.select_file(fd_search.SEARCH_RESULTS[0])
-
-
-class fd_prev(Command):
- """
- :fd_prev
- Selects the next match from the last :fd_search.
- """
-
- def execute(self):
- if len(fd_search.SEARCH_RESULTS) > 1:
- fd_search.SEARCH_RESULTS.rotate(1) # rotate right
- self.fm.select_file(fd_search.SEARCH_RESULTS[0])
- elif len(fd_search.SEARCH_RESULTS) == 1:
- self.fm.select_file(fd_search.SEARCH_RESULTS[0])
-
-
-# yank content
-class YankContentWl(Command):
- def execute(self):
- if "wl-copy" not in get_executables():
- self.fm.notify("wl-clipboard is not found.", bad=True)
- return
-
- arg = self.rest(1)
- if arg:
- if not os.path.isfile(arg):
- self.fm.notify("{} is not a file".format(arg))
- return
- file = File(arg)
- else:
- file = self.fm.thisfile
- if not file.is_file:
- self.fm.notify("{} is not a file".format(file.relative_path))
- return
- if file.is_binary or file.image:
- subprocess.check_call("wl-copy" + " < " + file.path, shell=True)
- else:
- self.fm.notify(
- "{} is not an image file or a text file".format(file.relative_path)
- )
-
-
-import os
-import subprocess
-from ranger.api.commands import Command
-from ranger.container.file import File
-from ranger.ext.get_executables import get_executables
-
-
-class YankContent(Command):
- """
- Copy the content of image file and text file with xclip
- """
-
- def execute(self):
- if "xclip" not in get_executables():
- self.fm.notify("xclip is not found.", bad=True)
- return
-
- arg = self.rest(1)
- if arg:
- if not os.path.isfile(arg):
- self.fm.notify("{} is not a file.".format(arg))
- return
- file = File(arg)
- else:
- file = self.fm.thisfile
- if not file.is_file:
- self.fm.notify("{} is not a file.".format(file.relative_path))
- return
-
- relative_path = file.relative_path
- cmd = ["xclip", "-selection", "clipboard"]
- if not file.is_binary():
- with open(file.path, "rb") as fd:
- subprocess.check_call(cmd, stdin=fd)
- elif file.image:
- cmd += ["-t", file.mimetype, file.path]
- subprocess.check_call(cmd)
- self.fm.notify(
- "Content of {} is copied to x clipboard".format(relative_path)
- )
- else:
- self.fm.notify(
- "{} is not an image file or a text file.".format(relative_path)
- )
-
- def tab(self, tabnum):
- return self._tab_directory_content()
diff --git a/home-manager/programs/ranger/default.nix b/home-manager/programs/ranger/default.nix
deleted file mode 100644
index 4dbced5..0000000
--- a/home-manager/programs/ranger/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, ... }:
-{
- home.packages = with pkgs; [ ranger wl-clipboard ];
- xdg.configFile = {
- "ranger/rc.conf".text = builtins.readFile ./rc.conf;
- "ranger/rifle.conf".text = builtins.readFile ./rifle.conf;
- "ranger/scope.sh".text = builtins.readFile ./scope.sh;
- "ranger/commands.py".source = ./commands.py;
- "ranger/plugins".source = ./plugins;
- };
-}
diff --git a/home-manager/programs/ranger/default.nix~ b/home-manager/programs/ranger/default.nix~
deleted file mode 100644
index ea1b298..0000000
--- a/home-manager/programs/ranger/default.nix~
+++ /dev/null
@@ -1,7 +0,0 @@
-{ pkgs, ... }:
-let
- "ranger/rc.conf".text = builtins.readFile ./rc.conf;
- "ranger/rifle.conf".text = builtins.readFile ./rifle.conf;
- "ranger/scope.sh".text = builtins.readFile ./scope.sh;
- "ranger/commands.py".source = ./commands.py;
- "ranger/plugins".source = ./plugins;
diff --git a/home-manager/programs/ranger/plugins/__init__.py b/home-manager/programs/ranger/plugins/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/home-manager/programs/ranger/plugins/__init__.py
+++ /dev/null
diff --git a/home-manager/programs/ranger/plugins/__pycache__/__init__.cpython-310.pyc b/home-manager/programs/ranger/plugins/__pycache__/__init__.cpython-310.pyc
deleted file mode 100644
index 1a26aa3..0000000
--- a/home-manager/programs/ranger/plugins/__pycache__/__init__.cpython-310.pyc
+++ /dev/null
Binary files differ
diff --git a/home-manager/programs/ranger/plugins/__pycache__/__init__.cpython-311.pyc b/home-manager/programs/ranger/plugins/__pycache__/__init__.cpython-311.pyc
deleted file mode 100644
index 87b2e7f..0000000
--- a/home-manager/programs/ranger/plugins/__pycache__/__init__.cpython-311.pyc
+++ /dev/null
Binary files differ
diff --git a/home-manager/programs/ranger/plugins/__pycache__/fd.cpython-311.pyc b/home-manager/programs/ranger/plugins/__pycache__/fd.cpython-311.pyc
deleted file mode 100644
index 146af23..0000000
--- a/home-manager/programs/ranger/plugins/__pycache__/fd.cpython-311.pyc
+++ /dev/null
Binary files differ
diff --git a/home-manager/programs/ranger/plugins/__pycache__/quit_cd_wd.cpython-310.pyc b/home-manager/programs/ranger/plugins/__pycache__/quit_cd_wd.cpython-310.pyc
deleted file mode 100644
index 49d1db9..0000000
--- a/home-manager/programs/ranger/plugins/__pycache__/quit_cd_wd.cpython-310.pyc
+++ /dev/null
Binary files differ
diff --git a/home-manager/programs/ranger/plugins/__pycache__/quit_cd_wd.cpython-311.pyc b/home-manager/programs/ranger/plugins/__pycache__/quit_cd_wd.cpython-311.pyc
deleted file mode 100644
index 7b3ac1c..0000000
--- a/home-manager/programs/ranger/plugins/__pycache__/quit_cd_wd.cpython-311.pyc
+++ /dev/null
Binary files differ
diff --git a/home-manager/programs/ranger/plugins/quit_cd_wd.py b/home-manager/programs/ranger/plugins/quit_cd_wd.py
deleted file mode 100644
index e47837f..0000000
--- a/home-manager/programs/ranger/plugins/quit_cd_wd.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import ranger.api
-from ranger.api.commands import *
-import os
-
-def save_wd(command):
- with open(os.path.expanduser('~/.ranger_quit_cd_wd'), 'w') as f:
- f.write(command.fm.thisdir.path);
-
-class quit_cd_wd(Command):
- """:chdir to working directory of ranger after quiting on ranger.
-
- """
- def _exit_no_work(self):
- if self.fm.loader.has_work():
- self.fm.notify('Not quitting: Tasks in progress: Use `quit!` to force quit')
- else:
- self.fm.exit()
-
- def execute(self):
- if len(self.fm.tabs) >= 2:
- self.fm.tab_close()
- else:
- save_wd(self)
- self._exit_no_work()
-
-class quitall_cd_wd(Command):
- """:chdir to working directory of ranger after quitalling on ranger.
-
- """
- def _exit_no_work(self):
- if self.fm.loader.has_work():
- self.fm.notify('Not quitting: Tasks in progress: Use `quitall!` to force quit')
- else:
- self.fm.exit()
-
- def execute(self):
- save_wd(self)
- self._exit_no_work()
diff --git a/home-manager/programs/ranger/plugins/ranger_fzf_filter/.gitignore b/home-manager/programs/ranger/plugins/ranger_fzf_filter/.gitignore
deleted file mode 100644
index 846dc44..0000000
--- a/home-manager/programs/ranger/plugins/ranger_fzf_filter/.gitignore
+++ /dev/null
@@ -1,132 +0,0 @@
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-*$py.class
-
-# C extensions
-*.so
-
-# Distribution / packaging
-.Python
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-.eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-wheels/
-pip-wheel-metadata/
-share/python-wheels/
-*.egg-info/
-.installed.cfg
-*.egg
-MANIFEST
-
-# PyInstaller
-# Usually these files are written by a python script from a template
-# before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.nox/
-.coverage
-.coverage.*
-.cache
-nosetests.xml
-coverage.xml
-*.cover
-*.py,cover
-.hypothesis/
-.pytest_cache/
-
-# Translations
-*.mo
-*.pot
-
-# Django stuff:
-*.log
-local_settings.py
-db.sqlite3
-db.sqlite3-journal
-
-# Flask stuff:
-instance/
-.webassets-cache
-
-# Scrapy stuff:
-.scrapy
-
-# Sphinx documentation
-docs/_build/
-
-# PyBuilder
-target/
-
-# Jupyter Notebook
-.ipynb_checkpoints
-
-# IPython
-profile_default/
-ipython_config.py
-
-# pyenv
-.python-version
-
-# pipenv
-# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
-# However, in case of collaboration, if having platform-specific dependencies or dependencies
-# having no cross-platform support, pipenv may install dependencies that don't work, or not
-# install all needed dependencies.
-#Pipfile.lock
-
-# PEP 582; used by e.g. github.com/David-OConnor/pyflow
-__pypackages__/
-
-# Celery stuff
-celerybeat-schedule
-celerybeat.pid
-
-# SageMath parsed files
-*.sage.py
-
-# Environments
-.env
-.venv
-env/
-venv/
-ENV/
-env.bak/
-venv.bak/
-
-# Spyder project settings
-.spyderproject
-.spyproject
-
-# Rope project settings
-.ropeproject
-
-# mkdocs documentation
-/site
-
-# mypy
-.mypy_cache/
-.dmypy.json
-dmypy.json
-
-# Pyre type checker
-.pyre/
-
-# Pycharm
-.idea
diff --git a/home-manager/programs/ranger/plugins/ranger_fzf_filter/LICENSE b/home-manager/programs/ranger/plugins/ranger_fzf_filter/LICENSE
deleted file mode 100644
index bd840f1..0000000
--- a/home-manager/programs/ranger/plugins/ranger_fzf_filter/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2021 MuXiu1997
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/home-manager/programs/ranger/plugins/ranger_fzf_filter/README.md b/home-manager/programs/ranger/plugins/ranger_fzf_filter/README.md
deleted file mode 100644
index 6a65e17..0000000
--- a/home-manager/programs/ranger/plugins/ranger_fzf_filter/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# ranger-fzf-filter
-This is a plugin for [`ranger`](https://github.com/ranger/ranger) that add a fuzzy filter. It depends on [`fzf`](https://github.com/junegunn/fzf)
-
-https://user-images.githubusercontent.com/49554020/173509108-dc3edca4-8949-4026-a3ca-0ba8dac9bbce.mp4
-
-
-## Install
-
-For ranger >= 1.9.3, use Git to clone this repository into your `~/.config/ranger/plugins` folder. For example:
-
-```sh
-git clone git@github.com:MuXiu1997/ranger-fzf-filter.git ~/.config/ranger/plugins/ranger_fzf_filter
-```
-
-**Legacy Install**
-
-For ranger versions older than 1.9.3, or to install without Git, download `__init__.py` to your `~/.config/ranger/plugins` directory. For example:
-
-```shell
-mkdir -p ~/.config/ranger/plugins
-wget -O ~/.config/ranger/plugins/ranger_fzf_filter.py https://raw.githubusercontent.com/MuXiu1997/ranger-fzf-filter/main/__init__.py
-```
-
-
-
-## Usage
-
-Command:
-
-- `:fzf_filter [query]`: filtering files with fzf, see this [search syntax](https://github.com/junegunn/fzf#search-syntax)
-
-
-
-## Keyboard Shortcut
-
-Add a binding to your `~/.config/ranger/rc.conf` file to quickly use `:fzf_filter`:
-
-```
-map f console fzf_filter%space
-```
-
-
-
-## License
-
-[MIT](LICENSE)
-
diff --git a/home-manager/programs/ranger/plugins/ranger_fzf_filter/__init__.py b/home-manager/programs/ranger/plugins/ranger_fzf_filter/__init__.py
deleted file mode 100644
index b5d5b46..0000000
--- a/home-manager/programs/ranger/plugins/ranger_fzf_filter/__init__.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import ranger.api
-import ranger.container.directory
-# noinspection PyUnresolvedReferences
-from .command import fzf_filter, KEY_FZF_FILTER
-
-# region overwrite hook_init
-HOOK_INIT_OLD = ranger.api.hook_init
-
-
-def hook_init(fm):
- def clear_fzf_filter(signal):
- if fm.settings.clear_filters_on_dir_change and signal.previous:
- signal.previous.__dict__[KEY_FZF_FILTER] = None
- signal.previous.refilter()
-
- fm.signal_bind('cd', clear_fzf_filter)
- return HOOK_INIT_OLD(fm)
-
-
-ranger.api.hook_init = hook_init
-# endregion overwrite hook_init
-
-# region overwrite accept_file
-ACCEPT_FILE_OLD = ranger.container.directory.accept_file
-
-
-def accept_file(fobj, filters):
- _fzf_filter = fobj.fm.thisdir.__dict__.get(KEY_FZF_FILTER, None)
- if _fzf_filter:
- filters.append(_fzf_filter)
- return ACCEPT_FILE_OLD(fobj, filters)
-
-
-ranger.container.directory.accept_file = accept_file
-# endregion overwrite accept_file
diff --git a/home-manager/programs/ranger/plugins/ranger_fzf_filter/command.py b/home-manager/programs/ranger/plugins/ranger_fzf_filter/command.py
deleted file mode 100644
index 92aee83..0000000
--- a/home-manager/programs/ranger/plugins/ranger_fzf_filter/command.py
+++ /dev/null
@@ -1,59 +0,0 @@
-import ranger.api.commands
-from .filter import FzfFilter
-
-# noinspection PyUnreachableCode
-# This is done to enhance auto-completion and inference in the editor.
-if False:
- import ranger.core.fm
-
-KEY_FZF_FILTER = 'fzf_filter'
-
-
-# noinspection PyPep8Naming,PyUnresolvedReferences
-class fzf_filter(ranger.api.commands.Command):
- """
- :fzf_filter <query>
-
- This command allows you to use fzf fuzzy search to filter files and directories in the ranger.
- """
-
- def execute(self):
- fm = self.fm # type: ranger.core.fm.FM
- # Check if a filter is already set
- _filter = fm.thisdir.__dict__.get(KEY_FZF_FILTER, None)
- if isinstance(_filter, FzfFilter):
- # If a filter is set, just update the query
- _filter.set_query(self._get_query())
- else:
- # If no filter is set, build a new one
- fm.thisdir.__dict__[KEY_FZF_FILTER] = self._build_filter()
-
- fm.thisdir.refilter()
- if self.quickly_executed:
- fm.open_console(self.line)
-
- def cancel(self):
- fm = self.fm # type: ranger.core.fm.FM
- fm.thisdir.__dict__[KEY_FZF_FILTER] = None
- fm.thisdir.refilter()
-
- def quick(self):
- return True
-
- def _get_query(self):
- """
- Get the search query.
-
- Returns:
- str: The search query.
- """
- return self.rest(1)
-
- def _build_filter(self):
- """
- Build a new FzfFilter.
-
- Returns:
- FzfFilter: A new FzfFilter object with the current directory and search query.
- """
- return FzfFilter(self.fm.thisdir, self._get_query())
diff --git a/home-manager/programs/ranger/plugins/ranger_fzf_filter/filter.py b/home-manager/programs/ranger/plugins/ranger_fzf_filter/filter.py
deleted file mode 100644
index 3d12756..0000000
--- a/home-manager/programs/ranger/plugins/ranger_fzf_filter/filter.py
+++ /dev/null
@@ -1,84 +0,0 @@
-import os.path
-import subprocess
-
-
-class FzfFilter:
- """
- A filter class for FZF fuzzy search.
-
- Attributes:
- thisdir (ranger.container.directory.Directory): The current directory.
- query (str): The search query.
- source (list[str]): List of relative paths of all files in the current directory.
- result (list[str]): The result of fzf search.
- """
-
- def __init__(self, thisdir, query):
- """
- Initialize the FzfFilter class.
-
- Args:
- thisdir (ranger.container.directory.Directory): The current directory.
- query (str): The search query.
- """
- self.thisdir = thisdir
- self.files_all = thisdir.files_all
-
- self.query = query
-
- self.source = []
- self.recalc_source()
-
- self.result = []
- self.recalc_result()
-
- def recalc_source(self):
- """
- Recalculate the source list based on the files in the current directory.
- """
- self.source = [f.relative_path for f in self.thisdir.files_all]
-
- def recalc_result(self):
- """
- Recalculate the result list by executing the fzf command.
- """
- cmd = subprocess.Popen(
- ['fzf', '-f', self.query],
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- )
- stdout, _ = cmd.communicate('\n'.join(self.source).encode('utf-8'))
- self.result = stdout.decode('utf-8').strip().splitlines()
-
- def set_query(self, query):
- """
- Update the query and recalculate the result list.
-
- Args:
- query (str): The new search query.
- """
- self.query = query
- self.recalc_result()
-
- def __call__(self, fobj):
- """
- Perform the actual filtering.
-
- Args:
- fobj (ranger.container.file.File | ranger.container.directory.Directory): The file or directory to check.
-
- Returns:
- bool: True if the file or directory is in the result list, False otherwise.
- """
- # Check if the files in the current directory have changed, and if so, recalculate source and result
- if self.thisdir.files_all is not self.files_all:
- self.files_all = self.thisdir.files_all
- self.recalc_source()
- self.recalc_result()
-
- # Ensure the relative path start of the file or directory is in the current directory
- if os.path.relpath(fobj.path, fobj.relative_path) != '.':
- return True
-
- # Check if the relative path of the file or directory is in the result list
- return fobj.relative_path in self.result
diff --git a/home-manager/programs/ranger/rc.conf b/home-manager/programs/ranger/rc.conf
deleted file mode 100644
index 271d239..0000000
--- a/home-manager/programs/ranger/rc.conf
+++ /dev/null
@@ -1,12 +0,0 @@
-map f console fzf_filter%space
-map x quit_cd_wd
-map X quitall_cd_wd
-map <alt>/ console fd_search -d5%space
-map <alt>n fd_next
-map <alt>p fd_prev
-map e shell dragon -x %p &
-map yc YankContent
-set preview_images true
-set preview_images_method kitty
-set use_preview_script True
-map gj cd /run/media/jerpo/
diff --git a/home-manager/programs/ranger/rifle.conf b/home-manager/programs/ranger/rifle.conf
deleted file mode 100644
index 3b565af..0000000
--- a/home-manager/programs/ranger/rifle.conf
+++ /dev/null
@@ -1,284 +0,0 @@
-# vim: ft=cfg
-#
-# This is the configuration file of "rifle", ranger's file executor/opener.
-# Each line consists of conditions and a command. For each line the conditions
-# are checked and if they are met, the respective command is run.
-#
-# Syntax:
-# <condition1> , <condition2> , ... = command
-#
-# The command can contain these environment variables:
-# $1-$9 | The n-th selected file
-# $@ | All selected files
-#
-# If you use the special command "ask", rifle will ask you what program to run.
-#
-# Prefixing a condition with "!" will negate its result.
-# These conditions are currently supported:
-# match <regexp> | The regexp matches $1
-# ext <regexp> | The regexp matches the extension of $1
-# mime <regexp> | The regexp matches the mime type of $1
-# name <regexp> | The regexp matches the basename of $1
-# path <regexp> | The regexp matches the absolute path of $1
-# has <program> | The program is installed (i.e. located in $PATH)
-# env <variable> | The environment variable "variable" is non-empty
-# file | $1 is a file
-# directory | $1 is a directory
-# number <n> | change the number of this command to n
-# terminal | stdin, stderr and stdout are connected to a terminal
-# X | A graphical environment is available (darwin, Xorg, or Wayland)
-#
-# There are also pseudo-conditions which have a "side effect":
-# flag <flags> | Change how the program is run. See below.
-# label <label> | Assign a label or name to the command so it can
-# | be started with :open_with <label> in ranger
-# | or `rifle -p <label>` in the standalone executable.
-# else | Always true.
-#
-# Flags are single characters which slightly transform the command:
-# f | Fork the program, make it run in the background.
-# | New command = setsid $command >& /dev/null &
-# r | Execute the command with root permissions
-# | New command = sudo $command
-# t | Run the program in a new terminal. If $TERMCMD is not defined,
-# | rifle will attempt to extract it from $TERM.
-# | New command = $TERMCMD -e $command
-# Note: The "New command" serves only as an illustration, the exact
-# implementation may differ.
-# Note: When using rifle in ranger, there is an additional flag "c" for
-# only running the current file even if you have marked multiple files.
-
-#-------------------------------------------
-# Websites
-#-------------------------------------------
-# Rarely installed browsers get higher priority; It is assumed that if you
-# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
-# other hand are often only installed as fallback browsers.
-ext x?html?, has surf, X, flag f = surf -- file://"$1"
-ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@"
-ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@"
-ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
-ext x?html?, has dwb, X, flag f = dwb -- "$@"
-ext x?html?, has jumanji, X, flag f = jumanji -- "$@"
-ext x?html?, has luakit, X, flag f = luakit -- "$@"
-ext x?html?, has uzbl, X, flag f = uzbl -- "$@"
-ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@"
-ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@"
-ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@"
-ext x?html?, has midori, X, flag f = midori -- "$@"
-ext x?html?, has opera, X, flag f = opera -- "$@"
-ext x?html?, has firefox, X, flag f = firefox -- "$@"
-ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@"
-ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@"
-ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@"
-ext x?html?, has chromium, X, flag f = chromium -- "$@"
-ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@"
-ext x?html?, has epiphany, X, flag f = epiphany -- "$@"
-ext x?html?, has konqueror, X, flag f = konqueror -- "$@"
-ext x?html?, has elinks, terminal = elinks "$@"
-ext x?html?, has links2, terminal = links2 "$@"
-ext x?html?, has links, terminal = links "$@"
-ext x?html?, has lynx, terminal = lynx -- "$@"
-ext x?html?, has w3m, terminal = w3m "$@"
-
-#-------------------------------------------
-# Misc
-#-------------------------------------------
-# Define the "editor" for text files as first action
-mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
-mime ^text, label pager = "$PAGER" -- "$@"
-!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
-!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
-
-ext 1 = man "$1"
-ext s[wmf]c, has zsnes, X = zsnes "$1"
-ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
-ext nes, has fceux, X = fceux "$1"
-ext exe = wine "$1"
-name ^[mM]akefile$ = make
-
-#--------------------------------------------
-# Scripts
-#-------------------------------------------
-ext py = python -- "$1"
-ext pl = perl -- "$1"
-ext rb = ruby -- "$1"
-ext js = node -- "$1"
-ext sh = sh -- "$1"
-ext php = php -- "$1"
-
-#--------------------------------------------
-# Audio without X
-#-------------------------------------------
-mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
-mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
-mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
-ext midi?, terminal, has wildmidi = wildmidi -- "$@"
-
-#--------------------------------------------
-# Video/Audio with a GUI
-#-------------------------------------------
-mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
-mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
-mime ^video, has mpv, X, flag f = mpv -- "$@"
-mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
-mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
-mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
-mime ^video, has mplayer, X, flag f = mplayer -- "$@"
-mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@"
-mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
-mime ^video|audio, has totem, X, flag f = totem -- "$@"
-mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
-
-#--------------------------------------------
-# Video without X
-#-------------------------------------------
-mime ^video, terminal, !X, has mpv = mpv -- "$@"
-mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
-mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
-
-#-------------------------------------------
-# Documents
-#-------------------------------------------
-ext pdf, has llpp, X, flag f = llpp "$@"
-ext pdf, has zathura, X, flag f = zathura -- "$@"
-ext pdf, has mupdf, X, flag f = mupdf "$@"
-ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
-ext pdf, has apvlv, X, flag f = apvlv -- "$@"
-ext pdf, has xpdf, X, flag f = xpdf -- "$@"
-ext pdf, has evince, X, flag f = evince -- "$@"
-ext pdf, has atril, X, flag f = atril -- "$@"
-ext pdf, has okular, X, flag f = okular -- "$@"
-ext pdf, has epdfview, X, flag f = epdfview -- "$@"
-ext pdf, has qpdfview, X, flag f = qpdfview "$@"
-ext pdf, has open, X, flag f = open "$@"
-
-ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
-
-ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
-ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
-ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
-ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
-ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
-
-ext djvu, has zathura,X, flag f = zathura -- "$@"
-ext djvu, has evince, X, flag f = evince -- "$@"
-ext djvu, has atril, X, flag f = atril -- "$@"
-ext djvu, has djview, X, flag f = djview -- "$@"
-
-ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
-ext epub, has zathura, X, flag f = zathura -- "$@"
-ext epub, has mupdf, X, flag f = mupdf -- "$@"
-ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
-
-ext cbr, has zathura, X, flag f = zathura -- "$@"
-ext cbz, has zathura, X, flag f = zathura -- "$@"
-
-#-------------------------------------------
-# Images
-#-------------------------------------------
-mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
-mime ^image/svg, has display, X, flag f = display -- "$@"
-
-mime ^image, has geeqie, X, flag f = geeqie -- "$@"
-mime ^image, has imv, X, flag f = imv -- "$@"
-mime ^image, has pqiv, X, flag f = pqiv -- "$@"
-mime ^image, has sxiv, X, flag f = sxiv -- "$@"
-mime ^image, has feh, X, flag f = feh -- "$@"
-mime ^image, has mirage, X, flag f = mirage -- "$@"
-mime ^image, has ristretto, X, flag f = ristretto "$@"
-mime ^image, has eog, X, flag f = eog -- "$@"
-mime ^image, has eom, X, flag f = eom -- "$@"
-mime ^image, has nomacs, X, flag f = nomacs -- "$@"
-mime ^image, has gpicview, X, flag f = gpicview -- "$@"
-mime ^image, has gwenview, X, flag f = gwenview -- "$@"
-mime ^image, has gimp, X, flag f = gimp -- "$@"
-ext xcf, X, flag f = gimp -- "$@"
-
-#-------------------------------------------
-# Archives
-#-------------------------------------------
-
-# avoid password prompt by providing empty password
-ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
-# This requires atool
-ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER"
-ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
-ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
-ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
-
-# Listing and extracting archives without atool:
-ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
-ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
-ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
-ext zip, has unzip = unzip -l "$1" | less
-ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
-ext ace, has unace = unace l "$1" | less
-ext ace, has unace = for file in "$@"; do unace e "$file"; done
-ext rar, has unrar = unrar l "$1" | less
-ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
-
-#-------------------------------------------
-# Fonts
-#-------------------------------------------
-mime ^font, has fontforge, X, flag f = fontforge "$@"
-
-#-------------------------------------------
-# Flag t fallback terminals
-#-------------------------------------------
-# Rarely installed terminal emulators get higher priority; It is assumed that
-# if you install a rare terminal emulator, you probably use it.
-# gnome-terminal/konsole/xterm on the other hand are often installed as part of
-# a desktop environment or as fallback terminal emulators.
-mime ^ranger/x-terminal-emulator, has terminology = terminology -e "$@"
-mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@"
-mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@"
-mime ^ranger/x-terminal-emulator, has sakura = sakura -e "$@"
-mime ^ranger/x-terminal-emulator, has lilyterm = lilyterm -e "$@"
-#mime ^ranger/x-terminal-emulator, has cool-retro-term = cool-retro-term -e "$@"
-mime ^ranger/x-terminal-emulator, has termite = termite -x '"$@"'
-#mime ^ranger/x-terminal-emulator, has yakuake = yakuake -e "$@"
-mime ^ranger/x-terminal-emulator, has guake = guake -ne "$@"
-mime ^ranger/x-terminal-emulator, has tilda = tilda -c "$@"
-mime ^ranger/x-terminal-emulator, has st = st -e "$@"
-mime ^ranger/x-terminal-emulator, has terminator = terminator -x "$@"
-mime ^ranger/x-terminal-emulator, has urxvt = urxvt -e "$@"
-mime ^ranger/x-terminal-emulator, has pantheon-terminal = pantheon-terminal -e "$@"
-mime ^ranger/x-terminal-emulator, has lxterminal = lxterminal -e "$@"
-mime ^ranger/x-terminal-emulator, has mate-terminal = mate-terminal -x "$@"
-mime ^ranger/x-terminal-emulator, has xfce4-terminal = xfce4-terminal -x "$@"
-mime ^ranger/x-terminal-emulator, has konsole = konsole -e "$@"
-mime ^ranger/x-terminal-emulator, has gnome-terminal = gnome-terminal -- "$@"
-mime ^ranger/x-terminal-emulator, has xterm = xterm -e "$@"
-
-#-------------------------------------------
-# Misc
-#-------------------------------------------
-label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
-label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
-label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
-label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
-
-#-------------------------------------------
-# Generic file openers
-#-------------------------------------------
-label open, has xdg-open = xdg-open -- "$@"
-label open, has open = open -- "$@"
-
-# Define the editor for non-text files + pager as last action
- !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
-label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
-label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
-
-
-######################################################################
-# The actions below are left so low down in this file on purpose, so #
-# they are never triggered accidentally. #
-######################################################################
-
-# Execute a file as program/script.
-mime application/x-executable = "$1"
-
-# Move the file to trash using trash-cli.
-label trash, has trash-put = trash-put -- "$@"
-label trash = mkdir -p -- ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash; mv -- "$@" ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash
diff --git a/home-manager/programs/ranger/scope.sh b/home-manager/programs/ranger/scope.sh
deleted file mode 100755
index f9c7648..0000000
--- a/home-manager/programs/ranger/scope.sh
+++ /dev/null
@@ -1,351 +0,0 @@
-#!/usr/bin/env bash
-
-set -o noclobber -o noglob -o nounset -o pipefail
-IFS=$'\n'
-
-## If the option `use_preview_script` is set to `true`,
-## then this script will be called and its output will be displayed in ranger.
-## ANSI color codes are supported.
-## STDIN is disabled, so interactive scripts won't work properly
-
-## This script is considered a configuration file and must be updated manually.
-## It will be left untouched if you upgrade ranger.
-
-## Because of some automated testing we do on the script #'s for comments need
-## to be doubled up. Code that is commented out, because it's an alternative for
-## example, gets only one #.
-
-## Meanings of exit codes:
-## code | meaning | action of ranger
-## -----+------------+-------------------------------------------
-## 0 | success | Display stdout as preview
-## 1 | no preview | Display no preview at all
-## 2 | plain text | Display the plain content of the file
-## 3 | fix width | Don't reload when width changes
-## 4 | fix height | Don't reload when height changes
-## 5 | fix both | Don't ever reload
-## 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
-## 7 | image | Display the file directly as an image
-
-## Script arguments
-FILE_PATH="${1}" # Full path of the highlighted file
-PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
-## shellcheck disable=SC2034 # PV_HEIGHT is provided for convenience and unused
-PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
-IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
-PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
-
-FILE_EXTENSION="${FILE_PATH##*.}"
-FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')"
-
-## Settings
-HIGHLIGHT_SIZE_MAX=262143 # 256KiB
-HIGHLIGHT_TABWIDTH=${HIGHLIGHT_TABWIDTH:-8}
-HIGHLIGHT_STYLE=${HIGHLIGHT_STYLE:-pablo}
-HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}"
-PYGMENTIZE_STYLE=${PYGMENTIZE_STYLE:-autumn}
-OPENSCAD_IMGSIZE=${RNGR_OPENSCAD_IMGSIZE:-1000,1000}
-OPENSCAD_COLORSCHEME=${RNGR_OPENSCAD_COLORSCHEME:-Tomorrow Night}
-
-handle_extension() {
- case "${FILE_EXTENSION_LOWER}" in
- ## Archive
- a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
- rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
- atool --list -- "${FILE_PATH}" && exit 5
- bsdtar --list --file "${FILE_PATH}" && exit 5
- exit 1;;
- rar)
- ## Avoid password prompt by providing empty password
- unrar lt -p- -- "${FILE_PATH}" && exit 5
- exit 1;;
- 7z)
- ## Avoid password prompt by providing empty password
- 7z l -p -- "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## PDF
- pdf)
- ## Preview as text conversion
- pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | \
- fmt -w "${PV_WIDTH}" && exit 5
- mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | \
- fmt -w "${PV_WIDTH}" && exit 5
- exiftool "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## BitTorrent
- torrent)
- transmission-show -- "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## OpenDocument
- odt|ods|odp|sxw)
- ## Preview as text conversion
- odt2txt "${FILE_PATH}" && exit 5
- ## Preview as markdown conversion
- pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## XLSX
- xlsx)
- ## Preview as csv conversion
- ## Uses: https://github.com/dilshod/xlsx2csv
- xlsx2csv -- "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## HTML
- htm|html|xhtml)
- ## Preview as text conversion
- w3m -dump "${FILE_PATH}" && exit 5
- lynx -dump -- "${FILE_PATH}" && exit 5
- elinks -dump "${FILE_PATH}" && exit 5
- pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
- ;;
-
- ## JSON
- json)
- jq --color-output . "${FILE_PATH}" && exit 5
- python -m json.tool -- "${FILE_PATH}" && exit 5
- ;;
-
- ## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected
- ## by file(1).
- dff|dsf|wv|wvc)
- mediainfo "${FILE_PATH}" && exit 5
- exiftool "${FILE_PATH}" && exit 5
- ;; # Continue with next handler on failure
- esac
-}
-
-handle_image() {
- ## Size of the preview if there are multiple options or it has to be
- ## rendered from vector graphics. If the conversion program allows
- ## specifying only one dimension while keeping the aspect ratio, the width
- ## will be used.
- local DEFAULT_SIZE="1920x1080"
-
- local mimetype="${1}"
- case "${mimetype}" in
- ## SVG
- # image/svg+xml|image/svg)
- # convert -- "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
- # exit 1;;
-
- ## DjVu
- # image/vnd.djvu)
- # ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \
- # - "${IMAGE_CACHE_PATH}" < "${FILE_PATH}" \
- # && exit 6 || exit 1;;
-
- ## Image
- image/*)
- local orientation
- orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
- ## If orientation data is present and the image actually
- ## needs rotating ("1" means no rotation)...
- if [[ -n "$orientation" && "$orientation" != 1 ]]; then
- ## ...auto-rotate the image according to the EXIF data.
- convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
- fi
- kitty +kitten icat "${IMAGE_CACHE_PATH}"
-
- ## `w3mimgdisplay` will be called for all images (unless overriden
- ## as above), but might fail for unsupported types.
- exit 7;;
-
- ## Video
- video/*)
- # Thumbnail
- ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
- exit 1;;
-
- ## PDF
- application/pdf)
- pdftoppm -f 1 -l 1 \
- -scale-to-x "${DEFAULT_SIZE%x*}" \
- -scale-to-y -1 \
- -singlefile \
- -jpeg -tiffcompression jpeg \
- -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
- && exit 6 || exit 1;;
-
-
- ## ePub, MOBI, FB2 (using Calibre)
- application/epub+zip|application/x-mobipocket-ebook|\
- application/x-fictionbook+xml)
- # ePub (using https://github.com/marianosimone/epub-thumbnailer)
- epub-thumbnailer "${FILE_PATH}" "${IMAGE_CACHE_PATH}" \
- "${DEFAULT_SIZE%x*}" && exit 6
- ebook-meta --get-cover="${IMAGE_CACHE_PATH}" -- "${FILE_PATH}" \
- >/dev/null && exit 6
- exit 1;;
-
- ## Font
- application/font*|application/*opentype)
- preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png"
- if fontimage -o "${preview_png}" \
- --pixelsize "120" \
- --fontname \
- --pixelsize "80" \
- --text " ABCDEFGHIJKLMNOPQRSTUVWXYZ " \
- --text " abcdefghijklmnopqrstuvwxyz " \
- --text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \
- --text " The quick brown fox jumps over the lazy dog. " \
- "${FILE_PATH}";
- then
- convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \
- && rm "${preview_png}" \
- && exit 6
- else
- exit 1
- fi
- ;;
-
- ## Preview archives using the first image inside.
- ## (Very useful for comic book collections for example.)
- # application/zip|application/x-rar|application/x-7z-compressed|\
- # application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar)
- # local fn=""; local fe=""
- # local zip=""; local rar=""; local tar=""; local bsd=""
- # case "${mimetype}" in
- # application/zip) zip=1 ;;
- # application/x-rar) rar=1 ;;
- # application/x-7z-compressed) ;;
- # *) tar=1 ;;
- # esac
- # { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \
- # { fn=$(bsdtar --list --file "${FILE_PATH}") && bsd=1 && tar=""; } || \
- # { [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \
- # { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return
- #
- # fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \
- # [ print(l, end='') for l in sys.stdin if \
- # (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\
- # sort -V | head -n 1)
- # [ "$fn" = "" ] && return
- # [ "$bsd" ] && fn=$(printf '%b' "$fn")
- #
- # [ "$tar" ] && tar --extract --to-stdout \
- # --file "${FILE_PATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6
- # fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g')
- # [ "$bsd" ] && bsdtar --extract --to-stdout \
- # --file "${FILE_PATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6
- # [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}"
- # [ "$rar" ] && unrar p -p- -inul -- "${FILE_PATH}" "$fn" > \
- # "${IMAGE_CACHE_PATH}" && exit 6
- # [ "$zip" ] && unzip -pP "" -- "${FILE_PATH}" "$fe" > \
- # "${IMAGE_CACHE_PATH}" && exit 6
- # [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}"
- # ;;
- esac
-
- # openscad_image() {
- # TMPPNG="$(mktemp -t XXXXXX.png)"
- # openscad --colorscheme="${OPENSCAD_COLORSCHEME}" \
- # --imgsize="${OPENSCAD_IMGSIZE/x/,}" \
- # -o "${TMPPNG}" "${1}"
- # mv "${TMPPNG}" "${IMAGE_CACHE_PATH}"
- # }
-
- # case "${FILE_EXTENSION_LOWER}" in
- # ## 3D models
- # ## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH}
- # ## is hardcoded as jpeg. So we make a tempfile.png and just
- # ## move/rename it to jpg. This works because image libraries are
- # ## smart enough to handle it.
- # csg|scad)
- # openscad_image "${FILE_PATH}" && exit 6
- # ;;
- # 3mf|amf|dxf|off|stl)
- # openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6
- # ;;
- # esac
-}
-
-handle_mime() {
- local mimetype="${1}"
- case "${mimetype}" in
- ## RTF and DOC
- text/rtf|*msword)
- ## Preview as text conversion
- ## note: catdoc does not always work for .doc files
- ## catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/
- catdoc -- "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## DOCX, ePub, FB2 (using markdown)
- ## You might want to remove "|epub" and/or "|fb2" below if you have
- ## uncommented other methods to preview those formats
- *wordprocessingml.document|*/epub+zip|*/x-fictionbook+xml)
- ## Preview as markdown conversion
- pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## XLS
- *ms-excel)
- ## Preview as csv conversion
- ## xls2csv comes with catdoc:
- ## http://www.wagner.pp.ru/~vitus/software/catdoc/
- xls2csv -- "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## Text
- text/* | */xml)
- ## Syntax highlight
- if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
- exit 2
- fi
- if [[ "$( tput colors )" -ge 256 ]]; then
- local pygmentize_format='terminal256'
- local highlight_format='xterm256'
- else
- local pygmentize_format='terminal'
- local highlight_format='ansi'
- fi
- env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \
- --out-format="${highlight_format}" \
- --force -- "${FILE_PATH}" && exit 5
- env COLORTERM=8bit bat --color=always --style="plain" \
- -- "${FILE_PATH}" && exit 5
- pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\
- -- "${FILE_PATH}" && exit 5
- exit 2;;
-
- ## DjVu
- image/vnd.djvu)
- ## Preview as text conversion (requires djvulibre)
- djvutxt "${FILE_PATH}" | fmt -w "${PV_WIDTH}" && exit 5
- exiftool "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## Image
- image/*)
- ## Preview as text conversion
- # img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
- exiftool "${FILE_PATH}" && exit 5
- exit 1;;
-
- ## Video and audio
- video/* | audio/*)
- mediainfo "${FILE_PATH}" && exit 5
- exiftool "${FILE_PATH}" && exit 5
- exit 1;;
- esac
-}
-
-handle_fallback() {
- echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5
- exit 1
-}
-
-
-MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
-if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
- handle_image "${MIMETYPE}"
-fi
-handle_extension
-handle_mime "${MIMETYPE}"
-handle_fallback
-
-exit 1
diff --git a/home-manager/programs/rofi/config.rasi b/home-manager/programs/rofi/config.rasi
deleted file mode 100644
index 55e75a7..0000000
--- a/home-manager/programs/rofi/config.rasi
+++ /dev/null
@@ -1,156 +0,0 @@
-configuration {
-/* modes: "window,drun,run,ssh";*/
-/* font: "mono 12";*/
- location: 0;
- yoffset: 0;
- xoffset: 0;
-/* fixed-num-lines: true;*/
-/* show-icons: false;*/
-/* terminal: "rofi-sensible-terminal";*/
-/* ssh-client: "ssh";*/
-/* ssh-command: "{terminal} -e {ssh-client} {host} [-p {port}]";*/
-/* run-command: "{cmd}";*/
-/* run-list-command: "";*/
-/* run-shell-command: "{terminal} -e {cmd}";*/
-/* window-command: "wmctrl -i -R {window}";*/
-/* window-match-fields: "all";*/
-/* icon-theme: ;*/
-/* drun-match-fields: "name,generic,exec,categories,keywords";*/
-/* drun-categories: ;*/
-/* drun-show-actions: false;*/
-/* drun-display-format: "{name} [<span weight='light' size='small'><i>({generic})</i></span>]";*/
-/* drun-url-launcher: "xdg-open";*/
-/* disable-history: false;*/
-/* ignored-prefixes: "";*/
-/* sort: false;*/
-/* sorting-method: "normal";*/
-/* case-sensitive: false;*/
- cycle: true;
-/* sidebar-mode: false;*/
-/* hover-select: false;*/
-/* eh: 1;*/
-/* auto-select: false;*/
-/* parse-hosts: false;*/
-/* parse-known-hosts: true;*/
-/* combi-modes: "window,run";*/
-/* matching: "normal";*/
-/* tokenize: true;*/
-/* m: "-5";*/
-/* filter: ;*/
-/* dpi: -1;*/
-/* threads: 0;*/
-/* scroll-method: 0;*/
-/* window-format: "{w} {c} {t}";*/
-/* click-to-exit: true;*/
-/* max-history-size: 25;*/
-/* combi-hide-mode-prefix: false;*/
-/* combi-display-format: "{mode} {text}";*/
-/* matching-negate-char: '-' /* unsupported */;*/
-/* cache-dir: ;*/
-/* window-thumbnail: false;*/
-/* drun-use-desktop-cache: false;*/
-/* drun-reload-desktop-cache: false;*/
-/* normalize-match: false;*/
-/* steal-focus: false;*/
-/* application-fallback-icon: ;*/
-/* refilter-timeout-limit: 8192;*/
-/* xserver-i300-workaround: false;*/
-/* pid: "/run/user/1000/rofi.pid";*/
-/* display-window: ;*/
-/* display-windowcd: ;*/
-/* display-run: ;*/
-/* display-ssh: ;*/
-/* display-drun: ;*/
-/* display-combi: ;*/
-/* display-keys: ;*/
-/* display-filebrowser: ;*/
-/* display-emoji: ;*/
-/* display-calc: ;*/
-/* kb-primary-paste: "Control+V,Shift+Insert";*/
-/* kb-secondary-paste: "Control+v,Insert";*/
-/* kb-clear-line: "Control+w";*/
-/* kb-move-front: "Control+a";*/
-/* kb-move-end: "Control+e";*/
-/* kb-move-word-back: "Alt+b,Control+Left";*/
-/* kb-move-word-forward: "Alt+f,Control+Right";*/
-/* kb-move-char-back: "Left,Control+b";*/
-/* kb-move-char-forward: "Right,Control+f";*/
-/* kb-remove-word-back: "Control+Alt+h,Control+BackSpace";*/
-/* kb-remove-word-forward: "Control+Alt+d";*/
-/* kb-remove-char-forward: "Delete,Control+d";*/
-/* kb-remove-char-back: "BackSpace,Shift+BackSpace,Control+h";*/
-/* kb-remove-to-eol: "Control+k";*/
-/* kb-remove-to-sol: "Control+u";*/
-/* kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";*/
-/* kb-accept-custom: "Control+Return";*/
-/* kb-accept-custom-alt: "Control+Shift+Return";*/
-/* kb-accept-alt: "Shift+Return";*/
-/* kb-delete-entry: "Shift+Delete";*/
-/* kb-mode-next: "Shift+Right,Control+Tab";*/
-/* kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";*/
-/* kb-mode-complete: "Control+l";*/
-/* kb-row-left: "Control+Page_Up";*/
-/* kb-row-right: "Control+Page_Down";*/
-/* kb-row-up: "Up,Control+p";*/
-/* kb-row-down: "Down,Control+n";*/
-/* kb-row-tab: "";*/
-/* kb-element-next: "Tab";*/
-/* kb-element-prev: "ISO_Left_Tab";*/
-/* kb-page-prev: "Page_Up";*/
-/* kb-page-next: "Page_Down";*/
-/* kb-row-first: "Home,KP_Home";*/
-/* kb-row-last: "End,KP_End";*/
-/* kb-row-select: "Control+space";*/
-/* kb-screenshot: "Alt+S";*/
-/* kb-ellipsize: "Alt+period";*/
-/* kb-toggle-case-sensitivity: "grave,dead_grave";*/
-/* kb-toggle-sort: "Alt+grave";*/
-/* kb-cancel: "Escape,Control+g,Control+bracketleft";*/
-/* kb-custom-1: "Alt+1";*/
-/* kb-custom-2: "Alt+2";*/
-/* kb-custom-3: "Alt+3";*/
-/* kb-custom-4: "Alt+4";*/
-/* kb-custom-5: "Alt+5";*/
-/* kb-custom-6: "Alt+6";*/
-/* kb-custom-7: "Alt+7";*/
-/* kb-custom-8: "Alt+8";*/
-/* kb-custom-9: "Alt+9";*/
-/* kb-custom-10: "Alt+0";*/
-/* kb-custom-11: "Alt+exclam";*/
-/* kb-custom-12: "Alt+at";*/
-/* kb-custom-13: "Alt+numbersign";*/
-/* kb-custom-14: "Alt+dollar";*/
-/* kb-custom-15: "Alt+percent";*/
-/* kb-custom-16: "Alt+dead_circumflex";*/
-/* kb-custom-17: "Alt+ampersand";*/
-/* kb-custom-18: "Alt+asterisk";*/
-/* kb-custom-19: "Alt+parenleft";*/
-/* kb-select-1: "Super+1";*/
-/* kb-select-2: "Super+2";*/
-/* kb-select-3: "Super+3";*/
-/* kb-select-4: "Super+4";*/
-/* kb-select-5: "Super+5";*/
-/* kb-select-6: "Super+6";*/
-/* kb-select-7: "Super+7";*/
-/* kb-select-8: "Super+8";*/
-/* kb-select-9: "Super+9";*/
-/* kb-select-10: "Super+0";*/
-/* ml-row-left: "ScrollLeft";*/
-/* ml-row-right: "ScrollRight";*/
-/* ml-row-up: "ScrollUp";*/
-/* ml-row-down: "ScrollDown";*/
-/* me-select-entry: "MousePrimary";*/
-/* me-accept-entry: "MouseDPrimary";*/
-/* me-accept-custom: "Control+MouseDPrimary";*/
- timeout {
- action: "kb-cancel";
- delay: 0;
- }
- filebrowser {
- directories-first: true;
- sorting-method: "name";
- }
- plugin {
- path: "/nix/store/dllm74vs7qfrcsnwwsjcs4w0x70d67ps-rofi-1.7.5/lib/rofi";
- }
-}
diff --git a/home-manager/programs/rofi/default.nix b/home-manager/programs/rofi/default.nix
deleted file mode 100644
index 3a78868..0000000
--- a/home-manager/programs/rofi/default.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ pkgs, ... }:
-
-let
- theme = ./squared-material-pine.rasi;
- cycle = true;
- plugins = with pkgs; [
- rofi-emoji
- rofi-calc
- ];
- extraConfig = {
- kb-row-up = "Up,Alt+k";
- kb-row-down = "Down,Alt+j";
- };
-in
-{
- home.packages = with pkgs; [ rbw rofi-rbw pinentry ];
- programs.rofi = {
- enable = true;
- package = pkgs.rofi-wayland;
- inherit theme cycle plugins extraConfig;
- };
-}
diff --git a/home-manager/programs/rofi/squared-material-pine.rasi b/home-manager/programs/rofi/squared-material-pine.rasi
deleted file mode 100644
index 55434cf..0000000
--- a/home-manager/programs/rofi/squared-material-pine.rasi
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * ROFI SQUARED THEME USING THE MATERIAL DARKER PALETTE
- * User : LR-Tech
- * Theme Repo : https://github.com/lr-tech/rofi-themes-collection
- *******************************************************************************/
-
-* {
- font: "FiraCode Nerd Font Medium 12";
-
- bg0: #1f1d2e;
- bg1: #2a273f;
- fg0: #908caa;
-
- accent-color: #6e6a86;
- urgent-color: #ffffff;
-
- background-color: transparent;
- text-color: @fg0;
-
- margin: 0;
- padding: 0;
- spacing: 0;
-}
-
-window {
- location: center;
- width: 480;
- y-offset: -160;
-
- background-color: @bg0;
-}
-
-inputbar {
- spacing: 8px;
- padding: 8px;
-
- background-color: @bg1;
-}
-
-prompt, entry, element-icon, element-text {
- vertical-align: 0.5;
-}
-
-prompt {
- text-color: @accent-color;
-}
-
-textbox {
- padding: 8px;
- background-color: @bg1;
-}
-
-listview {
- padding: 4px 0;
- lines: 8;
- columns: 1;
-
- fixed-height: false;
-}
-
-element {
- padding: 8px;
- spacing: 8px;
-}
-
-element normal normal {
- text-color: @fg0;
-}
-
-element normal urgent {
- text-color: @urgent-color;
-}
-
-element normal active {
- text-color: @accent-color;
-}
-
-element selected {
- text-color: @bg0;
-}
-
-element selected normal, element selected active {
- background-color: @accent-color;
-}
-
-element selected urgent {
- background-color: @urgent-color;
-}
-
-element-icon {
- size: 0.8em;
-}
-
-element-text {
- text-color: inherit;
-}
diff --git a/home-manager/programs/waybar/config.jsonc b/home-manager/programs/waybar/config.jsonc
deleted file mode 100644
index 84aeafd..0000000
--- a/home-manager/programs/waybar/config.jsonc
+++ /dev/null
@@ -1,94 +0,0 @@
-{
- "layer": "top", // Waybar at top layer
- "height": 40, // Waybar height (to be removed for auto height)
- "spacing": 8, // Gaps between modules (4px)
- "margin-top": 20,
- "margin-left": 20,
- "margin-right": 20,
- "margin-down": 5,
- "modules-left": ["hyprland/workspaces"],
- "modules-center": ["clock"],
- "modules-right": ["network", "memory", "backlight", "pulseaudio", "hyprland/language", "tray", "battery"],
-
- "hyprland/workspaces": {
- "format": "{icon}",
- "on-click": "activate",
- "all-outputs": false,
- "format-icons": {
- "1": "α",
- "2": "β",
- "3": "γ",
- "4": "δ",
- "5": "ε",
- "urgent": "λ",
- "focused": "σ",
- "default": "ω"}
- },
- "hyprland/language": {
- "format": "{} <span font-family='Material Design Icons' rise='-1000' size='medium'>󰌌</span>",
- "format-ru": "ru",
- "format-en": "en"
- },
- "tray": {
- "spacing": 10
- },
- "clock": {
- // "timezone": "America/New_York",
- "format": "{:%H:%M 󰅐}",
- "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
- "format-alt": "{:%d %h %Y 󰃮}",
- "on-click": "killall calcure || alacritty -t calcure -e calcure;sudo ydotool click 0xc1"
- },
- "memory": {
- "format": "{}% ",
- "on-click": "killall btop || alacritty -t btop -e btop;sudo ydotool click 0xc1"
- },
- "backlight": {
- // "device": "acpi_video1",
- "format": "{percent}% {icon}",
- "format-icons": ["󰃞", "󰃟", "󰃠"]
- },
- "battery": {
- "states": {
- // "good": 95,
- "warning": 30,
- "critical": 15
- },
- "format": "{capacity}% {icon}",
- "format-charging": "{capacity}% 󰂄",
- "format-plugged": "{capacity}% ",
- "format-alt": "{icon}",
- // "format-good": "", // An empty format will hide the module
- // "format-full": "",
- "format-icons": ["󱃍", "󰁼", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"],
- },
- "network": {
- // "interface": "wlp2*", // (Optional) To force the use of this interface
- "format-wifi": "{essid} ({signalStrength}%) 󰤨",
- "format-ethernet": "{ipaddr}/{cidr} ",
- "tooltip-format": "{ifname} via {gwaddr} ",
- "format-linked": "{ifname} (No IP) ",
- "format-disconnected": "󰤫",
- "on-click": "killall connman-gtk || connman-gtk;sudo ydotool click 0xc1"
- },
- "pulseaudio": {
- // "scroll-step": 1, // %, can be a float
- "format": "{volume}% {icon} {format_source}",
- "format-bluetooth": "{volume}% <span font-family='Material Design Icons' rise='-2000' font-size='x-large'>󰥰</span> {format_source}",
- "format-bluetooth-muted": "󰟎 {format_source}",
- "format-muted": "󰝟 {format_source}",
- "format-source": "{volume}% 󰍬",
- "format-source-muted": "󰍭",
- "format-icons": {
- "headphone": "󰋋",
- "hands-free": "",
- "headset": "",
- "phone": "",
- "portable": "",
- "car": "",
- "muted-icon": "󰝟",
- "default": ["󰕿", "󰖀", "󰕾"]
- },
- "on-click": "killall bluetuith || alacritty -t blue -e bluetuith; sudo ydotool click 0xc1"
- },
-}
diff --git a/home-manager/programs/waybar/default.nix b/home-manager/programs/waybar/default.nix
deleted file mode 100644
index 8618718..0000000
--- a/home-manager/programs/waybar/default.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ pkgs, ... }:
-let
- systemd.enable = true;
- package = pkgs.waybar.override {
- swaySupport = false;
- mpdSupport = false;
- };
-
-in
-{
- programs.waybar = {
- enable = true;
- inherit systemd package;
- };
- xdg.configFile = {
- "waybar/config".text = builtins.readFile ./config.jsonc;
- "waybar/style.css".text = builtins.readFile ./style.css;
- };
-}
diff --git a/home-manager/programs/waybar/style.css b/home-manager/programs/waybar/style.css
deleted file mode 100644
index 7f64ae3..0000000
--- a/home-manager/programs/waybar/style.css
+++ /dev/null
@@ -1,31 +0,0 @@
-* {
- font-family: Material Design Icons, Rubik Medium;
- font-size: 14px;
- color: #939ab7;
-}
-
-window#waybar {
- border-radius: 10px;
- background: rgba(36, 39, 58, 0.7);
- border: 3px solid rgba(183, 189, 248, 0.2);
-}
-
-#battery {
- margin-right: 6px;
-}
-
-#workspaces button label {
- font-size: 15px;
- color: #cad3f5;
- transition: all 100ms ease-out;
-}
-
-#workspaces button.active label {
- font-weight: bolder;
- color: #f0c6c6;
- transition: all 100ms ease-out;
-}
-
-#battery {
- color: #f0c6c6;
-}