1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Merge remote-tracking branch 'origin/master' into surface-docked

This commit is contained in:
Joe Groocock 2018-03-10 09:28:05 +00:00
commit a394c223c9
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
38 changed files with 889 additions and 408 deletions

View File

@ -61,12 +61,18 @@ urxvt*highlightSelection: true
urxvt*colorMode: on urxvt*colorMode: on
! black ! black
*.color0: #263238 *.color0: #333638
*.color8: #37474f
!white
*.color15: #eceff1
! gray
*.color7: #8b9396
*.color8: #475760
! red ! red
*.color1: #ff9800 *.color1: #ff3f00
*.color9: #ffa74d *.color9: #ef5345
! green ! green
*.color2: #8bc34a *.color2: #8bc34a
@ -77,20 +83,16 @@ urxvt*colorMode: on
*.color11: #ffa000 *.color11: #ffa000
! blue ! blue
*.color4: #03a9f4 *.color4: #0266f4
*.color12: #81d4fa *.color12: #3f86da
! magenta ! magenta
*.color5: #e91e63 *.color5: #cc17cc
*.color13: #A56ECC *.color13: #a56ecC
! cyan ! cyan
*.color6: #009688 *.color6: #10aeba
*.color14: #26a69a *.color14: #5ddae2
! white
*.color7: #cfd8dc
*.color15: #eceff1
!----------------------------- !-----------------------------

View File

@ -1,2 +0,0 @@
[Qt]
style=GTK+

View File

@ -29,7 +29,7 @@ alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasin
#inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity. #inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity.
inactive-opacity-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ]; inactive-opacity-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
blur-background = true; # Blur background of transparent windows. blur-background = true; # Blur background of transparent windows.
blur-background-exclude = [ "class_g = 'Peek'" ]; blur-background-exclude = [ "class_g = 'Peek'", "class_g = 'Onboard'", "class_g = 'slop'" ];
blur-background-frame = false; # Blur background of opaque windows with transparent blur-background-frame = false; # Blur background of opaque windows with transparent
# frames as well. # frames as well.
blur-background-fixed = true; # Do not let blur radius adjust based on window opacity. blur-background-fixed = true; # Do not let blur radius adjust based on window opacity.
@ -51,7 +51,7 @@ backend = "glx" # Backend to use: "xrender" or "glx". GLX backend is typical
# much faster but depends on a sane driver. # much faster but depends on a sane driver.
mark-wmwin-focused = true; # Try to detect WM windows and mark them as active. mark-wmwin-focused = true; # Try to detect WM windows and mark them as active.
mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus). mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus).
use-ewmh-active-win = false; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused
# instead of using FocusIn/Out events. Usually more reliable but # instead of using FocusIn/Out events. Usually more reliable but
# depends on a EWMH-compliant WM. # depends on a EWMH-compliant WM.
detect-rounded-corners = false; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. detect-rounded-corners = false; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.

View File

@ -11,7 +11,7 @@
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>. # <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the # If markup is not allowed, those tags will be stripped out of the
# message. # message.
allow_markup = yes markup = yes
# The format of the message. Possible variables are: # The format of the message. Possible variables are:
# %a appname # %a appname
@ -143,15 +143,14 @@
# Browser for opening urls in context menu. # Browser for opening urls in context menu.
browser = /usr/bin/chromium browser = /usr/bin/chromium
# Align icons left/right/off # Align icons left/right/off
icon_position = left icon_position = off
# Paths to default icons. # Paths to default icons.
icon_folders = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ icon_folders = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
[frame] frame_width = 3
width = 3 frame_color = "#404552"
color = "#404552"
[shortcuts] [shortcuts]

View File

@ -1,24 +1,41 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig> <fontconfig>
<alias> <match>
<family>serif</family> <test name="family">
<prefer> <string>sans-serif</string>
<family>Noto Serif</family> </test>
</prefer> <edit name="family" mode="prepend" binding="weak">
</alias> <string>Noto Sans</string>
<alias> <string>Noto Color Emoji</string>
<family>sans-serif</family> </edit>
<prefer> </match>
<family>Noto Sans</family> <match>
</prefer> <test name="family">
</alias> <string>serif</string>
<alias> </test>
<family>monospace</family> <edit name="family" mode="prepend" binding="weak">
<prefer> <string>Noto Serif</string>
<family>Sauce Code Pro</family> <string>Noto Color Emoji</string>
</prefer> </edit>
</alias> </match>
<match>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="weak">
<string>Sauce Code Pro</string>
<string>Noto Color Emoji</string>
</edit>
</match>
<match>
<test name="family">
<string>Apple Color Emoji</string>
</test>
<edit name="family" mode="prepend" binding="weak">
<string>Noto Color Emoji</string>
</edit>
</match>
<match target="font"> <match target="font">
<edit name="hintstyle" mode="assign"> <edit name="hintstyle" mode="assign">
<const>hintfull</const> <const>hintfull</const>

View File

@ -2,13 +2,13 @@
name = Joe Groocock name = Joe Groocock
email = frebib@gmail.com email = frebib@gmail.com
signingkey = CFBB6A86 signingkey = CFBB6A86
[commit] [commit]
gpgsign = true gpgsign = true
[color] [color]
ui = auto ui = auto
[alias] [alias]
verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr
pushall = !git remote | xargs -L1 git push
[rebase] [rebase]
autoStash = true autoStash = true
[push] [push]
@ -20,3 +20,13 @@
rebase = true rebase = true
[core] [core]
autocrlf = input autocrlf = input
excludesfile = /home/frebib/.config/git/gitignore
[diff]
algorithm = patience
[sendemail]
from = Joe Groocock <frebib@gmail.com>
smtpserver = smtp.gmail.com
smtpuser = frebib@gmail.com
smtpencryption = tls
smtpserverport = 587
suppresscc = self

2
.config/git/gitignore Normal file
View File

@ -0,0 +1,2 @@
.idea/
cmake-build-*/

View File

@ -1,5 +1,5 @@
VteTerminal, VteTerminal,
TerminalScreen, TerminalScreen,
vte-terminal { vte-terminal {
padding: 4px; padding: 6px;
} }

View File

@ -41,15 +41,14 @@ separator_block_width=12
#interval=persist #interval=persist
[volume] [volume]
instance=Master interval=persist
interval=10
signal=10 signal=10
[separator] [separator]
[iface] [iface]
label= label=
interval=300 interval=60
signal=15 signal=15
[separator] [separator]
@ -57,12 +56,13 @@ signal=15
[updates] [updates]
label= label=
interval=600 interval=600
signal=5
[separator] [separator]
[cpu_usage] [cpu_usage]
label= label=
interval=2 interval=persist
[separator] [separator]

View File

@ -1,53 +1,31 @@
#!/usr/bin/perl #!/bin/bash
# # by Paul Colby (http://colby.id.au), no rights reserved ;)
# Copyright 2014 Pierre Mavro <deimos@deimos.fr> # https://github.com/Leo-G/DevopsWiki/wiki/How-Linux-CPU-Usage-Time-and-Percentage-is-calculated
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
use strict; PREV_TOTAL=0
use warnings; PREV_IDLE=0
use utf8;
use Getopt::Long;
# default values while true; do
my $t_warn = 50; # Get the total CPU statistics, discarding the 'cpu ' prefix.
my $t_crit = 80; CPU=(`sed -n 's/^cpu\s//p' /proc/stat`)
my $cpu_usage = -1; IDLE=${CPU[3]} # Just the idle CPU time.
sub help { # Calculate the total CPU time.
print "Usage: cpu_usage [-w <warning>] [-c <critical>]\n"; TOTAL=0
print "-w <percent>: warning threshold to become yellow\n"; for VALUE in "${CPU[@]}"; do
print "-c <percent>: critical threshold to become red\n"; let "TOTAL=$TOTAL+$VALUE"
exit 0; done
}
GetOptions("help|h" => \&help, # Calculate the CPU usage since we last checked.
"w=i" => \$t_warn, let "DIFF_IDLE=$IDLE-$PREV_IDLE"
"c=i" => \$t_crit); let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
echo -e "$DIFF_USAGE%\n$DIFF_USAGE%"
# Get CPU usage # Remember the total and idle CPU times for the next check.
$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is PREV_TOTAL="$TOTAL"
open (MPSTAT, 'mpstat 1 1 |') or die 'Cannot run mpstat'; PREV_IDLE="$IDLE"
while (<MPSTAT>) {
if (/^.*\s+(\d+\.\d+)\s+$/) {
$cpu_usage = 100 - $1; # 100% - %idle
last;
}
}
close(MPSTAT);
#$cpu_usage eq -1 and die 'Can\'t find CPU information'; # Wait before checking again.
sleep 1
# Print short_text, full_text done
printf "%.0f%%\n"x2, $cpu_usage;
# Print color, if needed
if ($cpu_usage >= $t_crit) {
print "#FF0000\n";
} elsif ($cpu_usage >= $t_warn) {
print "#FFCB00\n";
}
exit 0;

