Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got Linux support into a usable state #23

Merged
merged 6 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
78 changes: 0 additions & 78 deletions Demos/demo-homebrew.sh

This file was deleted.

138 changes: 0 additions & 138 deletions Demos/demo-safari-cycle.html

This file was deleted.

80 changes: 80 additions & 0 deletions Linux/dot-aliases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# source this file into .zshrc

if [[ -v LOADED_ALIAS ]]; then return; fi
LOADED_ALIAS=true


# ===========================================
# Aliases

# ... Turn off the Quarantine Bit for all files in local folder
alias qbit="xattr -d com.apple.quarantine ./*"

# ... Eject a volume (type the volume name after)
alias eject="hdiutil detach -verbose -force /Volumes/"

# ... Touch the time and date recursively for all files in current folder
alias touchall="find . -exec touch {} \;"

# ... Tell Time Machine to use higher CPU priority until reboot
alias time-machine-fast="sudo sysctl debug.lowpri_throttle_enabled=0"

# launch the iOS Simulator app from the command line
# you can then type "simulator help" or "simulator list" to see more info
alias simulator="xcrun simctl"

# Recursively remove .DS_Store files
alias cleanupds="find . -type f -name '*.DS_Store' -ls -delete"

# Easier navigation: .., ..., ~ and -
alias ..="cd .."
alias cd..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."

# alias reload!='. ~/.zshrc'

# mv, rm, cp
alias mv='mv -v'
alias rm='rm -i -v'
alias cp='cp -v'

# Use the eza command by default, if installed (better ls)
if ! command -v eza &> /dev/null
then
echo "Tool \`eza\` not found. For a better \`ls\` run: brew install eza"
# Use 'll' to suppress the "show all" flag when listing files
alias ll='ls -oFG --color'
# Use 'lla' to enable "show all" for hidden files beginning with a period
alias lla='ls -oAFG --color'
# Use 'llx' to see the most info, including extended attributes
alias llx='ls -oAFG --color'
# Use 'llt' to see the files sorted by modification time
alias llt='ls -oAFG --color'

else
echo "Aliasing \`ll\` and other \`ls\` commands to use \`eza\`"

alias ll='eza --long --sort=Name --git --git-repos -I "Icon?" --group-directories-first --no-quotes --no-permissions --no-user'
alias lla='eza -a --long --sort=Name --git -I "Icon?" -I ".DS_Store" --group-directories-first'
alias llx='eza -a --long --sort=Name --git -I "Icon?" -I ".DS_Store" --group-directories-first -@ -Z'
alias llt='eza --tree'
fi


# Git can sometimes create locked files in the .git folder, which then
# blocks things like compress tasks, or copying files. Run "unlock" to
# unlock all files in the current folder (and recursively)
alias showlocks="find . -flags +uchg"

alias unlock="find . -flags +uchg -exec chflags nouchg {} \;"

# ... echo $SHELL tells you the default shell, this command
# instead tells you which shell you are presently inside
alias shell-now='ps -p $$'

# original color-coded lsl command: alias lsl='ls -loFGT'
# sorts folders at the top: ls -la | grep "^d" && ls -la | grep -v "^d"
# NOTE: if you sort you lose the LS coloring in the output (sad face)

64 changes: 11 additions & 53 deletions Linux/dot-functions.sh
Original file line number Diff line number Diff line change
@@ -1,68 +1,26 @@
# source this file into .zshrc
#!/bin/zsh

if [[ -v LOADED_FUNCTIONS ]]; then return; fi
LOADED_FUNCTIONS=true


# Functions to make output attractive when running the script
#
# NOTE: some characters in parameters will not work, e.g. "!"
#

# `message` and `error` take two string parameters
message () { printf "\r [\033[00;32m $1\033[0m ] $2\n" }
error () { printf "\r\033[00;31m ** $1\033[0m - \033[00;31m$2 \033[0m \n" }
alert () { printf "\r\033[00;35m >> $1\033[0m $2\n" }
bullet () { printf "\r\033[00;36m ==\033[0m $1 $2\n" }

# `alert` and `bullet` take one parameter
alert () { printf "\r\033[00;35m >> $1\033[0m \n" }
bullet () { printf "\r\033[00;36m ==\033[0m $1\n" }


# Function to find all files recursively under current folder
# ... Find all files recursively under current folder
findall () {
find ./ -name $1 -print 2> /dev/null
}

# Function to create a new directory and enter it
# ... Create a new directory and enter it
md() {
mkdir -p "$@" && cd "$@"
mkdir -p "$@" && cd "$@"
}

# ===========================================
# Aliases

# Easier navigation: .., ..., ~ and -
alias ..="cd .."
alias cd..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."

alias reload!='. ~/.zshrc'

# mv, rm, cp
alias mv='mv -v'
alias rm='rm -i -v'
alias cp='cp -v'

# ... Make 'ls' look a lot prettier
alias ls='ls -FG'
alias lsl='ls -loFGT'
alias lsla='ls -loAFGT'

# ... echo $SHELL tells you the default shell, this command
# instead tells you which shell you are presently inside
alias shell-now='ps -p $$'

# original color-coded lsl command: alias lsl='ls -loFGT'
# sorts folders at the top: ls -la | grep "^d" && ls -la | grep -v "^d"
# NOTE: if you sort you lose the LS coloring in the output (sad face)


# ... Turn off the Quarantine Bit for all files in local folder
alias qbit="xattr -d com.apple.quarantine ./*"

# ... Eject a volume (type the volume name after)
alias eject="hdiutil detach -verbose -force /Volumes/"

# ... Touch the time and date recursively for all files in current folder
alias touchall="find . -exec touch {} \;"

# ... Tell Time Machine to use higher CPU priority until reboot
alias time-machine-fast="sudo sysctl debug.lowpri_throttle_enabled=0"

Loading