Skip to content

Commit

Permalink
#23, #25 Update .env -> .custom
Browse files Browse the repository at this point in the history
  • Loading branch information
michalspano committed Feb 10, 2024
1 parent 3e1f46e commit 368e526
Show file tree
Hide file tree
Showing 23 changed files with 187 additions and 102 deletions.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions .custom/scripts/facetime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

: '
Automated Facetime calling for OS X
- call a number from the CLI with facetime.sh <number>
'

TARGET="$1"

__parse_args() {
if [ -z "$TARGET" ]; then
echo "No number specified!"
exit 1
elif [ "$TARGET" = "-h" ] || [ "$TARGET" = "--help" ]; then
echo "Usage: facetime.sh <number>"
exit 0
fi
}

__call_target() {
echo "Calling $TARGET..."
open facetime://$TARGET
}

__parse_args
__call_target
40 changes: 40 additions & 0 deletions .custom/scripts/git-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

# This script is used to switch between different git credentials

# Usage: git-config.sh <type>
# <type> can be one of the following:
# - personal
# - work
# - uni

__usage() {
echo "Usage: git-config <type>"
exit 1
}

# ensure that the argument is passed
if [ $# -ne 1 ]; then __usage; fi

# logic to switch between different git credentials

# personal
if [ $1 = "personal" ]; then
git config --local user.name "michalspano"
git config --local user.email "[email protected]"

# work
elif [ $1 = "work" ]; then
git config --local user.name "spanoatctk"
git config --local user.email "[email protected]"

# uni
elif [ $1 = "uni" ]; then
git config --local user.name "spano"
git config --local user.email "[email protected]"

# show current git credentials
elif [ $1 = "--show" ] || [ $1 = "-s" ]; then
git config user.name; git config user.email
else __usage # if the argument is not valid
fi
6 changes: 4 additions & 2 deletions .env/icl.sh → .custom/scripts/icl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ elif [ -z "$DAY_COUNT" ]; then DAY_COUNT=""; fi # default 0 = today
COMMAND="`icalBuddy -eep '*' -f -nc -sd eventsToday+${DAY_COUNT}`" # get events

# some names are larger than the width of the terminal; trim them, such that
# they fit within the terminal's width
# they fit within the terminal's width + add extra padding

WIDTH=$(tput cols) # get the width of the current terminal session
PADDING=10 # extra padding to add to the width
WIDTH=$(tput cols) # get the width of the current terminal session
WIDTH=$((WIDTH - PADDING)) # apply padding
COMMAND=$(printf "$COMMAND" | sed -E "s/(.{${WIDTH}}).*/\1/") # trim

case "$2" in
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions .custom/scripts/lockscreen.scpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/osascript

tell application "System Events" to keystroke "q" using {control down, command down}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
92 changes: 92 additions & 0 deletions .custom/zsh/alias.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# ----- { Aliases } ---------------------------------------------------------------------

# --- { vars } --- changed for every user

GH_PROFILE="michalspano" # GitHub profile name [personal]
USER_LOCATION="Göteborg" # User location
# USER_LOCATION="Bratislava" # User location [alternative]

# --- { DEV Tools } ---

alias v="nvim" # nvim to v
alias f="fish" # fish to f, the shell environment
alias z="zathura" # zathura to z
alias zth="open -a Zathura" # zathura to its .app location (self made; FIXME)
alias nf="neofetch" # neofetch to 'nf'"
alias py="/usr/local/bin/python3" # python3 to py
alias jl="/usr/local/bin/julia" # julia to jl
alias numi="open /Applications/Numi.app" # numi (Application) to numi
alias tex-template="$HOME/.custom/scripts/init_latex_template.sh" # Install personal LaTeX template

# alias gh="open 'https://github.com/${GH_PROFILE}'" # open github profile

alias lz="lazygit" # lazygit to lz
alias glw="glow" # glow to glw

# utlralist aliases
alias u="ultralist" # ultralist to u
alias ul="ultralist l" # show the list of tasks
alias ult="ultralist l --notes" # show the list of tasks with notes
alias up="ultralist prioritize" # prioritize the task

alias code="code-insiders" # code-insiders to 'code'
alias sketchybar-reset="brew services restart sketchybar" # restart sketchybar via brew services

alias icl="$HOME/.custom/scripts/icl.sh" # custom tool to show iCal events
alias codesnap="open https://ray.so/" # open codesnap website [custom tool]
alias clr-plt="open https://coolors.co/generate" # generate css color palette

# --- { System } --- | macOS specific

alias sys-sleep="pmset sleepnow" # put system to sleep
alias sys-save="open -b com.apple.ScreenSaver.Engine" # enable save screen mode
alias sys-restart="sudo shutdown -r now" # restart system
alias sys-shutdown="sudo shutdown -h now" # shutdown system
alias sys-lock="$HOME/.custom/scripts/lockscreen.scpt" # lock system
alias sys-new-desktop="$HOME/.custom/scripts/new_dekstop.scpt" # create new desktop

alias icons-on="$HOME/.custom/scripts/icons_on.scpt" # show icons on desktop
alias icons-off="$HOME/.custom/scripts/icons_off.scpt" # hide icons on desktop

alias sc-monitor-on="open /Applications/DisplayLink\ Manager.app" # secondary monitor on
alias sc-monitor-off="$HOME/.custom/scripts/secondary-display-on.scpt" # secondary monitor off

# --- { Personal Extensions } ---

alias wf="curl wttr.in/${USER_LOCATION}\?1nqF"

# Applications (shortcuts)
alias clndr="open https://calendar.notion.so/"
alias facetime="$HOME/.custom/scripts/facetime.sh"
alias dict="open /System/Applications/Dictionary.app"
alias gg="open /Applications/GeoGebra\ Classic\ 6.app"

# Ubersicht CII tools
alias ubso="open /Applications/Übersicht.app" # start the app
alias ubsk="$HOME/.custom/scripts/terminate_ubs.sh" # kill the app

# Spotify CLI
alias sp="spotify" # spotify to 'sp'
alias sps="spotify status" # show current status
alias spn="spotify next" # play next song
alias spp="spotify play" # play song

alias al-sw="$HOME/.custom/scripts/alacritty-theme.sh" # alacritty theme switcher
alias stopwatch="$HOME/.custom/scripts/stopwatch.sh" # stopwatch
alias pipes="/usr/local/Cellar/pipes-sh/1.3.0/bin/pipes.sh" # pipes.sh - screen-saver

# --- { Misc. } ----------------------------------------------------------------------

# alias number="~/.custom/scripts/count.py"
# alias icons="eval ~/.custom/scripts/dump-icons.zsh"

# I just love this segment of the song, so I made I shortcut for listening it.
alias bl-ys="open https://soundcloud.com/user-543006032/bladee-radio-stockholm-mix-w-yung-sherman-031221#t=460"

# osu!

alias osu="open /Applications/osu!.app"
alias osup="open https://osu.ppy.sh/users/6499212"
alias osub="open https://osu.ppy.sh/beatmapsets"

# ----- { Aliases } ---------------------------------------------------------------------
16 changes: 16 additions & 0 deletions .custom/zsh/exports.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ----- { Exports } ---------------------------------------------------------------------

export LANG=en_US.UTF-8 # Set language to US English
export SEM="$HOME/School/SEM" # BSc. university directory
export PATH="/usr/local/sbin:$PATH" # Update PATH for Homebrew
export PATH="$PATH:/Users/michalspano/.bin" # Add custom bin directory
export XDG_CONFIG_HOME="$HOME/.config" # load lazygit config
export JAVA_HOME=$(/usr/libexec/java_home) # java Home dir
export GEM_HOME="/Users/michalspano/.gem" # ruby gems
export NVIM="$HOME/.config/nvim/init.vim" # neovim init file
export PATH=$PATH:/Users/michalspano/.spicetify # spicetify config
export PATH="/usr/local/opt/[email protected]/bin:$PATH" # MongoDB config
export ubs="$HOME/Library/Application Support/Übersicht/widgets" # Location to Uebersich
export icloud="$HOME/Library/Mobile Documents/com~apple~CloudDocs" # Apple iCloud system location

# ----- { Exports } ---------------------------------------------------------------------
File renamed without changes.
File renamed without changes.
File renamed without changes.
81 changes: 0 additions & 81 deletions .env/alias.zsh

This file was deleted.

5 changes: 0 additions & 5 deletions .env/bun.zsh

This file was deleted.

8 changes: 0 additions & 8 deletions .env/new_desktop.scpt

This file was deleted.

12 changes: 6 additions & 6 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ plugins=(
source $ZSH/oh-my-zsh.sh # Initialize OMZ

# Load aliases, exports
[ -f ~/.env/alias.zsh ] && source ~/.env/alias.zsh
[ -f ~/.env/exports.zsh ] && source ~/.env/exports.zsh
[ -f ~/.custom/zsh/alias.zsh ] && source ~/.custom/zsh/alias.zsh
[ -f ~/.custom/zsh/exports.zsh ] && source ~/.custom/zsh/exports.zsh

# Load env prompt, VI mode and tmux configurations.
[ -f ~/.env/prompt.zsh ] && source ~/.env/prompt.zsh
[ -f ~/.env/vi-mode.zsh ] && source ~/.env/vi-mode.zsh
[ -f ~/.env/tmux.zsh ] && source ~/.env/tmux.zsh
# Load custom prompt, VI mode and tmux configurations.
[ -f ~/.custom/zsh/prompt.zsh ] && source ~/.custom/zsh/prompt.zsh
[ -f ~/.custom/zsh/vi-mode.zsh ] && source ~/.custom/zsh/vi-mode.zsh
[ -f ~/.custom/zsh/tmux.zsh ] && source ~/.custom/zsh/tmux.zsh

# ----- { ~/.zshrc } -----------------------------------------------------------

0 comments on commit 368e526

Please sign in to comment.