View File

@ -51,6 +51,6 @@ LOCIP=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$
#------------------------------------------------------------------------ #------------------------------------------------------------------------
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) echo $(curl -s http://whatismijnip.nl | cut -d " " -f 5);; 1) curl -s https://api.ipify.org;;
*) echo "$LOCIP";; *) echo "$LOCIP";;
esac esac

View File

@ -1,13 +1,31 @@
#!/bin/python2 #!/bin/bash
set -e
import commands for p in pacaur yaourt pacman; do
import os if $p --version &>/dev/null; then
PAC="$p"
break;
fi
done
button = os.environ.get('BLOCK_BUTTON') if [ -z "$PAC" ]; then
if button == '1': >&2 echo "Error: No Arch package manager found?"
os.system("i3-sensible-terminal -r i3blocks-update-term -e 'pacaur -Syu'") fi
updates = commands.getstatusoutput("/usr/bin/checkupdates | wc -l")[1] if [ "$BLOCK_BUTTON" == 1 ]; then
if updates and updates != '0': nohup i3-sensible-terminal -r i3blocks-update-term -e "sh -c '$PAC -Syu; pkill -RTMIN+5 i3blocks'" &>/dev/null &
print updates disown
print updates fi
if [ $p = "pacman" ]; then
exec 3< <(checkupdates)
else
exec 3< <({ checkupdates & cower -u & })
fi
count="$(wc -l <&3)"
if [ -n "$count" -a "$count" -gt 0 ]; then
echo $count
echo $count
fi

View File

@ -1,93 +1,182 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info> # Displays the default device, volume, and mute status for i3blocks
# Copyright (C) 2014 Alexander Keller <github@nycroth.com>
# This program is free software: you can redistribute it and/or modify AUDIO_HIGH_SYMBOL=' '
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful, AUDIO_MED_THRESH=59
# but WITHOUT ANY WARRANTY; without even the implied warranty of AUDIO_MED_SYMBOL=' '
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License AUDIO_LOW_THRESH=0
# along with this program. If not, see <http://www.gnu.org/licenses/>. AUDIO_LOW_SYMBOL=' '
#------------------------------------------------------------------------ AUDIO_MUTED_SYMBOL='X'
# The second parameter overrides the mixer selection AUDIO_INTERVAL=5
# For PulseAudio users, use "pulse"
# For Jack/Jack2 users, use "jackplug"
# For ALSA users, you may use "default" for your primary card
# or you may use hw:# where # is the number of the card desired
MIXER="default"
[ -n "$(lsmod | grep pulse)" ] && MIXER="pulse"
[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
MIXER="${2:-$MIXER}"
# The instance option sets the control to report and configure DEFAULT_COLOR="#ffffff"
# This defaults to the first control of your selected mixer MUTED_COLOR="#a0a0a0"
# For a list of the available, use `amixer -D $Your_Mixer scontrols`
SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
sed -n "s/Simple mixer control '\([A-Za-z ]*\)',0/\1/p" |
head -n1
)}"
# The first parameter sets the step to change the volume by (and units to display) LONG_FORMAT=0
# This may be in in % or dB (eg. 5% or 3dB) SHORT_FORMAT=3
STEP="${1:-2%}" USE_PERCENT=0
USE_ALSA_NAME=0
USE_DESCRIPTION=0
SUBSCRIBE=1
#------------------------------------------------------------------------ while getopts F:Sf:padH:M:L:X:T:t:C:c:i:m:s:h opt; do
case "$opt" in
S) SUBSCRIBE=1 ;;
F) LONG_FORMAT="$OPTARG" ;;
f) SHORT_FORMAT="$OPTARG" ;;
p) USE_PERCENT=0 ;;
a) USE_ALSA_NAME=1 ;;
d) USE_DESCRIPTION=1 ;;
H) AUDIO_HIGH_SYMBOL="$OPTARG" ;;
M) AUDIO_MED_SYMBOL="$OPTARG" ;;
L) AUDIO_LOW_SYMBOL="$OPTARG" ;;
X) AUDIO_MUTED_SYMBOL="$OPTARG" ;;
T) AUDIO_MED_THRESH="$OPTARG" ;;
t) AUDIO_LOW_THRESH="$OPTARG" ;;
C) DEFAULT_COLOR="$OPTARG" ;;
c) MUTED_COLOR="$OPTARG" ;;
i) AUDIO_INTERVAL="$OPTARG" ;;
m) MIXER="$OPTARG" ;;
s) SCONTROL="$OPTARG" ;;
h) printf \
"Usage: volume-pulseaudio [-S] [-F format] [-f format] [-p] [-a|-d] [-H symb] [-M symb]
[-L symb] [-X symb] [-T thresh] [-t thresh] [-C color] [-c color] [-i inter]
[-m mixer] [-s scontrol] [-h]
Options:
-F, -f\tOutput format (-F long format, -f short format) to use, amongst:
\t0\t symb vol [index:name]\t (default long)
\t1\t symb vol [name]
\t2\t symb vol [index]\t (default short)
\t3\t symb vol
-S\tSubscribe to volume events (requires persistent block, always uses long format)
-p\tOmit the percent sign (%%) in volume
-a\tUse ALSA name if possible
-d\tUse device description instead of name if possible
-H\tSymbol to use when audio level is high. Default: '$AUDIO_HIGH_SYMBOL'
-M\tSymbol to use when audio level is medium. Default: '$AUDIO_MED_SYMBOL'
-L\tSymbol to use when audio level is low. Default: '$AUDIO_LOW_SYMBOL'
-X\tSymbol to use when audio is muted. Default: '$AUDIO_MUTED_SYMBOL'
-T\tThreshold for medium audio level. Default: $AUDIO_MED_THRESH
-t\tThreshold for low audio level. Default: $AUDIO_LOW_THRESH
-C\tColor for non-muted audio. Default: $DEFAULT_COLOR
-c\tColor for muted audio. Default: $MUTED_COLOR
-i\tInterval size of volume increase/decrease. Default: $AUDIO_INTERVAL
-m\tUse the given mixer.
-s\tUse the given scontrol.
-h\tShow this help text
" && exit 0;;
esac
done
capability() { # Return "Capture" if the device is a capture device if [[ -z "$MIXER" ]] ; then
amixer -D $MIXER get $SCONTROL | MIXER="default"
sed -n "s/ Capabilities:.*cvolume.*/Capture/p" if amixer -D pulse info >/dev/null 2>&1 ; then
} MIXER="pulse"
fi
volume() {
amixer -D $MIXER get $SCONTROL $(capability)
}
format() {
perl_filter='if (/.*\[(\d+)%\] (\[(-?\d+.\d+)dB\] )?\[(on|off)\]/)'
perl_filter+='{CORE::say $4 eq "off" ? "-1" : "'
perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
perl_filter+='"; exit}'
perl -ne "$perl_filter"
}
#------------------------------------------------------------------------
case $BLOCK_BUTTON in
1) pavucontrol &>/dev/null &;;
2) ~/.config/i3/cycleaudio.py;;
3) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
esac
#------------------------------------------------------------------------
VOL=$(volume | format)
ACTIVE=$(pacmd list-sinks | grep '* index' | awk -F": " '{print $2}')
if pactl list short sinks | grep -q \^$ACTIVE".*Yeti"; then
printf ""
elif pactl list short sinks | grep -q \^$ACTIVE".*bluez"; then
printf " "
elif [ "$VOL" -eq -1 ]; then
printf "X"
exit 0
elif [ "$VOL" -eq 0 ]; then
printf ""
elif [ "$VOL" -gt 59 ]; then
printf ""
else
printf ""
fi fi
printf " $VOL" if [[ -z "$SCONTROL" ]] ; then
SCONTROL=$(amixer -D "$MIXER" scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1)
fi
CAPABILITY=$(amixer -D $MIXER get $SCONTROL | sed -n "s/ Capabilities:.*cvolume.*/Capture/p")
function move_sinks_to_new_default {
DEFAULT_SINK=$1
pacmd list-sink-inputs | grep index: | grep -o '[0-9]\+' | while read SINK
do
pacmd move-sink-input $SINK $DEFAULT_SINK
done
}
function set_default_playback_device_next {
inc=${1:-1}
num_devices=$(pacmd list-sinks | grep -c index:)
sink_arr=($(pacmd list-sinks | grep index: | grep -o '[0-9]\+'))
default_sink_index=$(( $(pacmd list-sinks | grep index: | grep -no '*' | grep -o '^[0-9]\+') - 1 ))
default_sink_index=$(( ($default_sink_index + $num_devices + $inc) % $num_devices ))
default_sink=${sink_arr[$default_sink_index]}
pacmd set-default-sink $default_sink
move_sinks_to_new_default $default_sink
}
case "$BLOCK_BUTTON" in
1) set_default_playback_device_next ;;
2) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY toggle ;;
3) set_default_playback_device_next -1 ;;
4) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY $AUDIO_INTERVAL%+ ;;
5) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY $AUDIO_INTERVAL%- ;;
esac
function print_format {
PERCENT="%"
[[ $USE_PERCENT == 0 ]] && PERCENT=""
case "$1" in
1) echo "$SYMBOL$VOL$PERCENT [$NAME]" ;;
2) echo "$SYMBOL$VOL$PERCENT [$INDEX]";;
3) echo "$SYMBOL$VOL$PERCENT" ;;
*) echo "$SYMBOL$VOL$PERCENT [$INDEX:$NAME]" ;;
esac
}
function print_block {
for name in INDEX NAME VOL MUTED; do
read $name
done < <(pacmd list-sinks | grep "index:\|name:\|volume: front\|muted:" | grep -A3 '*')
INDEX=$(echo "$INDEX" | grep -o '[0-9]\+')
VOL=$(echo "$VOL" | grep -o "[0-9]*%" | head -1 )
VOL="${VOL%?}"
NAME=$(echo "$NAME" | sed \
's/.*<.*\.\(.*\)>.*/\1/; t;'\
's/.*<\(.*\)>.*/\1/; t;'\
's/.*/unknown/')
if [[ $USE_ALSA_NAME == 1 ]] ; then
ALSA_NAME=$(pacmd list-sinks |\
awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\
grep "alsa.name\|alsa.mixer_name" |\
head -n1 |\
sed 's/.*= "\(.*\)".*/\1/')
NAME=${ALSA_NAME:-$NAME}
elif [[ $USE_DESCRIPTION == 1 ]] ; then
DESCRIPTION=$(pacmd list-sinks |\
awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\
grep "device.description" |\
head -n1 |\
sed 's/.*= "\(.*\)".*/\1/')
NAME=${DESCRIPTION:-$NAME}
fi
if [[ $MUTED =~ "no" ]] ; then
SYMBOL=$AUDIO_HIGH_SYMBOL
[[ $VOL -le $AUDIO_MED_THRESH ]] && SYMBOL=$AUDIO_MED_SYMBOL
[[ $VOL -le $AUDIO_LOW_THRESH ]] && SYMBOL=$AUDIO_LOW_SYMBOL
COLOR=$DEFAULT_COLOR
else
SYMBOL=$AUDIO_MUTED_SYMBOL
COLOR=$MUTED_COLOR
VOL=""
fi
# if [[ $SUBSCRIBE == 1 ]] ; then
# print_format "$LONG_FORMAT"
# else
# print_format "$LONG_FORMAT"
print_format "$SHORT_FORMAT"
# echo "$COLOR"
# fi
}
print_block
if [[ $SUBSCRIBE == 1 ]] ; then
while read -r EVENT; do
print_block
done < <(pactl subscribe | stdbuf -oL grep change)
fi

