Literate config for fish shell.

This commit is contained in:
Phil Bajsicki 2023-08-12 16:45:26 +02:00
parent 912ef5c159
commit a8345fba50
15 changed files with 101 additions and 366 deletions

View file

@ -1,94 +1,35 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- (setq user-full-name "Phil Bajsicki")
;; Place your private configuration here! Remember, you do not need to run 'doom (setq global-auto-revert-mode t)
;; sync' after modifying this file! (setq auth-sources '("~/.authinfo"))
(after! counsel
(setq counsel-outline-display-style 'title))
;; Some functionality uses this to identify you, e.g. GPG configuration, email (setq doom-font (font-spec :family "Iosevka" :size 12 :weight 'semi-light)
;; clients, file templates and snippets. It is optional. doom-variable-pitch-font (font-spec :family "Iosevka" :size 13))
(setq user-full-name "Phil Bajsicki"
user-mail-address "phil@bajsicki.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom:
;;
;; - `doom-font' -- the primary font to use
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;; - `doom-unicode-font' -- for unicode glyphs
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
;;
;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example:
;;
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
;; refresh your font settings. If Emacs still can't find your font, it likely
;; wasn't installed correctly. Font issues are rarely Doom issues!
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-one) (setq doom-theme 'doom-one)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type 'relative) (setq display-line-numbers-type 'relative)
(setq next-screen-context-lines 4) (setq next-screen-context-lines 4)
;; If you use `org' and don't want your org files in the default location below, (after! persp-mode
;; change `org-directory'. It must be set before org loads! (setq persp-emacsclient-init-frame-behaviour-override "main"))
(setq doom-modeline-persp-name t)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cne" 'elgantt-open)
(global-set-key "\C-ch" 'counsel-org-link)
(define-prefix-command 'org-roam-map)
(global-set-key "\C-r" 'org-roam-map)
(define-key org-roam-map "o" 'org-roam-buffer-toggle)
(define-key org-roam-map "f" 'org-roam-node-find)
(define-key org-roam-map "i" 'org-roam-node-insert)
(define-key org-roam-map "n" 'org-roam-capture)
(define-prefix-command 'org-agenda-map)
(global-set-key "\C-a" 'org-agenda-map)
(define-key org-agenda-map "n" 'org-agenda-capture)
(define-key org-agenda-map "a" 'org-agenda)
(setq org-directory "~/enc/org/") (setq org-directory "~/enc/org/")
;; (setq org-tag-alist '2(("TBD"))) (setq org-contacts-files
(file-expand-wildcards "~/enc/org/*.org"))
(setq org-agenda-start-day nil ;; start today
org-agenda-span '14 ;; and show only two weeks
org-agenda-dim-blocked-tasks 'invisible ;; Don't show me any blocked todos. Next actions only - doesn't work for tags searches
;; org-agenda-todo-ignore-scheduled 'future
;; org-agenda-todo-ignore-deadlines 'near
org-agenda-sorting-strategy '((agenda habit-down time-up priority-down category-keep)
(todo priority-down category-keep)
(search category-keep))
org-deadline-warning-days 3
org-agenda-include-diary "~/enc/org/phil-diary.org"
org-agenda-insert-diary-extract-time t
org-log-into-drawer t
org-clock-into-drawer t
org-agenda-log-mode-items '(closed clock state))
(setq org-agenda-files '("~/enc/org/org-agenda-files.org")) (setq-default org-enforce-todo-dependencies t)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ch" 'counsel-org-link)
(global-set-key "\C-cne" 'elgantt-open)
;; from /home/phil/.emacs.d/modules/lang/org/config.el, edited
(setq org-todo-keywords (setq org-todo-keywords
'((sequence '((sequence
"INBOX(i)" "INBOX(i)"
@ -133,39 +74,9 @@
("FIXME" . "#cc9393") ("FIXME" . "#cc9393")
("XXXX*" . "#cc9393"))) ("XXXX*" . "#cc9393")))
(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/elgantt/") (setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/phil.org" "Inbox") "* TODO %i%?")
("i" "idea" entry (file+headline "~/enc/org/phil.org" "Ideas") "* %?")
("d" "reminder" entry (file+headline "~/enc/org/phil.org" "Reminders") "* %i%? \n %U")
(setq elgantt-header-type 'outline
elgantt-draw-overarching-headers t
elgantt-insert-header-even-if-no-timestamp nil
elgantt-scroll-to-current-month-at-startup t)
;; elgantt-even-numbered-line-change 0.1
;; elgantt-timestamps-to-display '(deadline timestamp scheduled timestamp-range)
;; elgantt-exclusions '(":noexport:" ":ARCHIVE:")
(setq elgantt-user-set-color-priority-counter 0)
(setq elgantt-custom-header-line '((:left ((:prop date-at-point
;; you could also use, for example, 'elgantt-get-date-at-point
;; or (lambda () (elgantt-get-date-at-point))
:padding 25)
(:prop todo
:padding 30)))
(:center ((:prop headline)))
(:right ((:prop hashtag
:padding 40
:text-props (face (:background "red")))))))
(setq org-superstar-special-todo-items t)
(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/inbox.org" "Inbox") "* TODO %i%?")
("c" "work curve10" entry (file+headline "~/enc/org/inbox.org" "Curve10 Inbox") "* TODO %i%?")
("e" "work the-engine-room" entry (file+headline "~/enc/org/inbox.org" "The Engine Room Inbox") "* TODO %i%?")
("b" "biz inbox" entry (file+headline "~/enc/org/inbox.org" "Business Inbox") "* TODO %i%?")
("i" "idea" entry (file+headline "~/enc/org/inbox.org" "Ideas") "* %?")
("d" "reminder" entry (file+headline "~/enc/org/inbox.org" "Reminders") "* %i%? \n %U")
("p" "person" entry (file+headline "~/enc/org/people.org" "People") ("p" "person" entry (file+headline "~/enc/org/people.org" "People")
"* %(org-contacts-template-name) "* %(org-contacts-template-name)
:PROPERTIES: :PROPERTIES:
@ -179,26 +90,31 @@
:ADDRESS: :ADDRESS:
:BIRTHDAY: :BIRTHDAY:
:END:"))) :END:")))
(org-wild-notifier-mode) (org-wild-notifier-mode)
(setq org-wild-notifier-alert-time '(10)) (setq org-wild-notifier-alert-time '(10))
(setq org-wild-notifier-notification-title "Emacs org-mode agenda") (setq org-wild-notifier-notification-title "Emacs org-mode agenda")
(setq org-wild-notifier-keyword-whitelist nil) (setq org-wild-notifier-keyword-whitelist '("TODO"))
;; (setq org-refile-targets '(("~/enc/org/" :maxlevel . 2)))
(setq org-refile-targets '((nil :maxlevel . 9) (setq org-refile-targets '((nil :maxlevel . 9)
(org-agenda-files :maxlevel . 9))) (org-agenda-files :maxlevel . 9)))
(setq org-outline-path-complete-in-steps nil) ; Refile in a single go (setq org-outline-path-complete-in-steps nil)
(setq org-refile-use-outline-path t) ; Show full paths for refiling (setq org-refile-use-outline-path t)
(setq find-file-visit-truename t) (define-prefix-command 'org-roam-map)
(global-set-key "\C-r" 'org-roam-map)
(define-key org-roam-map "o" 'org-roam-buffer-toggle)
(define-key org-roam-map "f" 'org-roam-node-find)
(define-key org-roam-map "i" 'org-roam-node-insert)
(define-key org-roam-map "n" 'org-roam-capture)
(setq org-roam-v2-ack t) (setq org-roam-v2-ack t)
(setq org-roam-completion-everywhere t) (setq org-roam-completion-everywhere t)
(setq org-roam-directory (setq org-roam-directory
(file-truename "~/enc/org/roam")) (file-truename "~/enc/org/roam"))
(org-roam-db-autosync-mode) (org-roam-db-autosync-mode)
(org-roam-db-autosync-enable)
(setq org-roam-capture-templates (setq org-roam-capture-templates
'(("r" "default" plain '(("r" "default" plain
@ -206,101 +122,44 @@
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t))) :unnarrowed t)))
(org-roam-db-autosync-enable) (add-to-list 'load-path "~/.emacs.d/.local/straight/repos/elgantt/")
(setq elgantt-header-type 'outline
elgantt-draw-overarching-headers t
elgantt-insert-header-even-if-no-timestamp nil
elgantt-scroll-to-current-month-at-startup t)
(setq org-contacts-files (setq elgantt-user-set-color-priority-counter 0)
(file-expand-wildcards "~/enc/org/*.org"))
(setq org-fontify-todo-headline t) (setq elgantt-custom-header-line
(setq org-footnote-section nil) '((:left ((:prop date-at-point
(setq org-table-duration-hour-zero-padding nil) :padding 25)
(setq-default org-enforce-todo-dependencies t) (:prop todo
(after! persp-mode :padding 30)))
(setq persp-emacsclient-init-frame-behaviour-override "main")) (:center ((:prop headline)))
(setq doom-modeline-persp-name t) (:right ((:prop hashtag
(setq global-auto-revert-mode t) :padding 40
(setq auth-sources '("~/.authinfo")) :text-props (face (:background "red")))))))
(add-hook 'org-mode-hook (global-set-key "\C-ca" 'org-agenda)
(lambda () (add-hook 'after-save-hook 'org-babel-tangle :append :local))) (define-prefix-command 'org-agenda-map)
(add-hook 'before-save-hook 'time-stamp) (global-set-key "\C-a" 'org-agenda-map)
(define-key org-agenda-map "n" 'org-agenda-capture)
(define-key org-agenda-map "a" 'org-agenda)
(setq org-agenda-files '("~/enc/org/org-agenda-files.org"))
(setq org-agenda-start-day nil
org-agenda-span '14
org-agenda-dim-blocked-tasks 'invisible
org-agenda-sorting-strategy
'((agenda habit-down time-up priority-down category-keep)
(todo priority-down category-keep)
(search category-keep))
org-deadline-warning-days 3
org-agenda-include-diary "~/enc/org/phil-journal.org"
org-agenda-insert-diary-extract-time t
org-log-into-drawer t
org-clock-into-drawer t
org-agenda-log-mode-items '(closed clock state))
(after! counsel (setq doom-snippets-enable-short-helpers t)
(setq counsel-outline-display-style 'title))
;; (after! org-id
;; ;; Do not create ID if a CUSTOM_ID exists
;; (setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id))
;; (defun zz/make-id-for-title (title)
;; "Return an ID based on TITLE."
;; (let* ((new-id (replace-regexp-in-string "[^[:alnum:]]" "-" (downcase title))))
;; new-id))
;; (defun zz/org-custom-id-create ()
;; "Create and store CUSTOM_ID for current heading."
;; (let* ((title (or (nth 4 (org-heading-components)) ""))
;; (new-id (zz/make-id-for-title title)))
;; (org-entry-put nil "CUSTOM_ID" new-id)
;; (org-id-add-location new-id (buffer-file-name (buffer-base-buffer)))
;; new-id))
;; (defun zz/org-custom-id-get-create (&optional where force)
;; "Get or create CUSTOM_ID for heading at WHERE.
;; If FORCE is t, always recreate the property."
;; (org-with-point-at where
;; (let ((old-id (org-entry-get nil "CUSTOM_ID")))
;; ;; If CUSTOM_ID exists and FORCE is false, return it
;; (if (and (not force) old-id (stringp old-id))
;; old-id
;; ;; otherwise, create it
;; (zz/org-custom-id-create)))))
;; ;; Now override counsel-org-link-action
;; (after! counsel
;; (defun counsel-org-link-action (x)
;; "Insert a link to X.
;; X is expected to be a cons of the form (title . point), as passed
;; by `counsel-org-link'.
;; If X does not have a CUSTOM_ID, create it based on the headline
;; title."
;; (let* ((id (zz/org-custom-id-get-create (cdr x))))
;; (org-insert-link nil (concat "#" id) (car x)))))
;; Whenever You Reconfigure A package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To getinformation about an y of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.

View file

@ -95,7 +95,7 @@
(eval +overlay) ; run code, run (also, repls) (eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists ;;gist ; interacting with github gists
lookup ; navigate your code and its documentation lookup ; navigate your code and its documentation
;;lsp ; M-x vscode lsp ; M-x vscode
magit ; a git porcelain for Emacs magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs ;;make ; run make tasks from Emacs
;;pass ; password manager for nerds ;;pass ; password manager for nerds

View file

@ -63,7 +63,7 @@
(package! ivy) (package! ivy)
(package! ivy-xref) (package! ivy-xref)
(package! counsel) (package! counsel)
(package! fish-mode)

161
.config/fish/config.fish Executable file → Normal file
View file

@ -1,53 +1,24 @@
# ____ _____
# | _ \_ _| Derek Taylor (DistroTube)
# | | | || | http://www.youtube.com/c/DistroTube
# | |_| || | http://www.gitlab.com/dwt1/
# |____/ |_|
#
# My fish config. Not much to see here; just some pretty standard stuff.
### ADDING TO THE PATH
# First line removes the path; second line sets it. Without the first line,
# your path gets massive and fish becomes very slow.
set -e fish_user_paths set -e fish_user_paths
set -U fish_user_paths $HOME/.local/bin $HOME/Applications $HOME/.cabal/bin $HOME/.ghcup/bin $fish_user_paths set -U fish_user_paths $HOME/.local/bin $HOME/Applications $HOME/.cabal/bin $HOME/.ghcup/bin $fish_user_paths
set fish_greeting
### EXPORT ### set TERM "xterm-256color"
set fish_greeting # Supresses fish's intro message set EDITOR "emacsclient -t -a ''"
set TERM "xterm-256color" # Sets the terminal type set VISUAL "emacsclient -c -a emacs"
set EDITOR "emacsclient -t -a ''" # $EDITOR use Emacs in terminal
set VISUAL "emacsclient -c -a emacs" # $VISUAL use Emacs in GUI mode
set QT_QPA_PLATFORMTHEME "qt6ct" set QT_QPA_PLATFORMTHEME "qt6ct"
### SET MANPAGER
### Uncomment only one of these!
### "bat" as manpager
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'" set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
### "vim" as manpager
# set -x MANPAGER '/bin/bash -c "vim -MRn -c \"set buftype=nofile showtabline=0 ft=man ts=8 nomod nolist norelativenumber nonu noma\" -c \"normal L\" -c \"nmap q :qa<CR>\"</dev/tty <(col -b)"'
### "nvim" as manpager
# set -x MANPAGER "nvim -c 'set ft=man' -"
### SET EITHER DEFAULT EMACS MODE OR VI MODE ###
function fish_user_key_bindings function fish_user_key_bindings
# fish_default_key_bindings fish_default_key_bindings
fish_vi_key_bindings
end end
### END OF VI MODE ###
### AUTOCOMPLETE AND HIGHLIGHT COLORS ###
set fish_color_normal brcyan set fish_color_normal brcyan
set fish_color_autosuggestion '#7d7d7d' set fish_color_autosuggestion '#7d7d7d'
set fish_color_command brcyan set fish_color_command brcyan
set fish_color_error '#ff6c6b' set fish_color_error '#ff6c6b'
set fish_color_param brcyan set fish_color_param brcyan
### SPARK ###
set -g spark_version 1.0.0 set -g spark_version 1.0.0
complete -xc spark -n __fish_use_subcommand -a --help -d "Show usage help" complete -xc spark -n __fish_use_subcommand -a --help -d "Show usage help"
@ -99,11 +70,7 @@ function spark -d "sparkline generator"
} }
' '
end end
### END OF SPARK ###
### FUNCTIONS ###
# Spark functions
function letters function letters
cat $argv | awk -vFS='' '{for(i=1;i<=NF;i++){ if($i~/[a-zA-Z]/) { w[tolower($i)]++} } }END{for(i in w) print i,w[i]}' | sort | cut -c 3- | spark | lolcat cat $argv | awk -vFS='' '{for(i=1;i<=NF;i++){ if($i~/[a-zA-Z]/) { w[tolower($i)]++} } }END{for(i in w) print i,w[i]}' | sort | cut -c 3- | spark | lolcat
printf '%s\n' 'abcdefghijklmnopqrstuvwxyz' ' ' | lolcat printf '%s\n' 'abcdefghijklmnopqrstuvwxyz' ' ' | lolcat
@ -113,7 +80,6 @@ function commits
git log --author="$argv" --format=format:%ad --date=short | uniq -c | awk '{print $1}' | spark | lolcat git log --author="$argv" --format=format:%ad --date=short | uniq -c | awk '{print $1}' | spark | lolcat
end end
# Functions needed for !! and !$
function __history_previous_command function __history_previous_command
switch (commandline -t) switch (commandline -t)
case "!" case "!"
@ -132,7 +98,7 @@ function __history_previous_command_arguments
commandline -i '$' commandline -i '$'
end end
end end
# The bindings for !! and !$
if [ $fish_key_bindings = "fish_vi_key_bindings" ]; if [ $fish_key_bindings = "fish_vi_key_bindings" ];
bind -Minsert ! __history_previous_command bind -Minsert ! __history_previous_command
bind -Minsert '$' __history_previous_command_arguments bind -Minsert '$' __history_previous_command_arguments
@ -141,16 +107,10 @@ else
bind '$' __history_previous_command_arguments bind '$' __history_previous_command_arguments
end end
# Function for creating a backup file
# ex: backup file.txt
# result: copies file as file.txt.bak
function backup --argument filename function backup --argument filename
cp $filename $filename.bak cp $filename $filename.bak
end end
# Function for copying files and directories, even recursively.
# ex: copy DIRNAME LOCATIONS
# result: copies the directory and all of its contents.
function copy function copy
set count (count $argv | tr -d \n) set count (count $argv | tr -d \n)
if test "$count" = 2; and test -d "$argv[1]" if test "$count" = 2; and test -d "$argv[1]"
@ -162,37 +122,24 @@ function copy
end end
end end
# Function for printing a column (splits input on whitespace)
# ex: echo 1 2 3 | coln 3
# output: 3
function coln function coln
while read -l input while read -l input
echo $input | awk '{print $'$argv[1]'}' echo $input | awk '{print $'$argv[1]'}'
end end
end end
# Function for printing a row
# ex: seq 3 | rown 3
# output: 3
function rown --argument index function rown --argument index
sed -n "$index p" sed -n "$index p"
end end
# Function for ignoring the first 'n' lines
# ex: seq 10 | skip 5
# results: prints everything but the first 5 lines
function skip --argument n function skip --argument n
tail +(math 1 + $n) tail +(math 1 + $n)
end end
# Function for taking the first 'n' lines
# ex: seq 10 | take 5
# results: prints only the first 5 lines
function take --argument number function take --argument number
head -$number head -$number
end end
# Function for org-agenda
function org-search -d "send a search string to org-mode" function org-search -d "send a search string to org-mode"
set -l output (/usr/bin/emacsclient -a "" -e "(message \"%s\" (mapconcat #'substring-no-properties \ set -l output (/usr/bin/emacsclient -a "" -e "(message \"%s\" (mapconcat #'substring-no-properties \
(mapcar #'org-link-display-format \ (mapcar #'org-link-display-format \
@ -205,81 +152,66 @@ function org-search -d "send a search string to org-mode"
printf $output printf $output
end end
### END OF FUNCTIONS ###
### ALIASES ###
alias clear='/bin/clear; echo; echo; seq 1 (tput cols) | sort -R | spark | lolcat; echo; echo' alias clear='/bin/clear; echo; echo; seq 1 (tput cols) | sort -R | spark | lolcat; echo; echo'
# root privileges
alias doas="doas --" alias doas="doas --"
# navigation
alias ..='cd ..' alias ..='cd ..'
alias ...='cd ../..' alias ...='cd ../..'
alias .3='cd ../../..' alias .3='cd ../../..'
alias .4='cd ../../../..' alias .4='cd ../../../..'
alias .5='cd ../../../../..' alias .5='cd ../../../../..'
# vim and emacs
alias vim='nvim' alias vim='nvim'
alias em='/usr/bin/emacs -nw'
alias emacs="emacsclient -c -a 'emacs'"
alias doomsync="~/.emacs.d/bin/doom sync"
alias doomdoctor="~/.emacs.d/bin/doom doctor"
alias doomupgrade="~/.emacs.d/bin/doom upgrade"
alias doompurge="~/.emacs.d/bin/doom purge"
# Changing "ls" to "exa" alias em='/usr/bin/emacs -nw'
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
alias la='exa -a --color=always --group-directories-first' # all files and dirs alias emacs="emacsclient -c -a 'emacs'"
alias ll='exa -l --color=always --group-directories-first' # long format
alias lt='exa -aT --color=always --group-directories-first' # tree listing alias doomsync="~/.config/emacs/bin/doom sync"
alias doomdoctor="~/.config/emacs/bin/doom doctor"
alias doomupgrade="~/.config/emacs/bin/doom upgrade"
alias doompurge="~/.config/emacs/bin/doom purge"
alias ls='exa -al --color=always --group-directories-first'
alias la='exa -a --color=always --group-directories-first'
alias ll='exa -l --color=always --group-directories-first'
alias lt='exa -aT --color=always --group-directories-first'
alias l.='exa -a | egrep "^\."' alias l.='exa -a | egrep "^\."'
# pacman and yay alias pacsyu='sudo pacman -Syyu'
alias pacsyu='sudo pacman -Syyu' # update only standard pkgs
alias yaysua='yay -Sua --noconfirm' # update only AUR pkgs (yay) alias parsua='paru -Sua --noconfirm'
alias yaysyu='yay -Syu --noconfirm' # update standard pkgs and AUR pkgs (yay)
alias parsua='paru -Sua --noconfirm' # update only AUR pkgs (paru) alias parsyu='paru -Syu --noconfirm --sudoloop'
alias parsyu='paru -Syu --noconfirm' # update standard pkgs and AUR pkgs (paru)
alias unlock='sudo rm /var/lib/pacman/db.lck' # remove pacman lock alias unlock='sudo rm /var/lib/pacman/db.lck'
alias cleanup='sudo pacman -Rns (pacman -Qtdq)' # remove orphaned packages
alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
# get fastest mirrors
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist" alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist" alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist" alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist" alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
# Colorize grep output (good for log files)
alias grep='grep --color=auto' alias grep='grep --color=auto'
alias egrep='egrep --color=auto' alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto' alias fgrep='fgrep --color=auto'
# confirm before overwriting something
alias cp="cp -i" alias cp="cp -i"
alias mv='mv -i' alias mv='mv -i'
alias rm='rm -i' alias rm='rm -i'
# adding flags alias df='df -h'
alias df='df -h' # human-readable sizes alias free='free -m'
alias free='free -m' # show sizes in MB
alias lynx='lynx -cfg=~/.lynx/lynx.cfg -lss=~/.lynx/lynx.lss -vikeys'
alias vifm='./.config/vifm/scripts/vifmrun'
alias ncmpcpp='ncmpcpp ncmpcpp_directory=$HOME/.config/ncmpcpp/'
alias mocp='mocp -M "$XDG_CONFIG_HOME"/moc -O MOCDir="$XDG_CONFIG_HOME"/moc'
# ps
alias psa="ps auxf" alias psa="ps auxf"
alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e" alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
alias psmem='ps auxf | sort -nr -k 4' alias psmem='ps auxf | sort -nr -k 4'
alias pscpu='ps auxf | sort -nr -k 3' alias pscpu='ps auxf | sort -nr -k 3'
# Merge Xresources
alias merge='xrdb -merge ~/.Xresources' alias merge='xrdb -merge ~/.Xresources'
# git
alias addup='git add -u' alias addup='git add -u'
alias addall='git add .' alias addall='git add .'
alias branch='git branch' alias branch='git branch'
@ -292,16 +224,12 @@ alias push='git push origin'
alias tag='git tag' alias tag='git tag'
alias newtag='git tag -a' alias newtag='git tag -a'
# get error messages from journalctl
alias jctl="journalctl -p 3 -xb" alias jctl="journalctl -p 3 -xb"
# gpg encryption
# verify signature for isos
alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify" alias gpg-check="gpg2 --keyserver-options auto-key-retrieve --verify"
# receive the key of a developer
alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys" alias gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-keys"
# youtube-dl
alias yta-aac="youtube-dl --extract-audio --audio-format aac " alias yta-aac="youtube-dl --extract-audio --audio-format aac "
alias yta-best="youtube-dl --extract-audio --audio-format best " alias yta-best="youtube-dl --extract-audio --audio-format best "
alias yta-flac="youtube-dl --extract-audio --audio-format flac " alias yta-flac="youtube-dl --extract-audio --audio-format flac "
@ -312,45 +240,18 @@ alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis "
alias yta-wav="youtube-dl --extract-audio --audio-format wav " alias yta-wav="youtube-dl --extract-audio --audio-format wav "
alias ytv-best="youtube-dl -f bestvideo+bestaudio " alias ytv-best="youtube-dl -f bestvideo+bestaudio "
# switch between shells
# I do not recommend switching default SHELL from bash.
alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'" alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'" alias tozsh="sudo chsh $USER -s /bin/zsh && echo 'Now log out.'"
alias tofish="sudo chsh $USER -s /bin/fish && echo 'Now log out.'" alias tofish="sudo chsh $USER -s /bin/fish && echo 'Now log out.'"
# bare git repo alias for dotfiles
alias config="/usr/bin/git --git-dir=$HOME/git/dot --work-tree=$HOME" alias config="/usr/bin/git --git-dir=$HOME/git/dot --work-tree=$HOME"
# termbin
alias tb="nc termbin.com 9999" alias tb="nc termbin.com 9999"
# the terminal rickroll
alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash'
# Unlock LBRY tips
alias tips="lbrynet txo spend --type=support --is_not_my_input --blocking" alias tips="lbrynet txo spend --type=support --is_not_my_input --blocking"
### DTOS ###
# Copy/paste all content of /etc/dtos over to home folder. A backup of config is created. (Be careful running this!)
alias dtoscopy='[ -d ~/.config ] || mkdir ~/.config && cp -Rf ~/.config ~/.config-backup-(date +%Y.%m.%d-%H.%M.%S) && cp -rf /etc/dtos/* ~'
# Backup contents of /etc/dtos to a backup folder in $HOME.
alias dtosbackup='cp -Rf /etc/dtos ~/dtos-backup-(date +%Y.%m.%d-%H.%M.%S)'
### RANDOM COLOR SCRIPT ###
# Get this script from my GitLab: gitlab.com/dwt1/shell-color-scripts
# Or install it from the Arch User Repository: shell-color-scripts
colorscript random colorscript random
### SETTING THE STARSHIP PROMPT ###
starship init fish | source starship init fish | source
### ENVIRONMENT VARIABLES ###
set -gx PATH "$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH" set -gx PATH "$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
if test -f /home/phil/tech/Apps/miniconda3/bin/conda
eval /home/phil/tech/Apps/miniconda3/bin/conda "shell.fish" "hook" $argv | source
end
# <<< conda initialize <<<

View file

@ -18,7 +18,7 @@ SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrbl
SETUVAR fish_color_status:red SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_vi_key_bindings SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_completion:normal SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
SETUVAR fish_pager_color_prefix:cyan\x1e\x2d\x2dbold\x1e\x2d\x2dunderline SETUVAR fish_pager_color_prefix:cyan\x1e\x2d\x2dbold\x1e\x2d\x2dunderline

View file

@ -1,2 +0,0 @@
#!/bin/sh
xrandr --output DP-0 --off --output DP-1 --off --output DP-2 --off --output DP-3 --off --output HDMI-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-4 --off --output eDP-1-1 --mode 1920x1080 --pos 1920x565 --rotate normal

View file

@ -1,7 +0,0 @@
#!/bin/sh
xrandr --output DP-0 --off
xrandr --output DP-1 --off
xrandr --output DP-2 --mode 1920x1080 --rate 60.00 --pos 3840x0 --rotate normal
xrandr --output DP-3 --off
xrandr --output HDMI-0 --mode 1920x1080 --rate 60.00 --pos 0x0 --rotate normal
xrandr --output DP-4 --mode 1920x1080 --rate 165 --pos 1920x0 --rotate normal

View file

@ -1,2 +0,0 @@
#!/bin/sh
xrandr --output DP-0 --off --output DP-1 --off --output DP-2 --off --output DP-3 --off --output HDMI-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-4 --mode 1920x1080 --pos 1920x600 --rotate normal

View file

@ -1,3 +0,0 @@
#!/bin/sh
xrandr --output DP-0 --off --output DP-1 --off --output DP-2 --mode 1920x1080 --rate 144.00 --pos 1920x0 --rotate normal
xrandr --output DP-3 --off --output HDMI-0 --off --output DP-4 --primary --mode 1920x1080 --pos 0x0 --rotate normal

View file

@ -1,2 +0,0 @@
#!/bin/sh
xrandr --output DP-0 --off --output DP-1 --off --output DP-2 --mode 1920x1080 --rate 144.00 --pos 1920x0 --rotate normal --output DP-3 --off --output HDMI-0 --off --output DP-4 --primary --mode 1920x1080 --pos 0x768 --rotate normal

View file

@ -1,2 +0,0 @@
#!/bin/sh
xrandr --output DP-0 --off --output DP-1 --off --output DP-2 --off --output DP-3 --off --output HDMI-0 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-4 --mode 1920x1080 --pos 1920x0 --rotate normal

View file

@ -1,2 +0,0 @@
#!/bin/sh
xrandr --output DP-0 --off --output DP-1 --off --output DP-2 --mode 1920x1080 --rate 144.00 --pos 0x0 --rotate normal --output DP-3 --off --output HDMI-0 --off --output DP-4 --primary --mode 1920x1080 --pos 1920x650 --rotate normal

View file

@ -1,2 +0,0 @@
#!/bin/sh
xrandr --output DP-0 --off --output DP-1 --off --output DP-2 --mode 1920x1080 --rate 144.00 --pos 0x0 --rotate normal --output DP-3 --off --output HDMI-0 --off --output DP-4 --primary --mode 1920x1080 --pos 0x1080 --rotate normal

View file

@ -1,3 +0,0 @@
# dot
My dotfiles.