guest@dotshare [~/groups/shells/zsh] $ ls Useful-zshrc/ | cat

Useful .zshrc (raw, dl)

rabbit386 Oct 07, 2021 (shells/zsh)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
clear
echo ARCH LINUX CUSTOM 
echo It is currently `date +"%H%M hours %Z, %A %B %d, 0%Y"`.
echo User $USER on $TERM displaying `tty`,
echo Running `uname -s -r`.
echo
alias cw="wmctrl -a"
#Short for "change window;" type cw and a substring of a window name and if your window manager respects hints you will be transported there
alias stick="wmctrl -r :ACTIVE: -b toggle,sticky"
#This will make the terminal window sticky across all workspaces/segments of the virtual desktop, if your wm respects standard hints
alias vi="vim"
# Yeah, how could I not, right? Typing "vim" feels as unnatural as saying "vee aye em" like that bald guy on youtube does.
alias sudo="doas"
# That bald guy is right about this one thing, though: sudo is bloat. Doas is much superior for most use cases, though on occasion sudo is better.
alias search="pacman -Ss"
alias update="sudo pacman -Syu"
alias install="sudo pacman -S"
#replace these with your distro's corresponding package manager commands
alias sl="iwctl station list"
#This is to see the status of the wifi card.
alias pg="ping google.com -c 5"
#This is my preferred way to check if the local network is being slow
alias run="./a.out"
#Should be self-explanatory
autoload -U compinit
export PS1="(%l) %~ %# "
#Makes a prompt string of the form "(pts/[n]) [short path] % "
export RPROMPT="%D{%k%M}"
#makes the twenty-four hour time hover across from your prompt.
wmctrl -r :ACTIVE: -T `tty` 2> /dev/null
#sets the name of your terminal to the path of the pseudo-terminal slave that it's connected to, allowing you to say, e.g.
# "cw 1" and if there isn't some window with a 1 in its name (hasn't happened to me yet), the terminal connected to /dev/pts/1 will be raised and focused and you will be transported to it.

CLICK TO VIEW

x

Notes

I use this with cwm and wmctrl. I like to be able to change from one terminal window to another using the “wmctrl -a” command, so I’ve defined a convenient alias for that. As well, it contains commands to make a window “sticky” on various EWMH-compliant WM’s, and various other tasks I undertake on a regular basis. Note that I use doas in preference to sudo, but I haven’t always, so force of habit makes me type “sudo.” There’s an alias for that that you can delete.

Output in a new zsh session looks like:

ARCH LINUX CUSTOM
It is currently 1418 hours EST, Thursday October 07, 02021.
User rabbit on st-256color displaying /dev/pts/0,
Running Linux 5.14.9-arch2-1.

(pts/0) ~ % 1418