View File

@ -118,12 +118,14 @@ bar {
} }
# Window rules # Window rules
for_window [class="Pinentry"] floating enable
for_window [class="Pavucontrol"] floating enable for_window [class="Pavucontrol"] floating enable
for_window [class="Blueman-manager"] floating enable for_window [class="Blueman-manager"] floating enable
for_window [window_role="floating-term"] floating enable for_window [window_role="floating-term"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="i3blocks-update-term"] floating enable for_window [window_role="i3blocks-update-term"] floating enable
for_window [window_role="i3blocks-clock-term"] floating enable for_window [window_role="i3blocks-clock-term"] floating enable
for_window [title="rofi"] floating enable for_window [title="^rofi$"] floating enable
new_window pixel 5 new_window pixel 5
new_float none new_float none
@ -136,7 +138,7 @@ focus_follows_mouse yes
# keybindings # keybindings
bindsym $mod+Shift+j reload bindsym $mod+Shift+j reload
bindsym $mod+Shift+p restart #bindsym $mod+Shift+p restart
bindsym $mod+c exec chromium bindsym $mod+c exec chromium
bindsym $mod+v exec "i3-sensible-terminal -e \\"$SHELL -c vim;$SHELL\\" bindsym $mod+v exec "i3-sensible-terminal -e \\"$SHELL -c vim;$SHELL\\"
bindsym $mod+Ctrl+v exec "i3-sensible-terminal -r floating-term -e \\"$SHELL -c vim;$SHELL\\" bindsym $mod+Ctrl+v exec "i3-sensible-terminal -r floating-term -e \\"$SHELL -c vim;$SHELL\\"
@ -148,10 +150,12 @@ bindsym $mod+Ctrl+Shift+Return exec i3-sensible-terminal -r floating-term --ge
bindsym $mod+l exec ~/.config/i3/lock.sh bindsym $mod+l exec ~/.config/i3/lock.sh
# -fg "#CCD3DAE3" -bg "#CC383C4A" -hlbg "#CC5294E2" # -fg "#CCD3DAE3" -bg "#CC383C4A" -hlbg "#CC5294E2"
bindsym $mod+space exec "pkill rofi; rofi -show run -sidebar-mode -terminal i3-sensible-terminal -normal-window" bindsym $mod+space exec "pkill rofi; rofi -show run -sidebar-mode -terminal i3-sensible-terminal -normal-window"
bindsym $mod+Shift+p exec rofi-pass
bindsym $mod+Shift+e exec rofi-emoji
bindsym --release Print exec imgur-screenshot bindsym --release Print exec imgur-screenshot
bindsym --release $mod+Print exec imgur-screenshot -f bindsym --release $mod+Print exec imgur-screenshot -f
bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks
bindsym $mod+numbersign exec notify-send "$(xclip -o | gpg --decrypt 2>&1)" bindsym $mod+numbersign exec "termite -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ &&\ read'"
bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"<a href=\\\\"$LINK\\\\">$LINK</a>\\"" bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"<a href=\\\\"$LINK\\\\">$LINK</a>\\""
# Media player controls # Media player controls
@ -160,30 +164,29 @@ bindsym XF86AudioPause exec --no-startup-id mpc pause
bindsym XF86AudioStop exec --no-startup-id mpc stop bindsym XF86AudioStop exec --no-startup-id mpc stop
bindsym XF86AudioNext exec --no-startup-id mpc next bindsym XF86AudioNext exec --no-startup-id mpc next
bindsym XF86AudioPrev exec --no-startup-id mpc previous bindsym XF86AudioPrev exec --no-startup-id mpc previous
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2% && pkill -RTMIN+10 i3blocks bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1000
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2% && pkill -RTMIN+10 i3blocks bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1000
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && pkill -RTMIN+10 i3blocks bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
exec --no-startup-id "ip monitor | while read line; do pkill -RTMIN+15 i3blocks; done" bindsym XF86MonBrightnessUp exec xbacklight -inc 5 && pkill -RTMIN+12 i3blocks
bindsym XF86MonBrightnessDown exec xbacklight -dec 5 && pkill -RTMIN+12 i3blocks
exec --no-startup-id "ip monitor | while read; do pkill -RTMIN+15 i3blocks; done"
# app launch shortcuts # app launch shortcuts
exec --no-startup-id ~/.fehbg exec --no-startup-id ~/.fehbg
exec --no-startup-id ~/.config/i3/disable-standby-fs.py exec --no-startup-id ~/.config/i3/disable-standby-fs.py
exec xautolock -time 5 -locker ~/.config/i3/lock.sh exec --no-startup-id xautolock -time 5 -locker ~/.config/i3/lock.sh -nocloseout -nocloseerr
# startup programs # startup programs
exec --no-startup-id pulseaudio exec --no-startup-id pulseaudio
exec --no-startup-id dropbox exec --no-startup-id nextcloud
exec --no-startup-id insync start
exec --no-startup-id nm-applet
exec --no-startup-id blueman-applet exec --no-startup-id blueman-applet
exec --no-startup-id redshift exec --no-startup-id redshift
exec --no-startup-id xbindkeys exec --no-startup-id xbindkeys
exec --no-startup-id onboard exec --no-startup-id onboard
exec --no-startup-id ~/.local/share/surface-scripts/rotationd
exec --no-startup-id compton -b --config ~/.config/compton.conf exec --no-startup-id compton -b --config ~/.config/compton.conf
exec --no-startup-id chromium --no-startup-window exec --no-startup-id chromium --no-startup-window
exec i3-msg 'workspace 1; exec sleep 2 && chromium'
exec i3-msg 'workspace 2; exec i3-sensible-terminal' exec i3-msg 'workspace 2; exec i3-sensible-terminal'
exec i3-msg 'workspace 3; exec sleep 2 && chromium'
# vim:ft=i3 # vim:ft=i3

