Skip to content

Commit

Permalink
Added initial config for dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
unlazy committed Dec 8, 2022
1 parent 75b3751 commit ce65438
Show file tree
Hide file tree
Showing 23 changed files with 897 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .chezmoiexternal.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[".oh-my-zsh"]
type = "archive"
url = "https://github.com/ohmyzsh/ohmyzsh/archive/master.tar.gz"
exact = true
stripComponents = 1
refreshPeriod = "168h"
[".oh-my-zsh/custom/plugins/zsh-autosuggestions"]
type = "archive"
url = "https://github.com/zsh-users/zsh-autosuggestions/archive/master.tar.gz"
exact = true
stripComponents = 1
refreshPeriod = "168h"
[".oh-my-zsh/custom/plugins/zsh-syntax-highlighting"]
type = "archive"
url = "https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz"
exact = true
stripComponents = 1
refreshPeriod = "168h"
4 changes: 4 additions & 0 deletions .chezmoiignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode
README.md
LICENSE
install.sh
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# dotfiles
# github.com/unlazy/dotfiles

dotfiles, managed with [`chezmoi`](https://github.com/twpayne/chezmoi).

## Install

This'll install Homebrew and chezmoi. After installation `chezmoi` will be initialized.

```shell
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/unlazy/dotfiles/master/install.sh)"
```

## Firefox styling

TODO.
13 changes: 13 additions & 0 deletions dot_fzf.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin"
fi

# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null

# Key bindings
# ------------
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh"
28 changes: 28 additions & 0 deletions dot_zplug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[ -d /usr/local/opt/zplug ] && export ZPLUG_HOME=/usr/local/opt/zplug
[ -d /opt/homebrew/opt/zplug ] && export ZPLUG_HOME=/opt/homebrew/opt/zplug

source $ZPLUG_HOME/init.zsh

# zplug "plugins/nvm", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/autojump", from:oh-my-zsh

# zplug "bigH/git-fuzzy", as:command, use:"bin/git-fuzzy"

# zplug "junegunn/fzf", use:"shell/*.zsh", defer:2
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "zsh-users/zsh-autosuggestions", as:plugin, defer:2
zplug 'zsh-users/zsh-completions', depth:1 # more completions

zplug "mafredri/zsh-async", from:github
zplug "sindresorhus/pure", use:pure.zsh, from:github, at:main, as:theme

zplug load

# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
126 changes: 126 additions & 0 deletions dot_zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000

# zsh options: http://zsh.sourceforge.net/Doc/Release/Options.html
setopt APPEND_HISTORY # adds history
setopt HIST_IGNORE_ALL_DUPS # If a new command line being added to the history list duplicates an older one, the older command is removed from the list
setopt HIST_IGNORE_SPACE # No history when starting command with space
setopt HIST_SAVE_NO_DUPS # When writing out the history file, older commands that duplicate newer ones are omitted

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# ZSH_THEME="robbyrussell"
ZSH_THEME=""

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time

# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# plugins=(git zsh-autosuggestions zsh-syntax-highlighting macos)

source $ZSH/oh-my-zsh.sh

# User configuration

setopt HIST_IGNORE_ALL_DUPS

export EDITOR='micro'

# Load plugins
[ -f ~/.zplug.sh ] && source ~/.zplug.sh

[ -f $(brew --prefix)/etc/profile.d/autojump.sh ] && . $(brew --prefix)/etc/profile.d/autojump.sh

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
24 changes: 24 additions & 0 deletions firefox/chrome/experimental/center-url-bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Centeres the url bar based on the number of toolbar buttons.
navbar left padding: 90
navbar right padding: 8
left toolbar items count: 5
right toolbar items count: 3
toolbar item width: 38
regular value: 90 - 8 + (5 - 3) * 38 = 158px
fullscreen value: (5 - 3) * 38 = 76px
*/

#nav-bar toolbarspring:last-of-type:before {
display: block;
content: "";
width: 158px;
}

#main-window[inFullscreen] #nav-bar toolbarspring:last-of-type:before {
display: block;
content: "";
width: 76px;
}
17 changes: 17 additions & 0 deletions firefox/chrome/experimental/compact-nav-bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Enables compact navigation bar.
*/

#nav-bar {
height: 38px !important;
}

.titlebar-buttonbox-container {
left: 0px !important;
top: 12px !important;
}

#urlbar:not([open]) #urlbar-background {
margin-top: 1px !important;
height: 26px !important;
}
9 changes: 9 additions & 0 deletions firefox/chrome/findbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
findbar {
-moz-box-ordinal-group: 0;
background-color: var(--background-color-primary) !important;
background-image: none !important;
}

.findbar-textbox {
margin-left: 2px !important;
}
20 changes: 20 additions & 0 deletions firefox/chrome/icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#nav-bar #back-button image {
list-style-image: url("chrome://global/skin/icons/arrow-left.svg") !important;
padding: 5px !important;
}

#nav-bar #forward-button image {
list-style-image: url("chrome://global/skin/icons/arrow-right.svg") !important;
padding: 5px !important;
}

#nav-bar #new-tab-button image {
list-style-image: url("chrome://global/skin/icons/plus.svg") !important;
padding-top: 4px !important;
padding-bottom: 7px !important;
padding-right: 5px !important;
}

#nav-bar #PanelUI-menu-button image {
list-style-image: url("chrome://global/skin/icons/more.svg") !important;
}
66 changes: 66 additions & 0 deletions firefox/chrome/navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#nav-bar {
height: 52px !important;
padding-left: 90px !important;
padding-right: 8px !important;
}

#main-window[inFullscreen] #nav-bar {
padding-left: 8px !important;
}

#nav-bar {
background-color: transparent !important;
}

#navigator-toolbox:not([inFullscreen]) {
/* Not fully transparent value fixes url highlight color in dark mode */
background-color: rgba(0, 0, 0, 0.01) !important;
}

#navigator-toolbox[inFullscreen] {
background-color: var(--background-color-primary) !important;
}

/* Toolbar button look */
:root {
--button-hover-bgcolor: var(--hover-color-primary) !important;
--toolbarbutton-inner-padding: 6px !important;
--toolbarbutton-active-background: var(--hover-color-primary) !important;
}

#nav-bar .toolbarbutton-1 image,
#nav-bar .toolbarbutton-1 .toolbarbutton-badge-stack {
fill: var(--tint-color-primary) !important;
border-radius: 6px !important;
}

#nav-bar .toolbarbutton-1 {
padding: 5px !important;
}

/* Compresses urlbar in navbar */
#nav-bar toolbarspring {
max-width: none !important;
-moz-box-flex: 300 !important;
}

/* width is nav-bar padding-left - padding-right*/
#nav-bar toolbarspring:last-of-type:before {
-moz-box-flex: 1;
display: -moz-box;
content: "";
width: 82px;
}

#main-window[inFullscreen] #nav-bar toolbarspring:last-of-type:before {
-moz-box-flex: 1;
display: -moz-box;
content: "";
width: 0px;
}

#reload-button image,
#stop-button image,
#downloads-button image {
animation-duration: 0s !important;
}
3 changes: 3 additions & 0 deletions firefox/chrome/personaltoolbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#PersonalToolbar {
background-color: transparent !important;
}
10 changes: 10 additions & 0 deletions firefox/chrome/sidebar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#sidebar-box,
#sidebar,
.sidebar-panel,
body {
background: none !important;
}

#sidebar-box {
background-color: var(--background-color-tertiary) !important;
}
Loading

0 comments on commit ce65438

Please sign in to comment.