Skip to content

Instantly share code, notes, and snippets.

@jesseops
Last active February 20, 2017 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesseops/ae4beda4ccf6a6b9751ab4e28fa1bb31 to your computer and use it in GitHub Desktop.
Save jesseops/ae4beda4ccf6a6b9751ab4e28fa1bb31 to your computer and use it in GitHub Desktop.
dotfiles
#!/bin/bash
DIR=/home/jesse/Pictures/.wallpaper
feh --bg-scale `shuf -n1 -e $DIR/*`
#!/bin/bash
# Simple i3lock wrapper
# Requires:
# - i3lock
# - imagemagick
# - ~/Pictures/.wallpaper directory
#
# Potential improvements:
# - Convert wallpapers directly to PNG & replace original image
# - Speed up conversion
# - Check resolution of image against current display rez
#
# Author: Jesse Roberts <jesse@jessops.net>
WP_DIR="/home/jesse/Pictures/.wallpaper"
PNG_DIR="/home/jesse/Pictures/.png-wallpaper"
TEMP_BG=$(shuf -n1 -e "$WP_DIR/"*)
# i3lock only supports PNGs
# Quick check to see if our image will work
if [ "${TEMP_BG: -4}" = ".png" ];
then LOCK_BG="$TEMP_BG"
else
# Create directory for PNG post conversion
if [ ! -d "$PNG_DIR" ];
then mkdir "$PNG_DIR"
fi
# Get filename
BN=$(basename $TEMP_BG)
# New filename
LOCK_BG="$PNG_DIR/${BN::-4}.png"
# Do conversion
convert "$TEMP_BG" "$LOCK_BG"
fi
if [ ! -f "$LOCK_BG" ];
# Only log, fail back to simple lockscreen
then echo "something went wrong converting $TEMP_BG to $LOCK_BG"
fi
i3lock -i "$LOCK_BG"
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Ubuntu Sans Mono 8
# Use Super_L for $mod
set $mod Mod4
# Dat vim keybindings
set $up l
set $down k
set $left j
set $right semicolon
# use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec terminator
# kill focused window
bindsym $mod+Shift+q kill
# change focus
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+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move 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+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# 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'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
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
# 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"
#bar {
# font pango:Ubuntu Mono 10 10
# status_command i3blocks
#}
bindsym --release Control+Mod1+l exec /home/jesse/bin/locker
exec --no-startup-id powerline-lemonbar --i3 --clicks --height 16 -- -a 40 -b -f "DejaVu Sans Mono for Powerline-10" -f "FontAwesome-10"
# Setup gaps
# smart_gaps sets gap to 0 if only one window on workspace
smart_gaps on
smart_borders no_gaps
for_window [class="^.*"] border pixel 1
# Synapse looks bad with a border
for_window [class="Synapse"] border pixel 0
gaps inner 5
gaps outer 10
# Startup a few apps everytime
exec --no-startup-id compton -cb
exec --no-startup-id nm-applet
exec --no-startup-id synapse
# Small script to set background to random image
exec --no-startup-id /home/jesse/bin/fehbg
# 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
# background
# border
# 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=RAM
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
[global_config]
[keybindings]
[layouts]
[[default]]
[[[child1]]]
parent = window0
type = Terminal
[[[window0]]]
parent = ""
type = Window
[plugins]
[profiles]
[[default]]
audible_bell = True
background_color = "#002b36"
background_darkness = 0.92
background_type = transparent
cursor_color = "#aaaaaa"
font = Ubuntu Mono 10
foreground_color = "#839496"
palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
scrollback_infinite = True
use_system_font = False
[Unit]
Description=Starts i3lock when laptop suspends
Before=sleep.target
[Service]
Type=forking
User=jesse
Environment=DISPLAY=:0
ExecStart=/home/jesse/bin/locker
[Install]
WantedBy=sleep.target
# Lines configured by zsh-newuser-install
DEFAULT_USER=jesse
HISTFILE=~/.histfile
HISTSIZE=5000
SAVEHIST=10000
setopt appendhistory autocd
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/jesse/.zshrc'
autoload -Uz compinit
compinit
zstyle ':completion:*' rehash true
# End of lines added by compinstall
setopt COMPLETE_ALIASES
# Custom Aliases
alias ls='ls --color=auto'
alias ll='ls -lah --color=auto'
alias wow='git status'
alias such='git'
PATH=$PATH:/home/jesse/bin
# Antigen
source /home/jesse/bin/antigen/antigen.zsh
antigen use oh-my-zsh
antigen bundle git
antigen bundle pip
antigen bundle command-not-found
antigen bundle zsh-users/zsh-syntax-highlighting
antigen theme pure
antigen apply
export WORKON_HOME=/home/jesse/.virtualenvs
source /usr/bin/virtualenvwrapper.sh
# GOLANG
export GOPATH=~/.go
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$GOPATH/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment