From 322ad7d05dacb10071b057a91fcaae09a31d7260 Mon Sep 17 00:00:00 2001 From: Adam Dodman Date: Sun, 23 Apr 2017 00:43:18 +0100 Subject: [PATCH] Initial commit --- Xresources | 61 ++++++++++++++++ i3/config | 182 +++++++++++++++++++++++++++++++++++++++++++++++ i3/i3 | 1 + i3/i3blocks | 153 +++++++++++++++++++++++++++++++++++++++ i3/lock.png | Bin 0 -> 7966 bytes i3/lock.sh | 36 ++++++++++ i3/newpass.sh | 14 ++++ i3/passmenu.sh | 12 ++++ i3/powermenu.sh | 15 ++++ makelinks.sh | 4 ++ zsh/gitstatus.py | 66 +++++++++++++++++ zsh/zshgit.sh | 109 ++++++++++++++++++++++++++++ zsh/zshrc | 35 +++++++++ 13 files changed, 688 insertions(+) create mode 100644 Xresources create mode 100644 i3/config create mode 120000 i3/i3 create mode 100644 i3/i3blocks create mode 100644 i3/lock.png create mode 100755 i3/lock.sh create mode 100755 i3/newpass.sh create mode 100755 i3/passmenu.sh create mode 100755 i3/powermenu.sh create mode 100644 makelinks.sh create mode 100644 zsh/gitstatus.py create mode 100644 zsh/zshgit.sh create mode 100644 zsh/zshrc diff --git a/Xresources b/Xresources new file mode 100644 index 0000000..f35a0f7 --- /dev/null +++ b/Xresources @@ -0,0 +1,61 @@ +URxvt*depth: 32 +URxvt*background: #0f0f0f +URxvt*background: rgba:0000/0000/0200/c800 +URxvt*font: xft:Droid Sans Mono for Powerline:size=10 +URxvt*boldFont: xft:Monospace:size=11:bold +URxvt*termName: rxvt +URxvt*foreground: #dedede +URxvt*scrollBar: false +URxvt*matcher.button: 1 +URxvt.transparent: false +URxvt*allow_bold: true +URxvt*urlLauncher: chromium +Xft*dpi: 96 +Xft*antialias: true +Xft*hinting: full + +URxvt*geometry: 85x11 +URxvt*fading: 0 +URxvt*tintColor: #ffffff +URxvt*shading: 0 +URxvt*inheritPixmap: Fckground: #0f0f0f + +! special +*.foreground: #dedede +*.background: #0f0f0f +*.cursorColor: #dedede + +! black +*.color0: #39474a +*.color8: #4c5f63 + +! red +*.color1: #d6341f +*.color9: #e34e3b + +! green +*.color2: #b85a11 +*.color10: #de7c31 + +! yellow +*.color3: #bc5b44 +*.color11: #d2725b + +! blue +*.color4: #2e43df +*.color12: #6676ed + +! magenta +*.color5: #b9924a +*.color13: #d69d55 + +! cyan +*.color6: #3c8696 +*.color14: #5eb1c2 + +! white +*.color7: #ccb7a7 +*.color15: #efd7c4 + +! Rofi Config + diff --git a/i3/config b/i3/config new file mode 100644 index 0000000..810273a --- /dev/null +++ b/i3/config @@ -0,0 +1,182 @@ +# i3 config file (v4) +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +#Named Workspaces +set $ws1 "1:Monitor 1" +set $ws2 "2:Monitor 2" +set $ws3 "3:Monitor 3" +set $ws4 "4:Terms 1" +set $ws5 "5:Terms 2" +set $ws6 6 +set $ws7 7 +set $ws8 8 +set $ws9 9:Comms +set $ws10 10:Misc + +# Setup screens +workspace $ws1 output HDMI-0 +workspace $ws2 output DVI-D-0 +workspace $ws3 output DVI-I-1 +workspace $ws4 output HDMI-0 +workspace $ws9 output DVI-D-0 + +#Cosmetic Changes +for_window [class="^.*"] border pixel 3 + +gaps inner 6 +gaps outer 0 + +# Pwetty Colours! +set $bg-active #D64937 +set $bg-inactive #39474A +set $bg-urgent #5EB1C2 +set $dark-text #0F0F0F +set $light-text #DEDEDE + +# Name Border Background Text Indicator +client.focused $bg-active $bg-active $dark-text $bg-active +client.unfocused $bg-inactive $bg-inactive $light-text $bg-inactive +client.focused_inactive $bg-inactive $bg-inactive $light-text $bg-inactive +client.urgent $bg-urgent $bg-urgent $dark-text $bg-urgent +client.placeholder #000000 #0C0C0C #FFFFFF + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 8 + +# Programs to run on startup: + +# Background Tasks +exec --no-startup-id compton -CG --config ~/.config/compton.conf +exec --no-startup-id feh --bg-scale 'Pictures/1920x1080.png' --bg-scale 'Pictures/2560x1080.png' --bg-scale 'Pictures/1920x1080.png' + +# Set up the workspaces +exec --no-startup-id sleep 5 && teamspeak3 +exec --no-startup-id urxvt -name music -e ncmpcpp + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +#Assign certain programs to certain workspaces +assign [instance="ts3client_linux_amd64"] $ws9 +assign [class="chromium"] $ws3 +assign [instance="music" class="URxvt"] $ws10 + +# start a terminal +bindsym $mod+Return exec urxvt + +# kill focused window +bindsym $mod+q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id rofi -show run + +#Screenshots! +bindsym --release Print exec imgur-screenshot -s +bindsym --release $mod+Print exec imgur-screenshot -f + +#Gist the clipboard: +bindsym --release $mod+p exec gist -cpPR + +#Lock the screen: +bindsym --release $mod+l exec ~/.config/i3/lock.sh + +#Chromium +bindsym --release $mod+c exec chromium + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Tab floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# switch to workspace +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9 +bindsym $mod+Shift+0 move container to workspace $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +#bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" +bindsym $mod+Shift+e exec ~/.config/i3/powermenu.sh + +bindsym $mod+numbersign exec ~/.config/i3/passmenu.sh + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3blocks -c ~/.config/i3/i3blocks + strip_workspace_numbers yes + position bottom +} + diff --git a/i3/i3 b/i3/i3 new file mode 120000 index 0000000..d9ba5ae --- /dev/null +++ b/i3/i3 @@ -0,0 +1 @@ +/home/adam/.config/i3 \ No newline at end of file diff --git a/i3/i3blocks b/i3/i3blocks new file mode 100644 index 0000000..c719113 --- /dev/null +++ b/i3/i3blocks @@ -0,0 +1,153 @@ +# i3blocks config file +# +# Please see man i3blocks for a complete reference! +# The man page is also hosted at http://vivien.github.io/i3blocks +# +# List of valid properties: +# +# align +# color +# command +# full_text +# instance +# interval +# label +# min_width +# name +# separator +# separator_block_width +# short_text +# signal +# urgent + +# Global properties +# +# The top properties below are applied to every block, but can be overridden. +# Each block command defaults to the script name to avoid boilerplate. +command=/usr/lib/i3blocks/$BLOCK_NAME +separator_block_width=15 +markup=none + +# Volume indicator +# +# The first parameter sets the step (and units to display) +# The second parameter overrides the mixer selection +# See the script for details. +[volume] +label=VOL +#label=♪ +instance=Master +#instance=PCM +interval=once +signal=10 + +# Memory usage +# +# The type defaults to "mem" if the instance is not specified. +[memory] +label=MEM +separator=false +interval=30 + +[memory] +label=SWAP +instance=swap +separator=false +interval=30 + +# Disk usage +# +# The directory defaults to $HOME if the instance is not specified. +# The script may be called with a optional argument to set the alert +# (defaults to 10 for 10%). +[disk] +label=HOME +#instance=/mnt/data +interval=30 + +# Network interface monitoring +# +# If the instance is not specified, use the interface used for default route. +# The address can be forced to IPv4 or IPv6 with -4 or -6 switches. +[iface] +#instance=wlan0 +color=#00FF00 +interval=10 +separator=false + +[wifi] +#instance=wlp3s0 +interval=10 +separator=false + +[bandwidth] +#instance=eth0 +interval=5 + +# CPU usage +# +# The script may be called with -w and -c switches to specify thresholds, +# see the script for details. +[cpu_usage] +label=CPU +interval=10 +min_width=CPU: 100.00% +#separator=false + +#[load_average] +#interval=10 + +# Battery indicator +# +# The battery instance defaults to 0. +[battery] +label=BAT +#label=⚡ +#instance=1 +interval=30 + +# Date Time +# +[time] +command=date '+%Y-%m-%d %H:%M:%S' +interval=5 + +# Generic media player support +# +# This displays "ARTIST - SONG" if a music is playing. +# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others. +#[mediaplayer] +#instance=spotify +#interval=5 +#signal=10 + +# OpenVPN support +# +# Support multiple VPN, with colors. +#[openvpn] +#interval=20 + +# Temperature +# +# Support multiple chips, though lm-sensors. +# The script may be called with -w and -c switches to specify thresholds, +# see the script for details. +#[temperature] +#label=TEMP +#interval=10 + +# Key indicators +# +# Add the following bindings to i3 config file: +# +# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks +# bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks +#[keyindicator] +#instance=CAPS +#interval=once +#signal=11 + +#[keyindicator] +#instance=NUM +#interval=once +#signal=11 diff --git a/i3/lock.png b/i3/lock.png new file mode 100644 index 0000000000000000000000000000000000000000..67a15f6b07a1b307616c84a6cc631d3ec4a48139 GIT binary patch literal 7966 zcmaKRcT`i&);?(Hy@alW-b?7Ahu)ij6hT4=MGS<{K|n()mAlmHwCkgrj^e6Z6yUpchZslWT zXdn;wM2f=x*oX!oQ8#EjJVliN6b$Z;@Buj@T--dAIQQDSI6-bsN}Ttl4aE&n>Ihdi zogg&gUXYPFJjfjmapF`_1}O%}-#9=bd|;pe8Nd3u2Uc!W86`uZqw-Z1@F2uRd_+5GQnOq?^SzSa#}jSt z>G}AdESk7_`gnS~dZIw;>L7kY7~IX{PhH?|fT5whu7|e|%ma?l)llNRaUtsF<|Hoz z(UMe?)6i5`myrX5H6`WLp>lFkvYN7TvND=bY4AT-4Ntf)65-+V57y~_v0DEp_Ky~j zsGE^B5NJ0)gp(H96AAh|W_h>&!bM9)LRJPWt9Ij0=D&0K7uM;&aQQb@{r|*@-H;Lc zGqeBCO#jn#BcDI7|IzJDL65q-1QqJiN;Ko=4Q~;E1IuOA8v>2471D<-sxE&{f z{7viX;X(N1RkaQ{CAJuJ8>_v;9%O-h$s_pPZdzH$Z!cZCDFx6Y)8w$20U-x<%C#V;@F-Q(w+Q+uE8n=wONOWrM z$?_MF-^l@F);u`jCK^gEq78tc--eutWOkL6y+1do6A}Kzo5Ib3-!^^wdy=rGU?XRQ zQW#lMbkTH43Qo?aiuh9FEyrmf@T%i*{PqqA2-^M_gm?b1GBXr zt$bu4HhlYP`(AopaV;O;HC7w)smjveFj&t{9k?7t#U!F!`@Y3mNRsrBNrKUBs*))o zZGNiFvISH+cp`OxynK=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p2OeQ-rN~#jB^IJ>Bx{dApGWgJZ*H#k~MC^Zm0+Qr*G=kkZRGOB=w1$l1o1 zJS|#k8Ru3c9*4)#SxWaZYivOysHI2e2whv3Onx>>yBl;Q39-cr$x~zO)-8W$2X9Hc znJi;!>$Gd52zsoWKofRC4`C;cL?8hjUbBQoLe&V%-!3kPa}wRdWC3kkj&+?%tavx) zWDh&7UxOh`-y/dev/null diff --git a/i3/powermenu.sh b/i3/powermenu.sh new file mode 100755 index 0000000..b26d910 --- /dev/null +++ b/i3/powermenu.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +option=$(echo "Lock|Logout|Sleep|Power Off|Restart|Windows" | rofi -sep "|" -dmenu -i -p "Power Menu" -auto-select -hide-scrollbar -width -10 -lines 6 -eh 2 -line-margin 6 -bw 7| xargs) +case $option in + Lock) ./lock.sh;; + Logout) i3-msg exit;; + Sleep) systemctl suspend;; + 'Power Off') systemctl poweroff;; + Restart) systemctl reboot;; + Windows) + windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4` + `sudo efibootmgr -n $windows` + reboot;; +esac +exit 0 diff --git a/makelinks.sh b/makelinks.sh new file mode 100644 index 0000000..c8e7baf --- /dev/null +++ b/makelinks.sh @@ -0,0 +1,4 @@ +#!/bin/sh +ln -s ~/.dotfiles/zsh/zshrc .zshrc +ln -s ~/.dotfiles/i3 ~/.config/i3 +ln -s ~/.dotfiles/Xresources ~/.Xresources diff --git a/zsh/gitstatus.py b/zsh/gitstatus.py new file mode 100644 index 0000000..376f6c6 --- /dev/null +++ b/zsh/gitstatus.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +#Code borrowed from https://github.com/olivierverdier/zsh-git-prompt/ +from __future__ import print_function + +# change this symbol to whatever you prefer +prehash = ':' + +from subprocess import Popen, PIPE + +import sys +gitsym = Popen(['git', 'symbolic-ref', 'HEAD'], stdout=PIPE, stderr=PIPE) +branch, error = gitsym.communicate() + +error_string = error.decode('utf-8') + +if 'fatal: Not a git repository' in error_string: + sys.exit(0) + +branch = branch.decode("utf-8").strip()[11:] + +res, err = Popen(['git','diff','--name-status'], stdout=PIPE, stderr=PIPE).communicate() +err_string = err.decode('utf-8') +if 'fatal' in err_string: + sys.exit(0) +changed_files = [namestat[0] for namestat in res.decode("utf-8").splitlines()] +staged_files = [namestat[0] for namestat in Popen(['git','diff', '--staged','--name-status'], stdout=PIPE).communicate()[0].splitlines()] +nb_changed = len(changed_files) - changed_files.count('U') +nb_U = staged_files.count('U') +nb_staged = len(staged_files) - nb_U +staged = str(nb_staged) +conflicts = str(nb_U) +changed = str(nb_changed) +nb_untracked = len([0 for status in Popen(['git','status','--porcelain',],stdout=PIPE).communicate()[0].decode("utf-8").splitlines() if status.startswith('??')]) +untracked = str(nb_untracked) + +ahead, behind = 0,0 + +if not branch: # not on any branch + branch = prehash + Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0].decode("utf-8")[:-1] +else: + remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].decode("utf-8").strip() + if remote_name: + merge_name = Popen(['git','config','branch.%s.merge' % branch], stdout=PIPE).communicate()[0].decode("utf-8").strip() + if remote_name == '.': # local + remote_ref = merge_name + else: + remote_ref = 'refs/remotes/%s/%s' % (remote_name, merge_name[11:]) + revgit = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % remote_ref],stdout=PIPE, stderr=PIPE) + revlist = revgit.communicate()[0] + if revgit.poll(): # fallback to local + revlist = Popen(['git', 'rev-list', '--left-right', '%s...HEAD' % merge_name],stdout=PIPE, stderr=PIPE).communicate()[0] + behead = revlist.decode("utf-8").splitlines() + ahead = len([x for x in behead if x[0]=='>']) + behind = len(behead) - ahead + +out = ' '.join([ + branch, + str(ahead), + str(behind), + staged, + conflicts, + changed, + untracked, + ]) +print(out, end='') diff --git a/zsh/zshgit.sh b/zsh/zshgit.sh new file mode 100644 index 0000000..b506b96 --- /dev/null +++ b/zsh/zshgit.sh @@ -0,0 +1,109 @@ +# Code borrowed from https://github.com/olivierverdier/zsh-git-prompt + +# To install source this file from your .zshrc file + +# see documentation at http://linux.die.net/man/1/zshexpn +# A: finds the absolute path, even if this is symlinked +# h: equivalent to dirname +export __GIT_PROMPT_DIR=${0:A:h} + +export GIT_PROMPT_EXECUTABLE=${GIT_PROMPT_EXECUTABLE:-"python"} + +# Initialize colors. +autoload -U colors +colors + +# Allow for functions in the prompt. +setopt PROMPT_SUBST + +autoload -U add-zsh-hook + +add-zsh-hook chpwd chpwd_update_git_vars +add-zsh-hook preexec preexec_update_git_vars +add-zsh-hook precmd precmd_update_git_vars + +## Function definitions +function preexec_update_git_vars() { + case "$2" in + git*|hub*|gh*|stg*) + __EXECUTED_GIT_COMMAND=1 + ;; + esac +} + +function precmd_update_git_vars() { + if [ -n "$__EXECUTED_GIT_COMMAND" ] || [ ! -n "$ZSH_THEME_GIT_PROMPT_CACHE" ]; then + update_current_git_vars + unset __EXECUTED_GIT_COMMAND + fi +} + +function chpwd_update_git_vars() { + update_current_git_vars +} + +function update_current_git_vars() { + unset __CURRENT_GIT_STATUS + + if [[ "$GIT_PROMPT_EXECUTABLE" == "python" ]]; then + local gitstatus="$__GIT_PROMPT_DIR/gitstatus.py" + _GIT_STATUS=`python ${gitstatus} 2>/dev/null` + fi + if [[ "$GIT_PROMPT_EXECUTABLE" == "haskell" ]]; then + _GIT_STATUS=`git status --porcelain --branch &> /dev/null | $__GIT_PROMPT_DIR/src/.bin/gitstatus` + fi + __CURRENT_GIT_STATUS=("${(@s: :)_GIT_STATUS}") + GIT_BRANCH=$__CURRENT_GIT_STATUS[1] + GIT_AHEAD=$__CURRENT_GIT_STATUS[2] + GIT_BEHIND=$__CURRENT_GIT_STATUS[3] + GIT_STAGED=$__CURRENT_GIT_STATUS[4] + GIT_CONFLICTS=$__CURRENT_GIT_STATUS[5] + GIT_CHANGED=$__CURRENT_GIT_STATUS[6] + GIT_UNTRACKED=$__CURRENT_GIT_STATUS[7] +} + + +git_super_status() { + precmd_update_git_vars + if [ -n "$__CURRENT_GIT_STATUS" ]; then + STATUS="$ZSH_THEME_GIT_PROMPT_PREFIX$ZSH_THEME_GIT_PROMPT_BRANCH$GIT_BRANCH%{${reset_color}%}" + if [ "$GIT_BEHIND" -ne "0" ]; then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_BEHIND$GIT_BEHIND%{${reset_color}%}" + fi + if [ "$GIT_AHEAD" -ne "0" ]; then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD$GIT_AHEAD%{${reset_color}%}" + fi + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_SEPARATOR" + if [ "$GIT_STAGED" -ne "0" ]; then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED$GIT_STAGED%{${reset_color}%}" + fi + if [ "$GIT_CONFLICTS" -ne "0" ]; then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CONFLICTS$GIT_CONFLICTS%{${reset_color}%}" + fi + if [ "$GIT_CHANGED" -ne "0" ]; then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CHANGED$GIT_CHANGED%{${reset_color}%}" + fi + if [ "$GIT_UNTRACKED" -ne "0" ]; then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED%{${reset_color}%}" + fi + if [ "$GIT_CHANGED" -eq "0" ] && [ "$GIT_CONFLICTS" -eq "0" ] && [ "$GIT_STAGED" -eq "0" ] && [ "$GIT_UNTRACKED" -eq "0" ]; then + STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_CLEAN" + fi + STATUS="$STATUS%{${reset_color}%}$ZSH_THEME_GIT_PROMPT_SUFFIX" + echo "$STATUS" + fi +} + +# Default values for the appearance of the prompt. Configure at will. +ZSH_THEME_GIT_PROMPT_PREFIX="(" +ZSH_THEME_GIT_PROMPT_SUFFIX=")" +ZSH_THEME_GIT_PROMPT_SEPARATOR="|" +ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg_bold[magenta]%}" +ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[red]%}%{●%G%}" +ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[red]%}%{✖%G%}" +ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[blue]%}%{✚%G%}" +ZSH_THEME_GIT_PROMPT_BEHIND="%{↓%G%}" +ZSH_THEME_GIT_PROMPT_AHEAD="%{↑%G%}" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{…%G%}" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}%{✔%G%}" + diff --git a/zsh/zshrc b/zsh/zshrc new file mode 100644 index 0000000..2dda218 --- /dev/null +++ b/zsh/zshrc @@ -0,0 +1,35 @@ +##General QOL +alias la='ls -lah --color=auto' +alias ls='ls -h --color=auto' + +eval "$(thefuck --alias)" +dme (){ eval $(docker-machine env "$@");} +alias dmssh='docker-machine ssh' +alias dm='docker-machine' + +alias dps='docker ps' +alias dpsa='docker ps -a' +alias drm='docker rm' +alias drmi='docker rmi' +alias dim='docker images' +alias dbl='docker build' +alias dbl.='docker build .' +alias drun='docker run -ti' +alias dkl='docker kill' +alias dalpine='docker run -ti --rm alpine:3.5 /bin/sh' +alias drm-stopped='docker rm -v $(docker ps -a -q -f status=exited)' +alias drmi-untag='docker rmi $(docker images -f "dangling=true" -q)' +dsh() { + docker exec -ti $1 /bin/sh +} + +alias pacup='pacaur -Syu' +alias pacrm='pacaur -Rs' +alias pacadd='pacaur -S' + +alias shred='shred -uzn 5' + +#VirtualEnv +export WORKON_HOME=$HOME/.virtualenvs # optional +export PROJECT_HOME=$HOME/Sync/Programming/Python # optional +source /usr/bin/virtualenvwrapper.sh