Merge branch 'master' of ssh://git.ahoskingit.com:9022/ahosking/dotfiles

This commit is contained in:
Alexander Hosking 2017-06-01 10:37:12 -04:00
commit 8a59b8fff8
24 changed files with 149 additions and 13 deletions

0
.gitignore vendored Normal file → Executable file
View File

17
.i3/config Normal file → Executable file
View File

@ -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" {

1
.i3/i3
View File

@ -1 +0,0 @@
/home/ahosking/dotfiles/i3

View File

@ -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.

View File

@ -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/<your username>/.i3/i3lock-fancy-multimonitor/lock" >> ~/.i3/config
```
Now reload the i3 configuration file. By default, the key binding is `$mod+Shift+c`.

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

8
.i3/i3status.conf Normal file → Executable file
View File

@ -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"
}

0
.i3/statusbar.sh Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
config/terminator/config Normal file → Executable file
View File

1
dotfiles Symbolic link
View File

@ -0,0 +1 @@
/home/ahosking/dotfiles

0
git/.gitconfig Normal file → Executable file
View File

4
install.sh Normal file → Executable file
View File

@ -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" ~

0
run/.bash_profile Normal file → Executable file
View File

10
run/.bashrc Normal file → Executable file
View File

@ -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

6
system/.alias Normal file → Executable file
View File

@ -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'

0
system/.dir_colors Normal file → Executable file
View File

2
system/.env Normal file → Executable file
View File

@ -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.

0
system/.function Normal file → Executable file
View File

0
system/.prompt Normal file → Executable file
View File

0
system/.vimrc Normal file → Executable file
View File

1
vim/bundle/bundle Symbolic link
View File

@ -0,0 +1 @@
/home/ahosking/dotfiles/vim/bundle