12
.config/i3/disable-standby-fs.py Normal file → Executable file
View File

@ -16,16 +16,16 @@ args = parser.parse_args()
def on_fullscreen_mode(i3, e): def on_fullscreen_mode(i3, e):
if e.container.props.fullscreen_mode: if e.container.props.fullscreen_mode:
call(['xset', 's', 'off']) call(['xautolock', '-disable'])
call(['xset', '-dpms']) print("disabling autolock")
else: else:
call(['xset', 's', 'on']) call(['xautolock', '-enable'])
call(['xset', '+dpms']) print("enabling autolock")
def on_window_close(i3, e): def on_window_close(i3, e):
if e.container.props.fullscreen_mode: if e.container.props.fullscreen_mode:
call(['xset', 's', 'on']) call(['xautolock', '-enable'])
call(['xset', '+dpms']) print("enabling autolock")
i3.on('window::fullscreen_mode', on_fullscreen_mode) i3.on('window::fullscreen_mode', on_fullscreen_mode)
i3.on('window::close', on_window_close) i3.on('window::close', on_window_close)

View File

@ -5,9 +5,6 @@ tmpbg='/tmp/screen.png'
(( $# )) && { icon=$1; } (( $# )) && { icon=$1; }
# screenshot
scrot "$tmpbg"
PX=0 PX=0
PY=0 PY=0
# lockscreen image info # lockscreen image info
@ -25,17 +22,19 @@ SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset
PX=$(($SROX + $SRX/2 - $RX/2)) PX=$(($SROX + $SRX/2 - $RX/2))
PY=$(($SROY + $SRY/2 - $RY/2)) PY=$(($SROY + $SRY/2 - $RY/2))
# screenshot, pixelise and overlay
maim | convert - -scale 5% -scale 2000% $icon -geometry +$PX+$PY -composite -matte $tmpbg
# pixelize and add lock icon if command mpc 2>&1 1>/dev/null; then
convert $tmpbg -scale 5% -scale 2000% $tmpbg playing=$(mpc status | grep playing | wc -l)
convert $tmpbg $icon -geometry +$PX+$PY -composite -matte $tmpbg [[ $playing == 1 ]] && mpc pause
fi
playing=$(mpc status | grep playing | wc -l)
[[ $playing == 1 ]] && mpc pause
i3lock -i "$tmpbg" -n -e i3lock -i "$tmpbg" -n -e
[[ $playing == 1 ]] && mpc play if command mpc 2>&1 1>/dev/null; then
[[ $playing == 1 ]] && mpc play
fi
rm "$tmpbg" rm "$tmpbg"

View File

@ -11,7 +11,7 @@ case $option in
windows) windows)
windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4` windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4`
sudo efibootmgr -n $windows sudo efibootmgr -n $windows
reboot;; systemctl reboot;;
esac esac
exit 0 exit 0

View File

@ -1,11 +1,13 @@
imgur_icon_path="$HOME/.config/imgur-screenshot/imgur.ico" imgur_icon_path="$HOME/.config/imgur-screenshot/imgur.ico"
imgur_acct_key=""
imgur_secret=""
login="false" login="false"
log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log" log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log"
credentials_file="$HOME/.config/imgur-screenshot/credentials.conf" credentials_file="$HOME/.config/imgur-screenshot/credentials.conf"
file_name_format="scrot-%Y-%m-%d--%H:%M:%S.png" # when using scrot, must end with .png! file_name_format="screenshot-%Y-%m-%d-%H%M%S.png" # when using scrot, must end with .png!
file_dir="$HOME/pictures/screenshots" file_dir="$HOME/pictures/screenshots"
screenshot_select_command="scrot -s %img" screenshot_select_command="maim -m 10 -us %img"
screenshot_window_command="scrot %img" screenshot_window_command="maim -m 10 -uw %img"
edit_command="gimp %img" edit_command="gimp %img"
edit="false" edit="false"
exit_on_selection_fail="true" exit_on_selection_fail="true"

View File

@ -11,11 +11,15 @@ background = rgba(56, 60, 74, 0.95)
highlight = #5294E2 highlight = #5294E2
# black # black
color0 = #263238 color0 = #333638
color8 = #37474f # white
color15 = #eceff1
# gray
color7 = #8b9396
color8 = #475760
# red # red
color1 = #ff9800 color1 = #ff3f00
color9 = #ffa74d color9 = #ef5345
# green # green
color2 = #8bc34a color2 = #8bc34a
color10 = #9ccc65 color10 = #9ccc65
@ -23,16 +27,13 @@ color10 = #9ccc65
color3 = #ffc107 color3 = #ffc107
color11 = #ffa000 color11 = #ffa000
# blue # blue
color4 = #03a9f4 color4 = #0266f4
color12 = #81d4fa color12 = #81b3f9
# magenta # magenta
color5 = #e91e63 color5 = #cc17cc
color13 = #A56ECC color13 = #a56ecc
# cyan # cyan
color6 = #009688 color6 = #10aeba
color14 = #26a69a color14 = #5ddae2
# white
color7 = #cfd8dc
color15 = #eceff1
# vim: ft=dosini cms=#%s # vim: ft=dosini cms=#%s

View File

@ -5,11 +5,11 @@
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported. # absolute path. No other format is supported.
# #
XDG_DESKTOP_DIR="$HOME/desktop" XDG_DESKTOP_DIR="$HOME/documents"
XDG_DOCUMENTS_DIR="$HOME/documents" XDG_DOCUMENTS_DIR="$HOME/documents"
XDG_DOWNLOAD_DIR="$HOME/downloads" XDG_DOWNLOAD_DIR="$HOME/downloads"
XDG_MUSIC_DIR="$HOME/music" XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pictures" XDG_PICTURES_DIR="$HOME/pictures"
XDG_VIDEOS_DIR="$HOME/music" XDG_VIDEOS_DIR="$HOME/music"
XDG_PUBLICSHARE_DIR="$HOME" XDG_PUBLICSHARE_DIR="$HOME"
XDG_TEMPLATES_DIR="$HOME/" XDG_TEMPLATES_DIR="$HOME"

6
.config/vim/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/bundle/
/spell/
/swapfiles/
/viminfo
/vim-latex
/.netrwhist

View File

