diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.i3/config b/.i3/config old mode 100644 new mode 100755 index 09cb7be..e00be22 --- a/.i3/config +++ b/.i3/config @@ -49,10 +49,16 @@ bindsym Control+space exec --no-startup-id i3-dmenu-desktop # installed. # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop -## Volume -bindsym XF86AudioRaiseVolume exec amixer -q set Master 2dB+ unmute -bindsym XF86AudioLowerVolume exec amixer -q set Master 2dB- unmute -bindsym XF86AudioMute exec amixer -q set Master toggle +# Pulse Audio controls +## requires alsa-utils pulseaudio +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5% #increase sound volume +bindsym XF86AudioLowerVolume exec --no-startup-id pactl -- set-sink-volume 0 -5% #decrease sound volume +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound + +# Sreen brightness controls +## requires xbacklight +bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness +bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness # change focus bindsym $mod+h focus left @@ -136,7 +142,8 @@ bindsym $mod+Shift+p restart bindsym $mod+Shift+period 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'" ## Lock the screen -bindsym Control+Mod1+l exec i3lock --fuzzy +#bindsym Control+Mod1+l exec i3lock --fuzzy +bindsym Control+Mod1+l exec /home/ahosking/.i3/i3lock-fancy-multimonitor/lock # resize window (you can also use the mouse for that) mode "resize" { diff --git a/.i3/i3 b/.i3/i3 deleted file mode 120000 index 87ca232..0000000 --- a/.i3/i3 +++ /dev/null @@ -1 +0,0 @@ -/home/ahosking/dotfiles/i3 \ No newline at end of file diff --git a/.i3/i3lock-fancy-multimonitor/LICENSE b/.i3/i3lock-fancy-multimonitor/LICENSE new file mode 100755 index 0000000..ff87a9e --- /dev/null +++ b/.i3/i3lock-fancy-multimonitor/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Gui Meira + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/.i3/i3lock-fancy-multimonitor/README.md b/.i3/i3lock-fancy-multimonitor/README.md new file mode 100755 index 0000000..c8ad2a3 --- /dev/null +++ b/.i3/i3lock-fancy-multimonitor/README.md @@ -0,0 +1,31 @@ +# i3lock-fancy-multimonitor +The idea for this project was shamelessly copied from [meskarune](https://github.com/meskarune)'s [i3lock-fancy](https://github.com/meskarune/i3lock-fancy). + +It uses [scrot](http://freecode.com/projects/scrot) to take a screenshot of the desktop, then [ImageMagick](http://www.imagemagick.org/) blurs the image and adds a lock icon and text. + +By using information from [xrandr](http://www.x.org/wiki/Projects/XRandR/) and basic math, this script supports multiple monitor setups, displaying the icon and text centered on all screens. + +The lock icon is different from the original project, with a transparent black circle around it. The text is also an image, making it easier to customize (and to put it at the correct position). Finally, it uses vanilla [i3lock](https://github.com/i3/i3lock) instead of [i3lock-color](https://github.com/eBrnd/i3lock-color). The author of i3lock-color [is not maintaining it anymore](https://github.com/eBrnd/i3lock-color/issues/6). If you want to customize the colors of i3lock, the recommended version of i3lock-color is [this one](https://github.com/Arcaena/i3lock-color), maintained by [Chris Guillott](https://github.com/Arcaena). + +## Installation +Make sure you have all the dependencies: + +``` +sudo apt-get install scrot imagemagick i3lock +``` + +Copy the `lock` script along with the images to some place on your system (e.g.: the i3 folder) and give it execution permission: + +``` +git clone https://github.com/guimeira/i3lock-fancy-multimonitor.git +cp -r i3lock-fancy-multimonitor ~/.i3 +chmod +x ~/.i3/i3lock-fancy-multimonitor/lock +``` + +Create a key binding on your i3 config file (in this example I'm using $mod+p): + +``` +echo "bindsym \$mod+p exec /home//.i3/i3lock-fancy-multimonitor/lock" >> ~/.i3/config +``` + +Now reload the i3 configuration file. By default, the key binding is `$mod+Shift+c`. diff --git a/.i3/i3lock-fancy-multimonitor/lock b/.i3/i3lock-fancy-multimonitor/lock new file mode 100755 index 0000000..4a6bb27 --- /dev/null +++ b/.i3/i3lock-fancy-multimonitor/lock @@ -0,0 +1,59 @@ +#!/bin/bash +# All options are here: http://www.imagemagick.org/Usage/blur/#blur_args +#BLURTYPE="0x5" +#BLURTYPE="0x2" +BLURTYPE="5x3" +#BLURTYPE="2x8" +#BLURTYPE="2x3" + +DISPLAY_RE="([0-9]+)x([0-9]+)\\+([0-9]+)\\+([0-9]+)" +IMAGE_RE="([0-9]+)x([0-9]+)" +FOLDER=`dirname "$BASH_SOURCE"` +LOCK="$FOLDER/lock.png" +TEXT="$FOLDER/text.png" +PARAMS="" +OUTPUT_IMAGE="/tmp/i3lock.png" + +#Take screenshot: +scrot -z $OUTPUT_IMAGE + +#Get dimensions of the lock image: +LOCK_IMAGE_INFO=`identify $LOCK` +[[ $LOCK_IMAGE_INFO =~ $IMAGE_RE ]] +IMAGE_WIDTH=${BASH_REMATCH[1]} +IMAGE_HEIGHT=${BASH_REMATCH[2]} + +#Get dimensions of the text image: +TEXT_IMAGE_INFO=`identify $TEXT` +[[ $TEXT_IMAGE_INFO =~ $IMAGE_RE ]] +TEXT_WIDTH=${BASH_REMATCH[1]} +TEXT_HEIGHT=${BASH_REMATCH[2]} + +#Execute xrandr to get information about the monitors: +while read LINE +do + #If we are reading the line that contains the position information: + if [[ $LINE =~ $DISPLAY_RE ]]; then + #Extract information and append some parameters to the ones that will be given to ImageMagick: + WIDTH=${BASH_REMATCH[1]} + HEIGHT=${BASH_REMATCH[2]} + X=${BASH_REMATCH[3]} + Y=${BASH_REMATCH[4]} + POS_X=$(($X+$WIDTH/2-$IMAGE_WIDTH/2)) + POS_Y=$(($Y+$HEIGHT/2-$IMAGE_HEIGHT/2)) + TEXT_X=$(($X+$WIDTH/2-$TEXT_WIDTH/2)) + TEXT_Y=$(($Y+$HEIGHT/2-$TEXT_HEIGHT/2+200)) + + PARAMS="$PARAMS '$LOCK' '-geometry' '+$POS_X+$POS_Y' '-composite' '$TEXT' '-geometry' '+$TEXT_X+$TEXT_Y' '-composite'" + fi +done <<<"`xrandr`" + +#Execute ImageMagick: +PARAMS="'$OUTPUT_IMAGE' '-level' '0%,100%,0.6' '-blur' '$BLURTYPE' $PARAMS '$OUTPUT_IMAGE'" +eval convert $PARAMS + +#Lock the screen: +i3lock -i $OUTPUT_IMAGE -t + +#Remove the generated image: +rm $OUTPUT_IMAGE diff --git a/.i3/i3lock-fancy-multimonitor/lock.png b/.i3/i3lock-fancy-multimonitor/lock.png new file mode 100755 index 0000000..620aa5b Binary files /dev/null and b/.i3/i3lock-fancy-multimonitor/lock.png differ diff --git a/.i3/i3lock-fancy-multimonitor/text.png b/.i3/i3lock-fancy-multimonitor/text.png new file mode 100755 index 0000000..b1a4369 Binary files /dev/null and b/.i3/i3lock-fancy-multimonitor/text.png differ diff --git a/.i3/i3status.conf b/.i3/i3status.conf old mode 100644 new mode 100755 index 8f4fdd4..99cc28c --- a/.i3/i3status.conf +++ b/.i3/i3status.conf @@ -12,6 +12,7 @@ general { } #order += "ipv6" +order += "volume master" order += "disk /" #order += "run_watch DHCP" order += "run_watch VPN" @@ -69,3 +70,10 @@ load { disk "/" { format = "%avail" } + +volume master { + format = "♪: %volume" + format_muted = "♪: muted (%volume)" + device = "sysdefault" + mixer = "Master" +} diff --git a/.i3/statusbar.sh b/.i3/statusbar.sh old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/config/terminator/config b/config/terminator/config old mode 100644 new mode 100755 diff --git a/dotfiles b/dotfiles new file mode 120000 index 0000000..3f1c6bb --- /dev/null +++ b/dotfiles @@ -0,0 +1 @@ +/home/ahosking/dotfiles \ No newline at end of file diff --git a/git/.gitconfig b/git/.gitconfig old mode 100644 new mode 100755 diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index cf50aec..6e7b486 --- a/install.sh +++ b/install.sh @@ -1,8 +1,9 @@ #!/bin/bash -export DOTFILES_DIR EXTRA_DIR DOTFILES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +export DOTFILES_DIR EXTRA_DIR="$HOME/.extra" +export EXTRA_DIR # Update dotfiles itself first @@ -14,6 +15,7 @@ mkdir -p ~/.vim/{backup_files,swap_files,undo_files} git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim # Bunch of symlinks +ln -sfv ~/dotfiles ~/.dotfiles #ln -sfv "$DOTFILES_DIR/run/.bash_profile" ~ ln -sfv "$DOTFILES_DIR/run/.bashrc" ~ ln -sfv "$DOTFILES_DIR/git/.gitconfig" ~ diff --git a/run/.bash_profile b/run/.bash_profile old mode 100644 new mode 100755 diff --git a/run/.bashrc b/run/.bashrc old mode 100644 new mode 100755 index faaaf96..ba7e27f --- a/run/.bashrc +++ b/run/.bashrc @@ -8,11 +8,12 @@ esac READLINK=$(which greadlink || which readlink) CURRENT_SCRIPT=$BASH_SOURCE -if [[ -n $CURRENT_SCRIPT && -x "$READLINK" ]]; then +if [ -d "$HOME/.dotfiles" ]; then + DOTFILES_DIR="$HOME/.dotfiles" +elif [[ -n $CURRENT_SCRIPT && -x "$READLINK" ]]; then SCRIPT_PATH=$($READLINK -f "$CURRENT_SCRIPT") DOTFILES_DIR=$(dirname "$(dirname "$SCRIPT_PATH")") -elif [ -d "$HOME/.dotfiles" ]; then - DOTFILES_DIR="$HOME/.dotfiles" + echo $DOTFILES_DIR else echo "Unable to find dotfiles, exiting." return # `exit 1` would quit the shell itself @@ -25,8 +26,7 @@ for DOTFILE in "$DOTFILES_DIR"/system/.{function,env,alias,prompt}; do done # Set LSCOLORS - -eval "$(dircolors "$DOTFILES_DIR"/system/.dir_colors)" +eval "$(dircolors $DOTFILES_DIR/system/.dir_colors)" # Hook for extra/custom stuff diff --git a/system/.alias b/system/.alias old mode 100644 new mode 100755 index 32bab81..d507316 --- a/system/.alias +++ b/system/.alias @@ -6,6 +6,9 @@ alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." +### Logout! +alias logout='sudo pkill -u $USER' + ### Vagrant alias vu='vagrant up --provision' alias vp='vagrant provision' @@ -13,6 +16,9 @@ alias vssh='vagrant ssh' alias vd='vagrant destroy' alias vc='vagrant destroy && vagrant up --provision' +### Git +alias git_clean='git fetch --all && git reset --hard origin/master' + ### Lyrical alias vpn_lyrical='cd /home/ahosking/lyrical/vpn &&sudo openvpn --config gw-udp-1194-ahosking-vpn.ovpn' diff --git a/system/.dir_colors b/system/.dir_colors old mode 100644 new mode 100755 diff --git a/system/.env b/system/.env old mode 100644 new mode 100755 index 7805bd6..2597758 --- a/system/.env +++ b/system/.env @@ -3,7 +3,7 @@ export PATH="$PATH:$HOME:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$DOTFILES_DIR/bin:$HOME/apps:/opt/sublime-text" #Add Pycharm to the Path -export PATH="$PATH:$HOME/apps/pycharm-2016.3.2/bin/pycharm.sh" +export PATH="$PATH:$HOME/apps/pycharm-2017.1.1/bin/pycharm.sh" # Make vim the default editor. diff --git a/system/.function b/system/.function old mode 100644 new mode 100755 diff --git a/system/.prompt b/system/.prompt old mode 100644 new mode 100755 diff --git a/system/.vimrc b/system/.vimrc old mode 100644 new mode 100755 diff --git a/vim/bundle/bundle b/vim/bundle/bundle new file mode 120000 index 0000000..6e1ea0d --- /dev/null +++ b/vim/bundle/bundle @@ -0,0 +1 @@ +/home/ahosking/dotfiles/vim/bundle \ No newline at end of file