@ -1,53 +1,84 @@
set nocompatible " be iMproved, required set nocompatible " be iMproved, required
" Reconfigure Vim to be clean!
set rtp+=~/.config/vim
set directory=.,~/.config/vim
set viminfo+=n~/.config/vim/viminfo
set directory=$HOME/.config/vim/swapfiles//
syntax enable syntax enable
filetype plugin on
set tabstop=4 set tabstop=4
set shiftwidth=0 " Use tabstop set shiftwidth=0 " Use tabstop
set softtabstop=-1 " Use tabstop set softtabstop=-1 " Use tabstop
set expandtab set expandtab
set smarttab
set smartindent
set number set number
set linebreak
set autoindent set autoindent
set laststatus=2 set laststatus=2
set mouse=a
set encoding=utf-8 set encoding=utf-8
set background=dark set background=dark
set directory=$HOME/.vim/swapfiles// set omnifunc=syntaxcomplete#Complete
set title
set clipboard=unnamed
set wildmenu
set report=0
set lazyredraw
set ttyfast
set autoread
set showmatch
set scrolloff=6
set nojoinspaces
" Autosave settings
set autowrite
autocmd InsertLeave * save
" Search options
set hlsearch
set ignorecase
set smartcase
" GVim settings " GVim settings
set guifont=Sauce\ Code\ Pro\ 10.5 set guifont=Sauce\ Code\ Pro\ 10.5
set guioptions= set guioptions=
" Change to dvorak-mapped keys " Whitespace highlight settings
let g:use_dvorak = 1 set list
set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:<
highlight SpecialKey ctermfg=7
" set the runtime path to include Vundle and initialize " set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim set rtp+=~/.config/vim/bundle/Vundle.vim
call vundle#begin() call vundle#begin()
call vundle#rc('~/.config/vim/bundle')
Plugin 'VundleVim/Vundle.vim' Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe' Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/syntastic' Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-sensible' Plugin 'tpope/vim-sensible'
Plugin 'vim-scripts/vim-auto-save' Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-rhubarb'
Plugin 'tpope/vim-abolish'
Plugin 'airblade/vim-gitgutter' Plugin 'airblade/vim-gitgutter'
Plugin 'ryanoasis/vim-devicons' Plugin 'ryanoasis/vim-devicons'
Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes' Plugin 'vim-airline/vim-airline-themes'
Plugin 'PotatoesMaster/i3-vim-syntax' Plugin 'PotatoesMaster/i3-vim-syntax'
Plugin 'solarnz/thrift.vim'
Plugin 'lervag/vimtex' Plugin 'lervag/vimtex'
Plugin 'JamshedVesuna/vim-markdown-preview'
call vundle#end() call vundle#end()
let g:opamshare = substitute(system('opam config var share'),'\n$','','''') " Change to dvorak-mapped keys
execute "set rtp+=" . g:opamshare . "/merlin/vim" let g:use_dvorak = 1
execute "set rtp+=" . g:opamshare . "/vim/syntax/ocp-indent.vim"
let g:syntastic_ocaml_checkers = ['merlin']
let g:syntastic_ignore_files = ['\m\c.(mll|mly)$']
set omnifunc=syntaxcomplete#Complete
" YouCompleteMe python fix " YouCompleteMe config
let g:ycm_server_python_interpreter = '/usr/bin/python3' let g:ycm_confirm_extra_conf = 0
" Vim-Airline config " Vim-Airline config
let g:Powerline_symbols = 'fancy' let g:Powerline_symbols = 'fancy'
@ -55,8 +86,17 @@ let g:airline_powerline_fonts = 1
let g:airline_theme='solarized' let g:airline_theme='solarized'
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
" vim-auto-save " vim-markdown plugin
let g:auto_save = 1 " enable AutoSave on Vim startup let vim_markdown_preview_toggle=0
let vim_markdown_preview_browser='Chromium'
let vim_markdown_preview_use_xdg_open=1
let vim_markdown_preview_github=1
" Disable mouse
set mouse=nicr
nnoremap <LeftMouse> <nop>
nnoremap <RightMouse> <nop>
let mapleader="\<space>" let mapleader="\<space>"
" Unbind arrow keys " Unbind arrow keys
@ -108,10 +148,10 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1)
nnoremap <C-w><C-t> <C-w><C-k> nnoremap <C-w><C-t> <C-w><C-k>
nnoremap <C-w><C-n> <C-w><C-l> nnoremap <C-w><C-n> <C-w><C-l>
"nnoremap <C-d> <C-w>h nnoremap <C-d> <C-w>h
"nnoremap <C-h> <C-w>j nnoremap <C-h> <C-w>j
"nnoremap <C-t> <C-w>k nnoremap <C-t> <C-w>k
"nnoremap <C-n> <C-w>l nnoremap <C-n> <C-w>l
" Account for tag jumping " Account for tag jumping
nnoremap <C-j> <C-t> nnoremap <C-j> <C-t>
@ -122,7 +162,7 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1)
" Remappings for the T key " Remappings for the T key
noremap j t noremap j t
noremap J T "noremap J T
" Remapping for the L key " Remapping for the L key
noremap l n noremap l n
@ -136,19 +176,14 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1)
noremap zh zj noremap zh zj
noremap zt zk noremap zt zk
" Disable some default vimtex mappings that conflict with rebound keys
let g:vimtex_mappings_disable = {
\ 'n': ['tse', 'tsd', 'tsD', 'tsc', 'dse', 'dsc', 'ds$', 'dsd'],
\ 'x': ['tsd', 'tsD'],
\}
endif endif
" Interface with system clipboard
noremap <Leader>y "*y
noremap <Leader>p "*p
noremap <Leader>Y "+y
noremap <Leader>P "+p
" Search options
set hlsearch
set ignorecase
set smartcase
" Save aliases. " Save aliases.
noremap <Leader>q :wq<CR> noremap <Leader>q :wq<CR>
com W w com W w
@ -157,3 +192,7 @@ com Wq wq
com WQ wq com WQ wq
" Write with sudo " Write with sudo
cmap w!! w !sudo tee > /dev/null % cmap w!! w !sudo tee > /dev/null %
autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et
autocmd FileType tex silent VimtexCompile

View File

@ -0,0 +1,83 @@
# ZSH Theme emulating the Fish shell's default prompt.
_fishy_collapsed_wd() {
echo $(pwd | perl -pe '
BEGIN {
binmode STDIN, ":encoding(UTF-8)";
binmode STDOUT, ":encoding(UTF-8)";
}; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
')
}
git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
git_prompt_status() {
# Get the status of the working tree
INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi
if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
fi
if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
fi
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
fi
if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
fi
if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
fi
echo $STATUS
}
# Required for dynamic prompt
setopt prompt_subst
local user_color='green'; [ $UID -eq 0 ] && user_color='red'
PROMPT="%n@%m %F{$user_color}\$(_fishy_collapsed_wd)%f%(!.#.>) "
PROMPT2='%F{red}\ %f'
local return_status="%F{red}%(?..%?)%f"
RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX=" "
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?"

View File

@ -0,0 +1,23 @@
# Source: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/sudo/sudo.plugin.zsh
sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
if [[ $BUFFER == sudo\ * ]]; then
LBUFFER="${LBUFFER#sudo }"
elif [[ $BUFFER == $EDITOR\ * ]] || [[ $BUFFER == vi\ * ]]; then
LBUFFER="${LBUFFER#$EDITOR }"
LBUFFER="${LBUFFER#vi }"
LBUFFER="svi $LBUFFER"
elif [[ $BUFFER == sudoedit\ * ]] || [[ $BUFFER == svi\ * ]]; then
LBUFFER="${LBUFFER#sudoedit }"
LBUFFER="${LBUFFER#svi }"
LBUFFER="$EDITOR $LBUFFER"
else
LBUFFER="sudo $LBUFFER"
fi
_zsh_highlight
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
bindkey "\e\e" sudo-command-line

2
.fehbg
View File

@ -1,2 +1,2 @@
#!/bin/sh #!/bin/sh
feh --no-xinerama --bg-fill '/home/frebib/pictures/lakesidesunrise.jpg' 'feh' '--no-xinerama' '--bg-fill' '/home/frebib/pictures/lakesidesunrise.jpg'

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
bookmarks bookmarks
.config/secrets
.config/imgur-screenshot/credentials.conf
*.log *.log
.xournal/recent-files .xournal/recent-files

View File

@ -2,29 +2,46 @@ export LC_ALL=en_GB.UTF-8
export LANG=en_GB.UTF-8 export LANG=en_GB.UTF-8
export LC_NUMERIC=en_GB export LC_NUMERIC=en_GB
export CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" export CONFIG_DIR="$HOME/.config"
export DOTFILES=$CONFIG_DIR/dotfiles export XDG_CONFIG_HOME="$CONFIG_DIR"
export DOTFILES="$CONFIG_DIR/dotfiles"
export PATH="${PATH}:$DOTFILES/scripts" export PATH="${PATH}:$DOTFILES/scripts"
export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open
# Allow Vim to load from ~/.config/vim
export VIMDIR="$CONFIG_DIR/vim"
export MYVIMRC="$VIMDIR/vimrc"
export VIMINIT=":so $MYVIMRC"
export EDITOR="vim" export EDITOR="vim"
export VISUAL="vim" export VISUAL="vim"
export PAGER="less -R" export LESS="-RNI"
export PAGER="less $LESS"
export MANPAGER="less -+N"
export TERMINAL="termite" export TERMINAL="termite"
export BROWSER="chromium" export BROWSER="chromium"
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
export QT_STYLE_OVERRIDE=GTK+
export QT_QPA_PLATFORMTHEME=gtk2 export QT_QPA_PLATFORMTHEME=gtk2
# Merge system clipboards # Source secret keys and values into environment
if ! [ -z $DISPLAY ] && which autocutsel &>/dev/null; then if [ -f "$CONFIG_DIR/secrets" ]; then
autocutsel -fork & set -o allexport
autocutsel -selection PRIMARY -fork & source $CONFIG_DIR/secrets
set +o allexport
fi fi
# Start an ssh-agent # Merge system clipboards
if [ -z $SSH_AUTH_SOCK ]; then if [ -n "$DISPLAY" ] && which autocutsel >/dev/null 2>&1; then
eval `ssh-agent` autocutsel -fork
autocutsel -selection PRIMARY -fork
fi
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && which dbus-launch >/dev/null 2>&1; then
eval $(dbus-launch --sh-syntax --exit-with-session)
dbus-update-activation-environment --systemd DISPLAY
fi
# Start the gnome-keyring if it's installed
if which gnome-keyring-daemon >/dev/null 2>&1; then
export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg)
fi fi
# Always add SSH key to the running agent; local or remote
ssh-add

View File

@ -1,9 +1,9 @@
# thumb wheel up => increase volume and unmute # thumb wheel up => increase volume and unmute
"amixer -D pulse set Master 1000+ unmute ; pkill -RTMIN+10 i3blocks" "xdotool key --clearmodifiers XF86AudioRaiseVolume"
b:6 b:6
# thumb wheel down => lower volume # thumb wheel down => lower volume
"amixer -D pulse set Master 1000- ; pkill -RTMIN+10 i3blocks" "xdotool key --clearmodifiers XF86AudioLowerVolume"
b:7 b:7
# backward button => previous song # backward button => previous song

View File

@ -1,9 +1,5 @@
#!/bin/sh #!/bin/sh
source ~/.profile
source ~/.xsession
xrdb -merge ~/.Xresources
# Run all system xinitrc shell scripts # Run all system xinitrc shell scripts
xinitdir="/etc/X11/xinit/xinitrc.d" xinitdir="/etc/X11/xinit/xinitrc.d"
if [ -d "$xinitdir" ]; then if [ -d "$xinitdir" ]; then
@ -15,6 +11,8 @@ if [ -d "$xinitdir" ]; then
done done
fi fi
~/.local/share/surfacetools/rotationd --once source ~/.profile
source ~/.xsession
xrdb -merge ~/.Xresources
exec i3 exec i3

141
.zshrc
View File

@ -1,30 +1,78 @@
unsetopt MULTIBYTE unsetopt MULTIBYTE
# Path to your oh-my-zsh installation. # Config and cache directory paths
ZSH=$HOME/.local/share/oh-my-zsh
# Set the theme
ZSH_THEME="fishy"
#DISABLE_AUTO_UPDATE="true"
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
ZSH_CONFIG_DIR=$CONFIG_DIR/zsh ZSH_DIR="$CONFIG_DIR/zsh"
ZSH_CACHE_DIR=$CONFIG_DIR/oh-my-zsh/cache ZSH_CACHE_DIR="$CONFIG_DIR/oh-my-zsh/cache"
mkdir -p $ZSH_CACHE_DIR $ZSH_CONFIG_DIR ADOTDIR="$ZSH_DIR/antigen" # Antigen directory
ANTIGEN_LOG="$ADOTDIR/log/antigen-$(date +"%Y_%m_%d_%I_%M_%p").log"
HISTFILE=$ZSH_CONFIG_DIR/histfile mkdir -p "$ZSH_CACHE_DIR" "$ZSH_DIR" "$ADOTDIR/log"
HISTSIZE=100000
SAVEHIST=100000
setopt sharehistory histignoredups histignorespace histreduceblanks autocd autopushd extendedglob globcomplete alwaystoend dvorak
export WORDCHARS='*?_[]~=&;!#$%^(){}' HISTFILE="$ZSH_DIR/histfile"
HISTSIZE=999999
SAVEHIST=999999
# Only set tty if running interactively
if tty -s; then
# Resolve at shell runtime
export GPG_TTY="$(tty)"
fi
# Set some useful ZSH/Bash options
setopt sharehistory histignorealldups histignorespace histreduceblanks
setopt pathdirs autocd autopushd extendedglob alwaystoend dvorak
# Completion initialisation
autoload -U compinit ; compinit
autoload -U bashcompinit ; bashcompinit
# gopass completion
if gopass --help &>/dev/null; then
source <(gopass completion bash)
fi
zstyle ':completion:*:sudo|_::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root"
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*'
zstyle ':completion:*' rehash true
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}"
zstyle ':compinstall' filename "$HOME/.zshrc"
# Load antigen & plugins
antigen_src="$ZSH_DIR/antigen.zsh"
if [ ! -f "$antigen_src" ]; then
if which curl &>/dev/null; then
getcmd='curl -L'
else
getcmd='wget -qO-'
fi
eval $getcmd git.io/antigen > "$antigen_src"
fi
source "$antigen_src"
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle Tarrasch/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-history-substring-search
antigen apply
# Set some key-binds
bindkey -e bindkey -e
bindkey "\e[1;3C" forward-word bindkey "^[[1;3C" forward-word
bindkey "\e[1;3D" backward-word bindkey "^[[1;5C" forward-word
bindkey "^[[1;3D" backward-word
bindkey "^[[1;5D" backward-word
bindkey "^[[7~" beginning-of-line bindkey "^[[7~" beginning-of-line
bindkey "^[[8~" end-of-line bindkey "^[[8~" end-of-line
bindkey "^[[3~" delete-char
bindkey "^[[3;3~" delete-word
export WORDCHARS='*?_[]~=&;!#$%^(){}'
x-bash-backward-kill-word(){ x-bash-backward-kill-word(){
WORDCHARS='' zle kill-word WORDCHARS='' zle kill-word
} }
@ -32,57 +80,48 @@ zle -N x-bash-backward-kill-word
bindkey '^[^[[3~' x-bash-backward-kill-word bindkey '^[^[[3~' x-bash-backward-kill-word
bindkey '^[^[[3^' x-bash-backward-kill-word bindkey '^[^[[3^' x-bash-backward-kill-word
autoload -U up-line-or-beginning-search bindkey '^[[A' history-substring-search-up
autoload -U down-line-or-beginning-search bindkey '^[[B' history-substring-search-down
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search # Up
bindkey "^[^[[A" up-line-or-beginning-search # Up
bindkey "^[[B" down-line-or-beginning-search # Down
bindkey "^[^[[B" down-line-or-beginning-search # Down
zstyle ':completion:*:sudo::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root"
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*'
zstyle :compinstall filename "$HOME/.zshrc"
autoload -U compinit ; compinit
plugins=(command-not-found history-substring-search sudo zsh-autosuggestions zsh-completions)
source $ZSH/oh-my-zsh.sh
source $ZSH/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}") ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}")
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down) ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down)
ZSH_HIGHLIGHT_STYLES[default]='fg=blue' HISTORY_SUBSTRING_SEARCH_FUZZY=true
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=true
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='underline'
typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[default]='fg=12'
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold' ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold'
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow' ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow'
ZSH_HIGHLIGHT_STYLES[alias]='fg=63' ZSH_HIGHLIGHT_STYLES[alias]='fg=blue'
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green,underline' ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green,underline'
ZSH_HIGHLIGHT_STYLES[builtin]='fg=63' ZSH_HIGHLIGHT_STYLES[builtin]='fg=blue'
ZSH_HIGHLIGHT_STYLES[function]='fg=63' ZSH_HIGHLIGHT_STYLES[function]='fg=blue'
ZSH_HIGHLIGHT_STYLES[command]='fg=63' ZSH_HIGHLIGHT_STYLES[command]='fg=blue'
ZSH_HIGHLIGHT_STYLES[precommand]='fg=63' ZSH_HIGHLIGHT_STYLES[precommand]='fg=blue'
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=blue' ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green' ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green'
ZSH_HIGHLIGHT_STYLES[path]='fg=63,underline' ZSH_HIGHLIGHT_STYLES[path]='fg=blue'
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=yellow,bold' ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=yellow,bold'
ZSH_HIGHLIGHT_STYLES[path_approx]='fg=red,bold,underline'
ZSH_HIGHLIGHT_STYLES[globbing]='fg=red' ZSH_HIGHLIGHT_STYLES[globbing]='fg=red'
ZSH_HIGHLIGHT_STYLES[comment]='fg=7'
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=blue' ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=blue'
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue' ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=12'
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue' ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=12'
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='none' ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=magenta'
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=yellow' ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=yellow'
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=yellow' ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=yellow'
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=yellow' ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=yellow'
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan' ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan' ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=cyan' ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[assign]='none' ZSH_HIGHLIGHT_STYLES[assign]='fg=green'
ZSH_HIGHLIGHT_STYLES[redirection]='none' ZSH_HIGHLIGHT_STYLES[redirection]='fg=cyan'
source $DOTFILES/aliases source "$DOTFILES/aliases"
# OPAM configuration # Load some manual plugins
. /home/frebib/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true source "$ZSH_DIR/plugins/sudo.zsh"
source "$ZSH_DIR/plugins/fish-theme.zsh"

136
aliases
View File

@ -11,15 +11,16 @@ alias ..ll="cd..;ll"
alias ..l="..ll" alias ..l="..ll"
alias l=ll alias l=ll
alias ll="ls -lFh" alias ll="ls -lFh --group-directories-first"
alias la="ls -lAFh" alias la="ls -lAFh --group-directories-first"
alias lat='la -t' alias lt='ls -lAFh --sort=time'
alias al=la # No, I don't need the Mono Assembly Linker alias al=la # No, I don't need the Mono Assembly Linker
alias md="mkdir -p" alias md="mkdir -p"
mcd(){ alias rd="rmdir -p"
mkdir -p $1 && cd $1 mcd(){ mkdir -p $@ && cd $@; }
} alias -- -='cd -'
alias cdt='cd `mktemp -d`'
alias grep='grep --color' alias grep='grep --color'
alias -g H='| head' alias -g H='| head'
alias -g T='| tail' alias -g T='| tail'
@ -34,9 +35,7 @@ alias -g NUL="&> /dev/null"
alias -g BG="&;disown" alias -g BG="&;disown"
alias -g COL="| column -t" alias -g COL="| column -t"
alias -g CLIP="| xclip -i -selection primary -f | xclip -i -selection clipboard" alias -g CLIP="| xclip -i -selection primary -f | xclip -i -selection clipboard"
calc() { calc() { bc -l <<< "$@"; }
echo "$@" | bc -l
}
alias svi=sudoedit alias svi=sudoedit
# This will enable us to use aliases in sudo. # This will enable us to use aliases in sudo.
@ -52,12 +51,25 @@ alias mv='mv -i'
alias cp='cp -ir' alias cp='cp -ir'
alias pacman='pacman --color=always' alias pacman='pacman --color=always'
alias pacaur='pacaur --color=always' alias pacaur='pacaur --color=always'
alias less='less -R'
alias tree='tree --dirsfirst -C -F' alias tree='tree --dirsfirst -C -F'
alias make="make -j$(nproc)"
alias dd='dd status=progress' alias dd='dd status=progress'
alias env='env | sort'
alias ssh="ssh -tt"
alias grip='grip --user=frebib --pass=$GRIP_API_KEY'
which gopass &>/dev/null && alias pass='gopass'
alias abuild='docker run -ti --rm \
-e USER \
-e PWD \
-w $PWD \
-v $PWD:$PWD \
-v ~/.abuild:/home/$USER/.abuild \
-v ~/.config/git:/home/$USER/.config/git:ro \
-v ~/.gnupg:/home/$USER/.gnupg \
frebib/alpine-sdk:edge abuild'
# System aliases # System aliases
alias s=systemctl alias s="sudo systemctl"
alias j=journalctl alias j=journalctl
alias p=pacaur alias p=pacaur
alias ps='ps aux' alias ps='ps aux'
@ -75,24 +87,25 @@ alias -s rar="unrar l"
alias -s tar="tar tf" alias -s tar="tar tf"
alias -s gz="tar tf" alias -s gz="tar tf"
alias -s jar="java -jar" alias -s jar="java -jar"
alias -s git="git clone" alias -s git="git clone --recursive"
# Git Aliases # Git Aliases
alias g=git alias g=git
alias gignore='$EDITOR .gitignore' alias gignore='$EDITOR .gitignore'
alias ggignore='$EDITOR ~/.config/git/gitignore'
alias gcl="git clone --recursive" alias gcl="git clone --recursive"
alias gco="git checkout" alias gco="git checkout"
alias gcom="git checkout master" alias gcom="git checkout master"
alias ga="git add" alias ga="git add"
alias gap="git -c interactive.diffFilter=\"git diff --color-words\" add -p"
alias gaa="ga -A" alias gaa="ga -A"
alias grm="git rm" alias grm="git rm"
alias gc="git commit" alias gc="git commit"
alias gcm="gc -m" alias gcm="gc -m"
alias gcma="git commit --amend -m"
alias gcman="git commit --amend --no-edit -m"
alias gca="git commit --amend" alias gca="git commit --amend"
alias gcan="git commit --amend --no-edit" alias gcan="git commit --amend --no-edit"
alias gcam="git commit --amend -m"
alias gst="git status" alias gst="git status"
alias gm="git merge" alias gm="git merge"
@ -106,18 +119,20 @@ alias gp="git push"
alias gpf="gp --force" alias gpf="gp --force"
alias gpsu="git push --set-upstream" alias gpsu="git push --set-upstream"
alias gpsuom="git push --set-upstream origin master" alias gpsuom="git push --set-upstream origin master"
alias gpall="git remote | xargs -L1 git push"
alias gl="git pull --rebase" alias gl="git pull --rebase"
alias glp="gl && gp" alias glp="gl && gp"
gd() { gd() {
local commit=$1 local commit=$1
if [ -z "$commit" ] || [ ${commit:0:1} != '@' ]; then if [ -z "$commit" ] || [ ${commit:0:1} != '@' ]; then
git diff $@ git diff --color-words $@
return return
else else
git diff "@~${commit:1}^!" git diff --color-words "@~${commit:1}^!"
fi fi
} }
alias gds="git diff --staged" alias gds="git diff --staged --color-words"
alias gsh="git show --color-words"
alias glg="git log --stat --color" alias glg="git log --stat --color"
alias glog="git log --oneline --decorate --color --graph" alias glog="git log --oneline --decorate --color --graph"
@ -126,6 +141,7 @@ alias gundo="git reset @~1"
alias gclean="git clean" alias gclean="git clean"
alias gbr="git branch" alias gbr="git branch"
alias gr="git remote" alias gr="git remote"
alias grv="git remote -v"
alias gra="gr add" alias gra="gr add"
alias grr="gr rm" alias grr="gr rm"
alias grao="gra origin" alias grao="gra origin"
@ -133,7 +149,7 @@ alias grro="grr origin"
alias gsta='git stash' alias gsta='git stash'
alias gstd='gsta drop' alias gstd='gsta drop'
alias gstl='gsta list' alias gstl='gsta list --stat --color'
alias gstp='gsta pop' alias gstp='gsta pop'
alias gstv="gsta show -p stash@{0}" alias gstv="gsta show -p stash@{0}"
@ -148,7 +164,7 @@ alias dbl='docker build --pull'
alias dbl.='docker build --pull .' alias dbl.='docker build --pull .'
alias drun='docker run -ti' alias drun='docker run -ti'
alias dkl='docker kill' alias dkl='docker kill'
dklrm() { docker kill $1 ; docker rm $1 } dklrm() { docker kill $@ ; docker rm $@ }
alias dst='docker stop' alias dst='docker stop'
alias drst='docker restart' alias drst='docker restart'
alias dnet='docker network' alias dnet='docker network'
@ -157,21 +173,63 @@ alias dlg='docker logs -f'
alias dalpine='docker run -ti --rm alpine /bin/sh' alias dalpine='docker run -ti --rm alpine /bin/sh'
alias drm-stopped='docker container prune' alias drm-stopped='docker container prune'
alias drmi-untag='docker image prune' alias drmi-untag='docker image prune'
alias dsh='_dsh exec' alias dprune='docker system prune -f'
alias drsh='_dsh "run --rm"' alias dsh='_CMD=dsh _dsh exec'
alias drsh='_CMD=drsh _dsh run --rm --entrypoint='
_dsh() { _dsh() {
local dowhat="$1" if [ $# -lt 2 ]; then
local user=$(echo "$2" | cut -d'@' -f1 -s) echo "Usage: ${_CMD:-$0} [user@]container [program [args]]" >&2
local prog="${@:3:$#}" return 64
local usercmd=""
if [ -z "$user" ]; then
host="$2"
else
host=`echo $2 | cut -d'@' -f2 -s`
usercmd="--user=$user "
fi fi
eval "docker $dowhat -ti $usercmd$host ${prog:-"/bin/sh"}" local dowhat="$1"
local docker_args=()
shift
while [ "${1:0:1}" = '-' ]; do
if [ "${1:0:2}" != '--' ]; then
docker_args+=("$1")
shift
fi
docker_args+=("$1")
shift
done
local user="$(echo "$1" | cut -d'@' -f1 -s)"
local prog="${@:2:$#}"
local usercmd=""
if [ -z "$user" ]; then
host="$1"
else
host=`echo $1 | cut -d'@' -f2 -s`
usercmd="--user=$user"
fi
if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" <&- ]; then
echo "No such container $host" >&2
return 5
fi
if [ -z "$prog" ]; then
set -o pipefail
local rm=
if [ "$dowhat" = 'run' ]; then
rm='--rm --entrypoint='
fi
for shell in bash sh; do
if shell_path="$(eval "docker $dowhat $rm $host which $shell" <&- | sed 's|[\r\n]||g')"; then
prog="$shell_path"
break
fi
done
set +o pipefail
if [ -z "$prog" ]; then
echo "Warning: No shell found in path.. trying /bin/sh" >&2
prog=/bin/sh
fi
fi
docker $dowhat ${docker_args[@]} -ti $usercmd $host $(xargs <<< $prog)
} }
alias dm='docker-machine' alias dm='docker-machine'
@ -188,15 +246,12 @@ alias zpool='sudo zpool'
alias z=zfs alias z=zfs
alias zp=zpool alias zp=zpool
# Packer, Vagrant aliases
alias pk=packer
alias v=vagrant
# General Aliases # General Aliases
alias ssha='eval `ssh-agent` ; ssh-add' alias ssha='eval `ssh-agent` ; ssh-add'
alias aliases="$EDITOR $DOTFILES/aliases ; source ~/.zshrc" alias aliases="$EDITOR $DOTFILES/aliases ; exec zsh"
alias vimrc="$EDITOR ~/.vimrc" alias vimrc="$EDITOR $MYVIMRC"
alias zshrc="$EDITOR ~/.zshrc ; source ~/.zshrc" alias zshrc="$EDITOR ~/.zshrc ; exec zsh"
alias gitrc="$EDITOR ~/.config/git/config"
alias xinitrc="$EDITOR ~/.xinitrc" alias xinitrc="$EDITOR ~/.xinitrc"
alias xresources="$EDITOR ~/.Xresources ; xrdb merge ~/.Xresources" alias xresources="$EDITOR ~/.Xresources ; xrdb merge ~/.Xresources"
alias xsession="$EDITOR ~/.xsession" alias xsession="$EDITOR ~/.xsession"
@ -209,9 +264,8 @@ i3b() {
} }
alias sf=screenfetch alias sf=screenfetch
alias nf=neofetch alias nf=neofetch
randstr() { randstr() { tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w $1 | head -n 1; }
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $1 | head -n 1 alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"
}
alias lab="ssh -tt tw '~/ctl' 2>/dev/null" alias lab="ssh -tt tw '~/ctl' 2>/dev/null"

View File

@ -1,9 +1,14 @@
#!/bin/sh #!/bin/sh
set -e set -e
xrandr --output DP-0.1 --primary --mode 1920x1080 --pos 0x1080 --rotate normal \ TOP_LEFT="DP-1"
--output DP-0.2.1 --mode 1920x1080 --pos 0x0 --rotate inverted \ TOP_RIGHT="DP-3"
--output DP-0.2.2.1 --mode 1920x1080 --pos 1920x0 --rotate inverted \ BOTTOM_LEFT="DP-5"
--output DP-0.2.2.2.1 --mode 1920x1080 --pos 1920x1080 --rotate normal BOTTOM_RIGHT="HDMI-0"
xrandr --output $BOTTOM_LEFT --primary --mode 1920x1080 --pos 0x1080 --rotate normal \
--output $TOP_LEFT --mode 1920x1080 --pos 0x0 --rotate inverted \
--output $TOP_RIGHT --mode 1920x1080 --pos 1920x0 --rotate inverted \
--output $BOTTOM_RIGHT --mode 1920x1080 --pos 1920x1080 --rotate normal
[ -e ~/.fehbg ] && ~/.fehbg [ -e ~/.fehbg ] && ~/.fehbg

86
scripts/rofi-emoji Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env bash
#
# Use rofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# rofi, xsel, xdotool, curl, xmllint
#
# Usage:
# 1. Download all emoji
# $ rofi-emoji --download
#
# 2. Run it!
# $ rofi-emoji
#
# Notes:
# * You'll need a emoji font like "Noto Emoji" or "EmojiOne".
# * Confirming an item will automatically paste it WITHOUT
# writing it to your clipboard.
# * Ctrl+C will copy it to your clipboard WITHOUT pasting it.
#
# Where to save the emojis file.
EMOJI_FILE="$HOME/.cache/emojis.txt"
# Urls of emoji to download.
# You can remove what you don't need.
URLS=(
'https://emojipedia.org/people/'
'https://emojipedia.org/nature/'
'https://emojipedia.org/food-drink/'
'https://emojipedia.org/activity/'
'https://emojipedia.org/travel-places/'
'https://emojipedia.org/objects/'
'https://emojipedia.org/symbols/'
'https://emojipedia.org/flags/'
)
function download() {
echo "" > "$EMOJI_FILE"
for url in "${URLS[@]}"; do
echo "Downloading: $url"
# Download the list of emoji and remove all the junk around it
emojis=$(curl -s "$url" | \
xmllint --html \
--xpath '//ul[@class="emoji-list"]' - 2>/dev/null)
# Get rid of starting/closing ul tags
emojis=$(echo "$emojis" | head -n -1 | tail -n +1)
# Extract the emoji and its description
emojis=$(echo "$emojis" | \
sed -rn 's/.*<span class="emoji">(.*)<\/span> (.*)<\/a><\/li>/\1 \2/p')
echo "$emojis" >> "$EMOJI_FILE"
done
}
function display() {
emoji=$(cat "$EMOJI_FILE" | grep -v '#' | grep -v '^[[:space:]]*$')
line=$(echo "$emoji" | rofi -dmenu -i -p emoji -kb-custom-1 Ctrl+c $@)
exit_code=$?
line=($line)
if [ $exit_code == 0 ]; then
xdotool type --clearmodifiers "${line[0]}"
elif [ $exit_code == 10 ]; then
echo -n "${line[0]}" | xsel -i -b
fi
}
if [[ "$1" =~ -D|--download ]]; then
download
exit 0
elif [[ "$1" =~ -h|--help ]]; then
echo "usage: $0 [-D|--download]"
exit 0
fi
display

View File

@ -1,18 +1,29 @@
YCM=~/.vim/bundle/YouCompleteMe #!/bin/sh
set -e
sudo pacman -S python cmake --needed --noconfirm ############################
## Check for dependencies ##
############################
error() { >&2 printf "Error: %s" "$1"; exit 1; }
which cmake >/dev/null 2>&1 || error 'cmake is not installed'
which clang >/dev/null 2>&1 || error 'clang is not installed'
which python >/dev/null 2>&1 || error 'python is not installed'
[ -z "$VIMDIR" ] && error '$VIMDIR is not set'
####################### #######################
## Initialise Vundle ## ## Initialise Vundle ##
####################### #######################
mkdir -p ~/.vim/{bundle,swapfiles} mkdir -p "$VIMDIR/bundle" "$VIMDIR/swapfiles"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim if [ ! -d "$VIMDIR/bundle/Vundle.vim" ]; then
vim +PluginInstall +qall git clone https://github.com/VundleVim/Vundle.vim.git "$VIMDIR/bundle/Vundle.vim"
fi
vim +PluginUpdate +qall
######################### #########################
## Setup YouCompleteMe ## ## Setup YouCompleteMe ##
######################### #########################
cd "$YCM" cd "$VIMDIR/bundle/YouCompleteMe"
git submodule update --init --recursive git submodule update --init --recursive
./install.py --clang-completer ./install.py --system-libclang --clang-completer

View File

@ -2,9 +2,9 @@
set -e set -e
# Install pkgfile for command-not-found support # Install pkgfile for command-not-found support
sudo pacman -S pkgfile --no-confirm --needed sudo pacman -S pkgfile --noconfirm --needed
sudo systemctl enable --now pkgfile-update.service sudo systemctl enable --now pkgfile-update.service
pkgfile --update sudo pkgfile --update
dest="$HOME/.local/share" dest="$HOME/.local/share"
mkdir -p "$dest" mkdir -p "$dest"