move config files to new yadm dir

This commit is contained in:
Simonas Narbutas
2019-11-21 10:23:04 +01:00
parent 8c78170a3a
commit 07551e044a
35 changed files with 439 additions and 7 deletions

View File

@@ -0,0 +1,10 @@
remove lock = Caps_Lock
remove control = Control_L
remove mod4 = Super_L
remove mod1 = Alt_L
keycode 66 = Control_L
keycode 64 = Super_L
keycode 133 = Alt_L
add mod1 = Alt_L
add mod4 = Super_L
add control = Control_L

View File

@@ -0,0 +1,20 @@
#!/bin/bash
#
# adjust screen brightness
#
#
# Script to adjust screen brightness
function usage_and_exit {
echo "Usage: $(basename ${0}) <param1>"
exit 1
}
# Exit if we have an incorrect number of arguments
if [ ${#} -ne 1 ]; then
usage_and_exit
fi
BRIGHTNESS=$(( $(</sys/class/backlight/intel_backlight/brightness)+${1} ))
if (( $BRIGHTNESS < 7500 )) && (( $BRIGHTNESS > 0 ))
then
echo $BRIGHTNESS > "/sys/class/backlight/intel_backlight/brightness"
fi
echo $(( 100*$BRIGHTNESS/7500 ))

View File

@@ -0,0 +1,7 @@
#!/bin/bash
menu=$(echo -e "firefox -P work\nfirewarden chromium\nchromium --profile-directory=Default\ngoogle-chat-linux.sh\n| xclip -selection c\n" | rofi -dmenu -p "browser ")
if [[ $menu == \|* ]]; then
eval echo \"$@\" $menu > /dev/null 2>&1 &
else
eval $menu \"$@\" > /dev/null 2>&1 &
fi

1
.config/yadm/alt/.bin/codezsh Executable file
View File

@@ -0,0 +1 @@
ZDOTDIR=/home/snarbutas/.yadm/alt/codeshell /bin/zsh

Binary file not shown.

BIN
.config/yadm/alt/.bin/exercism Executable file

Binary file not shown.

View File

@@ -0,0 +1 @@
/home/snarbutas/kafkatool/kafkatool

10
.config/yadm/alt/.bin/kbdswitch Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
LANG1="us"
LANG2="lt"
CURRENT_LANG=$(setxkbmap -query | grep layout |awk -F" " '{print $2}')
if [ "$CURRENT_LANG" = $LANG1 ]; then
setxkbmap $LANG2 && echo $LANG2
else
setxkbmap $LANG1 && echo $LANG1
fi
xmodmap ~/.Xmodmap

View File

@@ -0,0 +1,17 @@
#!/bin/sh
DISPLAY_COUNT=$(xrandr -d :0 -q | grep ' connected' | wc -l)
if [ "$DISPLAY_COUNT" == 3 ]
then
xrandr --output eDP1 --primary --mode 1920x1080 --pos 0x360 --rotate normal
xrandr --output DP1-2 --mode 2560x1440 --pos 4480x0 --rotate normal
xrandr --output DP1-1 --mode 2560x1440 --pos 1920x0 --rotate normal
elif [ "$DISPLAY_COUNT" == 1 ]
then
xrandr --output DP1-2 --off
xrandr --output DP1-1 --off
xrandr --output eDP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal
elif [ "$DISPLAY_COUNT" == 2 ]
then
xrandr --output HDMI1 --mode 2560x1440 --pos 1920x0 --rotate normal
xrandr --output eDP1 --primary --mode 1920x1080 --pos 0x360 --rotate normal
fi

BIN
.config/yadm/alt/.bin/packer Executable file

Binary file not shown.

16
.config/yadm/alt/.bin/rdpto Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
#
# Connect to Win VMs
#
# A script to connect to windows machines
function usage_and_exit {
echo "Usage: $(basename ${0}) <host fqdn>"
exit 1
}
# Exit if we have an incorrect number of arguments
if [ ${#} -ne 1 ]; then
usage_and_exit
fi
menu=$(gopass ls --flat | rofi -dmenu -p "gopass")
xfreerdp +clipboard /u:snarbutas /v:"${1}" /drive:home,/home/snarbutas/temp/smb /p:"$(gopass $menu)" /size:1600x1200 /sec:rdp

9
.config/yadm/alt/.bin/rofipass Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
menu=$(gopass ls --flat | rofi -dmenu -p "gopass")
if [[ $menu == \|* ]]; then
eval echo \"$@\" $menu > /dev/null 2>&1 &
else
eval gopass -c $menu \"$@\" > /dev/null 2>&1 &
fi

399
.config/yadm/alt/.bin/rtm Executable file
View File

@@ -0,0 +1,399 @@
#!/bin/bash
#
# rtm -- Release to Master
# Implements the release process of Vincent Driessen's branching model:
# http://nvie.com/posts/a-successful-git-branching-model/
#
# Since we use the model at Bol.com for puppet modules, this script
# will also check for metadata.json and Modulefile but it only does
# something with it if it actually finds it.
#
# If xclip is installed then the version number will be sent to the
# clipboard. This is handy for if you want to add it to the annotated
# tag during the gitflow release process.
#
# Author: Steven Meunier <smeunier@bol.com>
# Version: 0.2.0
set -e
script_abort() {
echo
echo "Oops, it looks like something went wrong that I can't recover from."
echo "You now have two options:"
echo " 1) Fix the problem and continue the release process manually."
echo " 2) Rollback any part of the release already performed, fix what"
echo " caused the issue and try running the script again."
echo "Whatever you decide, please don't blindly re-run this script as the results"
echo "could be unexpected."
exit 1
}
trap script_abort ERR
commit_counts () {
local SOURCE=${1:-"@{upstream}"}
local TARGET=${2:-"HEAD"}
echo $(git rev-list --no-merges --count --left-right $SOURCE...$TARGET 2> /dev/null)
}
commits_behind () {
local SOURCE=${1:-"@{upstream}"}
local TARGET=${2:-"HEAD"}
local counts=( $(commit_counts $SOURCE $TARGET) )
echo ${counts[0]}
}
commits_ahead () {
local SOURCE=${1:-"@{upstream}"}
local TARGET=${2:-"HEAD"}
local counts=( $(commit_counts $SOURCE $TARGET) )
echo ${counts[1]}
}
get_current_branch() {
echo -n $(git describe --contains --all HEAD)
}
get_git_release () {
local BRANCH=${1:-"master"}
echo -n $(git describe $BRANCH 2> /dev/null | cut -d'-' -f 1)
}
get_metadata_release () {
if [[ -f "metadata.json" ]]
then
echo -n $(grep -E "\"version\"" metadata.json | sed -E "s/\"version\":\s*[\"\'](.*)[\"\']\,$/\1/")
elif [[ -f "Modulefile" ]]
then
echo -n $(grep -E "^version" Modulefile | sed -E "s/^version '(.*)'$/\1/")
fi
}
get_git_dir () {
echo $(git rev-parse --git-dir 2> /dev/null)
}
get_remote_name () {
local BRANCH=${1:-"master"}
echo $(git config --local --get "branch.${BRANCH}.remote" 2> /dev/null)
}
git_push () {
local BRANCH=$1
local THROUGH_GERRIT=${2:-"true"}
git checkout -q $BRANCH
if [[ "${THROUGH_GERRIT}" =~ ^[tT]{1}([rR]{1}[uU]{1}[eE]{1})*$ ]]
then
local GERRIT_PREFIX="HEAD:refs/for"
else
local GERRIT_PREFIX="HEAD:refs/heads"
fi
git push $(get_remote_name ${BRANCH}) ${GERRIT_PREFIX}/${BRANCH}
}
git_push_tag () {
local TAG=${1:-${VERSION}}
git push $(get_remote_name ${BRANCH}) ${TAG}
}
increment_version () {
# Taken from http://stackoverflow.com/questions/8653126/how-to-increment-version-number-in-a-shell-script
local VERSION=${1:-$(get_git_release)}
echo $VERSION | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}'
}
is_inside_work_tree () {
[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == "true" ]
}
is_gitflow_installed () {
local GITFLOW=$(git flow version > /dev/null 2>&1)
if [[ "$?" -ne "0" ]]; then
false
else
true
fi
}
show_diff () {
local SOURCE_BRANCH=${1:-"master"}
local TARGET_BRANCH=${2:-$(get_remote_name ${SOURCE_BRANCH})/${SOURCE_BRANCH}}
git diff ${TARGET_BRANCH} ${SOURCE_BRANCH}
}
show_commits_to_be_pushed () {
local SOURCE_BRANCH=${1:-"master"}
local TARGET_BRANCH=${2:-$(get_remote_name ${SOURCE_BRANCH})/${SOURCE_BRANCH}}
local FORMAT=${3:-"format:%Cgreen%h%Creset %<(70)%s %<(25)%Cblue%an%Creset (%ai)"}
echo "The following commits will be pushed to ${TARGET_BRANCH}:"
echo -e "$(git log --pretty="${FORMAT}" ${TARGET_BRANCH}..${SOURCE_BRANCH})"
}
show_current_release () {
local METADATA_RELEASE=$(get_metadata_release)
local GIT_RELEASE=$(get_git_release)
if [[ $GIT_RELEASE != $METADATA_RELEASE && "x${METADATA_RELEASE}" != "x" ]]
then
local VERSION_SUFFIX=" (metadata.json/Modulefile has ${METADATA_RELEASE})"
else
local VERSION_SUFFIX=""
fi
echo $GIT_RELEASE $VERSION_SUFFIX
}
yes_no_prompt () {
local PROMPT=${1:-"Are you sure? [y/N] "}
local CMD_WHEN_YES=${2:-"true"}
local CMD_WHEN_NO=${3:-"false"}
read -p "$PROMPT" RESPONSE
if [[ $RESPONSE =~ ^[yY]([eE]{1}[sS]{1})*$ ]]
then
$CMD_WHEN_YES
elif [[ $RESPONSE =~ ^[nN][oO]*$ ]]
then
$CMD_WHEN_NO
else
echo "Please answer 'yes' or 'no'"
yes_no_prompt "$PROMPT" "$CMD_WHEN_YES" "$CMD_WHEN_NO"
fi
}
convert_modulefile () {
PUPPETBIN=$(which puppet 2> /dev/null)
: ${EDITOR:=$(which vi 2> /dev/null)}
if [[ -z "${PUPPETBIN}" ]]
then
echo "Puppet is required to convert the Modulefile. Skipping conversion."
else
"${PUPPETBIN}" module build
if [[ $? -eq 0 ]]
then
cp pkg/*/metadata.json ./
yes_no_prompt "Edit metadata.json before commit? [y/N] " "${EDITOR} metadata.json" true
if $(grep -q metadata.json .gitignore)
then
sed -i '/metadata.json/d' .gitignore
git add .gitignore
fi
git add metadata.json
git rm -f Modulefile
rm -rf pkg
git commit -m "Convert Modulefile to metadata.json"
else
echo "Converting Modulefile to metadata.json failed."
fi
fi
}
update_metadata () {
local VERSION=$1
local UPDATE_FLAG=0
if [[ -f "metadata.json" && "x${VERSION}" != "x" && $(get_metadata_release) != "${VERSION}" ]]
then
sed -i -e "s/\"version\":.*/\"version\": \"${VERSION}\"\,/" metadata.json
git add metadata.json
UPDATE_FLAG=1
fi
if [[ $UPDATE_FLAG != 0 ]]
then
git commit -m "Bumped version"
fi
}
send_version_to_clipboard () {
local VERSION=${1}
local XCLIP_BIN=$(which xclip 2> /dev/null)
if [[ "x$XCLIP_BIN" != "x" ]]
then
echo -n $VERSION | ${XCLIP_BIN} -in
fi
}
prompt_release_version () {
local INPUT_VERSION
local INCREMENT_VERSION=$(increment_version)
echo "Current release is:" $(show_current_release)
echo "Default version to release: $INCREMENT_VERSION"
read -e -p "Version to Release: " INPUT_VERSION
if [ "x$INPUT_VERSION" != "x" ]
then
VERSION=$INPUT_VERSION
else
VERSION=$INCREMENT_VERSION
fi
}
ensure_change_id () {
# Gerrit is likely to be configured to require a change-id but
# merge commits with gitflow don't add it so we need to do that
# ourselves. We do that by amending the merge commit. If the
# change-id hook is installed then a change-id will be added. If
# not, then nothing will happen and presumably Gerrit is then not
# configured to require it either.
local LOG=$(git log -1)
local VERSION=${1:-${VERSION}}
if $(echo ${LOG} | grep -q "Merge:") && [[ $(echo ${LOG} | grep -q "Change-Id:") != 0 ]]
then
COMMIT=$(echo ${LOG} | head -1 | awk '{print $2}')
echo "Change-Id is missing. Adding it..."
git commit --amend -C ${COMMIT}
# This will mess up our annotated tag so we need to move it to
# our amended commit
if [[ $(get_current_branch) == "master" ]]
then
TAG_MSG=$(git show --pretty="format:%b" ${VERSION} | tail -n +3)
git tag -f -a ${VERSION} -m "${TAG_MSG}"
fi
fi
}
ensure_git_flow_enabled () {
if ! [[ $(grep gitflow $(get_git_dir)/config) ]]
then
echo "Enabling gitflow"
git flow init -d > /dev/null
fi
}
gitflow_release () {
local VERSION=${1}
# gitflow creates an annotated tag so the user will be prompted to
# enter one. There is no way around that unless we perform the
# steps ourselves rather than use gitflow.
git flow release start $VERSION
# While we could have converted the Modulefile while checking for
# the version, we wait until starting the release for so that we
# can include the commit for it as part of the release.
if [[ -f "Modulefile" ]] && [[ ! -f "metadata.json" ]]
then
echo "Modulefile is deprecated. Will attempt to convert it to metadata.json"
convert_modulefile
fi
update_metadata $VERSION
git flow release finish $VERSION
}
push_changes () {
local BRANCH=${1:-"master"}
if [[ $(commits_ahead $(get_remote_name ${BRANCH})/${BRANCH} ${BRANCH}) -ne 0 ]]
then
yes_no_prompt "Push branch '${BRANCH}' to '$(get_remote_name ${BRANCH})' [y/N] " "git_push ${BRANCH}" true
else
echo "No changes to push for branch '${BRANCH}'"
fi
}
verify_changes () {
local BRANCH=${1:-"master"}
if [[ $(commits_ahead $(get_remote_name ${BRANCH})/${BRANCH} ${BRANCH}) -ne 0 ]]
then
yes_no_prompt "Show commits to be pushed for '${BRANCH}'? [y/N] " "show_commits_to_be_pushed ${BRANCH}" true
yes_no_prompt "Show diff for '${BRANCH}'? [y/N] " "show_diff ${BRANCH}" true
else
echo "Local and remote branch '${BRANCH}' are the same"
fi
}
### Preparation
GIT_DIR=${1:-$(pwd)}
cd $GIT_DIR
if ! $(is_inside_work_tree)
then
echo "Error: ${GIT_DIR} is not a git repository"
exit 1
fi
for BRANCH in "develop" "master"
do
if [[ $(commits_ahead $(get_remote_name ${BRANCH})/${BRANCH} ${BRANCH}) -ne 0 ]]
then
echo "Error: Your local branch '${BRANCH}' is ahead of the remote branch"
echo "It's not possible to perform a release."
echo "I recommend creating a new branch, resetting to the remote branch and trying again:"
echo " git checkout -b ${BRANCH}_ahead"
echo " git checkout ${BRANCH}"
echo " git reset --hard $(get_remote_name ${BRANCH})/${BRANCH}"
exit 1
fi
done
if ! $(is_gitflow_installed)
then
echo "Error: Gitflow is required. It can be obtained from:"
echo "https://github.com/nvie/gitflow"
exit 1
fi
ensure_git_flow_enabled
git fetch > /dev/null
for BRANCH in "develop" "master"
do
echo "Preparing ${BRANCH} for release:"
git checkout -q ${BRANCH}
# It's more efficient to only pull the branch if there are changes
# but it doesn't hurt to explicitly pull either...just to be sure
# we don't have any issues when pushing to Gerrit
git pull --rebase
echo
done
if [[ $(commits_ahead master develop) -eq 0 ]]
then
echo "Nothing to merge to master for ${GIT_DIR}"
echo "Current version is $(show_current_release)"
send_version_to_clipboard $(get_git_release)
exit 2
fi
### End Preparation
### Before release to master
# Exploit BASH's global variables so that the VERSION that is obtained
# in the function is available outside of the function. Hence, no
# explicit assignment to a variable here. If we did assign to a
# variable, we wouldn't be able to echo the current version.
prompt_release_version
send_version_to_clipboard ${VERSION}
gitflow_release ${VERSION}
### Give user a chance to see what will change before making any
### changes on the remote server
for BRANCH in "develop" "master"
do
git checkout -q ${BRANCH}
ensure_change_id
verify_changes ${BRANCH}
done
### Now we're ready to push the changes
for BRANCH in "develop" "master"
do
push_changes ${BRANCH}
done
yes_no_prompt "Push tag '${VERSION}' to '$(get_remote_name master)' [y/N] " "git_push_tag ${VERSION}" true
exit 0

1
.config/yadm/alt/.bin/scrotty Executable file
View File

@@ -0,0 +1 @@
scrot -s '%d-%m-%y_%H_%M_scrot.png' -e 'mv $f ~/Pictures/scrots/'

4
.config/yadm/alt/.bin/simit Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
gopass bolcom/ad/snarbutas |sudo openconnect --conf /etc/openconnect/bol-vpn-At-Papendorp.conf remote.bol.com --user snarbutas
sleep 2
gopass bolcom/dc/snarbutas |kinit -p snarbutas@BOLCOM.NET

Binary file not shown.

View File

@@ -0,0 +1,702 @@
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup").widget
-- Battery notif
local battery = require("battery")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors })
end
-- Handle runtime errors after startup
do
local in_error = false
awesome.connect_signal("debug::error", function (err)
-- Make sure we don't go into an endless error loop
if in_error then return end
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err) })
in_error = false
end)
end
-- }}}
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
beautiful.wallpaper = "/home/snarbutas/Pictures/wallpaper1.jpg"
-- This is used later as the default terminal and editor to run.
terminal = "termite"
editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor
-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = {
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.spiral,
awful.layout.suit.spiral.dwindle,
awful.layout.suit.floating,
awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
awful.layout.suit.corner.nw,
-- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se,
}
-- }}}
-- {{{ Helper functions
local function client_menu_toggle_fn()
local instance = nil
return function ()
if instance and instance.wibox.visible then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ theme = { width = 250 } })
end
end
end
-- }}}
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "hotkeys", function() return false, hotkeys_popup.show_help end},
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
{ "quit", function() awesome.quit() end}
}
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal }
}
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mymainmenu })
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- }}}
-- Keyboard map indicator and switcher
mykeyboardlayout = awful.widget.keyboardlayout()
-- Volume
volumewidget = wibox.widget.textbox(awful.spawn.easy_async("pamixer --sink ${pamixer --list-sinks |tail -1 |cut -d' ' -f1} --get-volume",function(stdout, stderr, reason, exit_code)
volumewidget:set_text(" 🔈:"..stdout)
end))
-- Battery
batterywidget = wibox.widget.textbox()
-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
local cal_notification
-- {{{ Calendar
mytextclock:connect_signal("button::release",
function()
if cal_notification == nil then
awful.spawn.easy_async([[bash -c "cal -3 -m --color=always |sed 's#\x1B\[7m\([ 0-9]\+\)\x1B\[27m#<span foreground=\"red\"><b>\1</b></span>#'"]],
function(stdout, stderr, reason, exit_code)
cal_notification = naughty.notify{
text = stdout,
font = "Source Code Pro",
timeout = 0,
width = auto,
destroy = function() cal_notification = nil end
}
end
)
else
naughty.destroy(cal_notification)
end
end)
-- }}}
-- {{{ change keyboard layout
mykeyboardlayout:connect_signal("button::release",
function()
if kbd_notification == nil then
awful.spawn.easy_async([[sh -c "~/.bin/kbdswitch"]], function(stdout, stderr, reason, exit_code)
kbd_notification = naughty.notify{
title = "Keyboard",
text = stdout,
timeout = 0.5,
destroy = function() kbd_notification = nil end}
end)
else
naughty.destroy(kbd_notification)
end
end)
-- }}}
-- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
-- Without this, the following
-- :isvisible() makes no sense
c.minimized = false
if not c:isvisible() and c.first_tag then
c.first_tag:view_only()
end
-- This will also un-minimize
-- the client, if needed
client.focus = c
c:raise()
end
end),
awful.button({ }, 3, client_menu_toggle_fn()),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
local function set_wallpaper(s)
-- Wallpaper
if beautiful.wallpaper then
local wallpaper = beautiful.wallpaper
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
end
gears.wallpaper.maximized(wallpaper, s, true)
end
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
awful.tag({ "termite", "web", "code", "gimp", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
-- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt()
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)))
-- Create a taglist widget
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)
-- Create a tasklist widget
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons)
-- Create the wibox
s.mywibox = awful.wibar({ position = "top", screen = s })
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
mykeyboardlayout,
wibox.widget.systray(),
mytextclock,
volumewidget,
batterywidget,
s.mylayoutbox,
},
}
end)
-- }}}
-- {{{ Mouse bindings
root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}
-- {{{ Key bindings
globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
end,
{description = "focus next by index", group = "client"}
),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "client"}
),
awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "client"}),
-- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
-- Rofi gopass
awful.key({ modkey, "Shift" }, "p",
function ()
awful.util.spawn("/home/snarbutas/.bin/rofipass")
end ,
{description = "Show pass", group = "launcher"}),
-- Display Brightness
awful.key({}, "XF86MonBrightnessUp",
function ()
awful.spawn.easy_async("/home/snarbutas/.bin/brightness +750", function(stdout, stderr, reason, exit_code)
naughty.notify {icon = "/home/snarbutas/Pictures/icons/wbulb.png", icon_size = 16, text = stdout, timeout = 0.5}
end)
end),
awful.key({}, "XF86MonBrightnessDown",
function ()
awful.spawn.easy_async("/home/snarbutas/.bin/brightness -750", function(stdout, stderr, reason, exit_code)
naughty.notify {icon = "/home/snarbutas/Pictures/icons/wbulb.png", icon_size = 16, text = stdout, timeout = 0.5}
end)
end),
-- Extend monitor
awful.key({ "Control", "Mod4" }, "e", function () awful.util.spawn("/home/snarbutas/.bin/multimonitor", false) end),
-- Lock computer
awful.key({ "Control", "Mod4" }, "l", function () awful.util.spawn("loginctl lock-session") end),
awful.key({ "Control", "Mod4", "Shift" }, "l",
function ()
awful.util.spawn("systemctl suspend")
end),
-- Audio controls
awful.key({ }, "XF86AudioMute",
function ()
awful.util.spawn("pamixer --sink 0 -t", false)
awful.spawn.easy_async_with_shell("pamixer --sink $(pamixer --list-sinks |tail -1 |cut -d' ' -f1) --get-mute", function(stdout, stderr, reason, exit_code)
naughty.notify {title = "mute", text = stdout, timeout = 0.5}
if string.match(stdout, "true" ) then
volumewidget:set_text(" 🔇 ")
else
awful.spawn.easy_async_with_shell("pamixer --sink $(pamixer --list-sinks |tail -1 |cut -d' ' -f1) --get-volume", function(stdout, stderr, reason, exit_code)
volumewidget:set_text(" 🔈:"..stdout)
naughty.notify {title = "Inc", text = stdout, timeout = 0.5}
end)
end
end)
end),
awful.key({ }, "XF86AudioMicMute",
function ()
awful.util.spawn("pamixer --source 1 -t", false)
awful.spawn.easy_async("pamixer --source 1 --get-mute", function(stdout, stderr, reason, exit_code)
naughty.notify {title = "mute mic", text = stdout, timeout = 0.5}
end)
end),
awful.key({ }, "XF86AudioLowerVolume",
function ()
awful.spawn.easy_async_with_shell("pamixer --sink $(pamixer --list-sinks |tail -1 |cut -d' ' -f1) -d 5 --get-volume", function(stdout, stderr, reason, exit_code)
volumewidget:set_text(" 🔈:"..stdout)
naughty.notify {title = "🔈↓", text = stdout, timeout = 0.5}
end)
end),
awful.key({ }, "XF86AudioRaiseVolume",
function ()
awful.spawn.easy_async_with_shell("pamixer --sink $(pamixer --list-sinks |tail -1 |cut -d' ' -f1) -i 5 --get-volume", function(stdout, stderr, reason, exit_code)
volumewidget:set_text(" 🔈:"..stdout)
naughty.notify {title = "🔈↑", text = stdout, timeout = 0.5}
end)
end),
awful.key({ "Control", "Mod4" }, "Up",
function ()
awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause", naughty.notify {title = "play/pause", timeout = 0.5, bg = "#ad11c7"})
end),
awful.key({ "Control", "Mod4" }, "Down",
function ()
awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop", naughty.notify {title = "Stop", timeout = 0.5, bg = "#ad11c7"})
end),
awful.key({ "Control", "Mod4" }, "Left",
function ()
awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous", naughty.notify {title = "Previous", timeout = 0.5, bg = "#ad11c7"})
end),
awful.key({ "Control", "Mod4" }, "Right",
function ()
awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next", naughty.notify {title = "Next", timeout = 0.5, bg = "#ad11c7"})
end),
awful.key({ "Control", "Mod4" }, "s",
function ()
awful.util.spawn_with_shell("sleep 0.5 && scrotty", naughty.notify {title = "scrot complete", timeout = 0.5, bg = "#ad11c7"})
end),
awful.key({ modkey, "Control" }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
client.focus = c
c:raise()
end
end,
{description = "restore minimized", group = "client"}),
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
-- Menubar
awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"})
)
clientkeys = gears.table.join(
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end ,
{description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end ,
{description = "(un)maximize", group = "client"}),
awful.key({ modkey, "Control" }, "m",
function (c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end ,
{description = "(un)maximize vertically", group = "client"}),
awful.key({ modkey, "Shift" }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end ,
{description = "(un)maximize horizontally", group = "client"})
)
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
globalkeys = gears.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
end
clientbuttons = gears.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize))
-- Set keys
root.keys(globalkeys)
-- }}}
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
-- Floating clients.
{ rule_any = {
instance = {
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
},
class = {
"Arandr",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Wpa_gui",
"pinentry",
"veromix",
"xtightvncviewer"},
name = {
"Event Tester", -- xev.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
}, properties = { floating = true }},
-- Add titlebars to normal clients and dialogs
{ rule_any = {type = { "normal", "dialog" }
}, properties = { titlebars_enabled = false }
},
-- Set Firefox to always map on the tag named "2" on screen 1.
-- { rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } },
}
-- }}}
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup and
not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = gears.table.join(
awful.button({ }, 1, function()
client.focus = c
c:raise()
awful.mouse.client.move(c)
end),
awful.button({ }, 3, function()
client.focus = c
c:raise()
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c) : setup {
{ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{ -- Middle
{ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,
layout = wibox.layout.flex.horizontal
},
{ -- Right
awful.titlebar.widget.floatingbutton (c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton (c),
awful.titlebar.widget.ontopbutton (c),
awful.titlebar.widget.closebutton (c),
layout = wibox.layout.fixed.horizontal()
},
layout = wibox.layout.align.horizontal
}
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- Automatically check battery
batterywidget_timer = timer({timeout = 1})
batterywidget_timer:connect_signal("timeout", function()
batterywidget:set_text(batteryInfo("BAT0"))
end)
batterywidget_timer:start()
-- }}}

View File

@@ -0,0 +1,3 @@
---
pkcs7_public_key: '/home/snarbutas/.eyaml/hiera_public_key.pkcs7.pem'
pkcs7_private_key: '/home/snarbutas/.eyaml/hiera_private_key.pkcs7.pem'

View File

@@ -0,0 +1,26 @@
[libdefaults]
default_realm = BOLCOM.NET
forwardable = true
kdc_timesync = 1
ccache_type = 4
proxiable = true
dns_lookup_kdc = true
dns_lookup_realm = true
[realms]
BOLCOM.NET = {
admin_server = adm-aaa-vip.bolcom.net
default_domain = bolcom.net
}
[domain_realm]
.bolcom.net = BOLCOM.NET
bolcom.net = BOLCOM.NET
.local.nl.bol.com = BOLCOM.NET
local.nl.bol.com = BOLCOM.NET
bol.com = BOLCOM.NET
.bol.com = BOLCOM.NET
[login]
krb4_convert = true
krb4_get_tickets = false

View File

@@ -0,0 +1,50 @@
Host narbuto.lt 192.168.178.100
User simas
PubKeyAuthentication yes
# UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa_home
Host mail.narbutas.it 116.203.70.29
User simas
PubKeyAuthentication yes
# UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa_mail_epiphanius
Host git.narbuto.lt
User git
PubKeyAuthentication yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa_backute_gitea
Host gitlab.bol.io
User git
PubKeyAuthentication yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa_bolcom_io_snarbutas
Host adm-gerrit-001 adm-gerrit-001.ams4.bolcom.net gerrit.internal.adm.bol.com gerrit.tools.bol.com
User snarbutas
Port 29418
IdentityFile ~/.ssh/id_rsa_gerrit
# UseKeychain yes
AddKeysToAgent yes
KexAlgorithms +diffie-hellman-group1-sha1
HostkeyAlgorithms ssh-dss
# LogLevel=quiet
Host adm*.bolcom.net tst*bolcom.net pro*bolcom.net acc*bolcom.net xpr*bolcom.net sbx*bolcom.net shd*bolcom.net dev*bolcom.net
ServerAliveInterval 120
Hostname %h
User snarbutas
GSSAPIAuthentication yes
GSSAPIDelegateCredentials yes
StrictHostKeyChecking no
Host adm* tst* pro* acc* xpr* sbx* shd* dev*
ServerAliveInterval 120
Hostname %h.bolcom.net
User snarbutas
GSSAPIAuthentication yes
GSSAPIDelegateCredentials yes
StrictHostKeyChecking no

View File

@@ -0,0 +1,4 @@
xss-lock -- i3lock -c 000000 -i /home/snarbutas/Pictures/texture1_1.png -t -e &
xmodmap ~/.Xmodmap 2>~/.Xmodlog
ssh-agent -s > ~/.ssh/agent
exec awesome

View File

@@ -0,0 +1,9 @@
for dir in /usr/bin /usr/sbin /sbin /bin /home/snarbutas/.bin; do
if test -d "$dir" && ! grep -q -e "^${dir}:" -e ":${dir}:" -e ":${dir}" <<< $PATH; then
PATH="${dir}:${PATH}"
fi
done
if [ -f ~/.config/exercism/exercism_completion.zsh ]; then
source ~/.config/exercism/exercism_completion.zsh
fi
export PATH

View File

@@ -0,0 +1,3 @@
if test -d "$HOME/.cargo/bin"; then
export PATH="${PATH}:$HOME/.cargo/bin"
fi

View File

@@ -0,0 +1,6 @@
if which go 2>&1 > /dev/null; then
export GOPATH=~/development/go
export PATH=${PATH}:${GOPATH}/bin
fi
export SPOTIFY_CLIENT=a9138a6b1082438fa196221f9da72617
export SPOTIFY_SECRET=1c6ea12d0ba7455a9de42c693c77bc47

View File

@@ -0,0 +1,6 @@
#for dir in ~/.rbenv/bin ~/.rbenv/shims ~/.gem/ruby/*/bin(ocN); do
# if test -d "$dir"; then
# export PATH="${PATH}:${dir}"
# fi
#done
eval "$(rbenv init -)"

View File

@@ -0,0 +1,21 @@
if ls --color=auto >&/dev/null; then
alias ls='ls -F --color=auto'
else
alias ls='ls -F'
fi
alias ll='ls -lh'
alias cat='bat'
if grep --color=auto >&/dev/null; then
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
fi
if which nvim > /dev/null; then
alias vi='nvim'
fi
alias find='noglob find'
alias git='noglob git'
alias history='history -2000'
alias gssh='gcloud compute ssh --ssh-flag "-J shd-gcp-jump-001.bolcom.net"'

View File

@@ -0,0 +1,30 @@
OS_TYPE=$(uname -s)
if [ "$OS_TYPE" = "Darwin" ]; then
PWDID=6731738634759616518
BID=snarbutas@BOLCOM.NET
function ssh() {
if ! kswitch -p "$BID"; then
lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID"
elif klist -l | grep "*"|grep Expired; then
lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID"
fi
eval TERM=screen `/usr/bin/which ssh` $*
}
fi
decrypt () {
ssh -qtt shd-puppet-server-001.bolcom.net "sudo /opt/puppetlabs/bin/puppetserver ruby /var/lib/puppetserver/jruby-gems/gems/hiera-eyaml-2.1.0/bin/eyaml decrypt -s "${1}" 2>/dev/null"
}
checkModuleVersion () {
if [ ! -z $1 ]
then
for branch in dev tst acc xpr pro adm shd sbx use master
do
echo "== $branch =="
git checkout -q $branch
git pull -q
grep -A2 "'$1'" Puppetfile
done
else
echo "!! no module provided"
fi
}

View File

@@ -0,0 +1,12 @@
if [[ "$TERM" == screen-256color ]] || [[ -n "$TMUX" ]] || [[ "${TERM_PROGRAM}" == "vscode" ]]; then
return 1
fi
if tmux list-sessions && (tmux list-sessions | test -n "$0"); then
session_id=`date +%Y%m%d%H%M%S`
tmux new-session -d -t base -s $session_id
tmux select-window -t "$( tmux new-window -P -F \#{window_index} )"
tmux attach-session -t $session_id \; set-option destroy-unattached
else
tmux new-session -s base
fi

View File

@@ -0,0 +1,2 @@
export BAT_THEME="dark_neon"
#export BAT_THEME="Monokai Extended"

View File

@@ -0,0 +1,151 @@
### =============== Git prompt ================ ###
source ".zsh-git-prompt/zshrc.sh"
ZSH_THEME_GIT_PROMPT_BRANCH="%{\x1b[3m%}%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[green]%}%{¤%G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[blue]%}%{x%G%}"
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[red]%}%{+%G%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[red]%}%{↓%G%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%}%{↑%G%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="$fg[red]%}%{…%G%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}%{✔%G%}"
### =============== Git prompt ================ ###
## Enable completion
zstyle ':completion:*' completer _complete _ignored
zstyle ':completion:*' menu select
setopt completealiases
autoload -Uz compinit
compinit
## Enable ANSI colors
autoload -U color
## Set various options
setopt appendhistory nomatch notify
unsetopt autocd beep extendedglob
bindkey -e
## History
setopt HIST_IGNORE_DUPS
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
## Automatically fix terminal settings
ttyctl -f
## Set a nice prompt
PROMPT='%F{red}[%F{blue}%*%F{red}]%f %F{yellow}bosman%f %F{magenta}[%f%B%F{magenta}%1~%f%b%F{magenta}]%f %F{46}≫ %f$(git_super_status)%F{28}\$imon say$%f '
## Set a nice remote prompt
YELLOW="\[\033[38;5;3m\]"
BLUE="\[\033[38;5;4m\]"
ORANGE="\[\033[38;5;202m\]"
MAGENTA="\[\033[38;5;6m\]"
GREEN="\[\033[38;5;41m\]"
NOCOLOR="\[\033[0m\]"
BOL_FANCYPROMPT="${ORANGE}[${BLUE}\t${ORANGE}] ${YELLOW}\h ${MAGENTA}\W ${GREEN}≫${NOCOLOR} "
export BOL_FANCYPROMPT
## Enable colors
LESS='-R'
LESSOPEN='|~/.lessfilter %s'
## Setup editor and pager variables
PAGER="less"
EDITOR="vim"
VISUAL="${EDITOR}"
TERM="xterm-256color"
export PAGER EDITOR VISUAL TERM
## Setup the CDPATH with interesting directories
typeset -U path cdpath fpath
cdpath=(
.
~/vagrant
)
alias ls='ls --color=auto'
## Add pastebin support
function Paste { curl -s -d "content='$(cat ${1})'&expire=6h" -o/dev/null -w "%{redirect_url}\n" http://go-paste.service.local:8080/; }
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init () {
printf '%s' "${terminfo[smkx]}"
}
function zle-line-finish () {
printf '%s' "${terminfo[rmkx]}"
}
zle -N zle-line-init
zle -N zle-line-finish
fi
# ssh, scp, ping, host
zstyle ':completion:*:scp:*' tag-order \
'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
zstyle ':completion:*:scp:*' group-order \
users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' tag-order \
users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
zstyle ':completion:*:ssh:*' group-order \
hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns \
'*.*' loopback localhost
zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns \
'<->.<->.<->.<->' '^*.*' '*@*'
zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns \
'^<->.<->.<->.<->' '127.0.0.<->'
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns \
adm bin daemon halt lp named shutdown sync
zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=(
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
/dev/null)"}%%[# ]*}//,/ }
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
)'
bindkey "^[OA" history-beginning-search-backward
bindkey "^[OB" history-beginning-search-forward
for f in ~/.zsh.d/*.zsh; do
source "$f"
done
# The next line updates PATH for the Google Cloud SDK.
if [ -f /Users/snarbutas/google-cloud-sdk/path.zsh.inc ]; then
source '/Users/snarbutas/google-cloud-sdk/path.zsh.inc'
fi
# The next line enables shell command completion for gcloud.
#if [ -f /Users/snarbutas/google-cloud-sdk/completion.zsh.inc ]; then
# source '/Users/snarbutas/google-cloud-sdk/completion.zsh.inc'
#fi

View File

@@ -0,0 +1,153 @@
### =============== Git prompt ================ ###
source "/home/snarbutas/.zsh-git-prompt/zshrc.sh"
ZSH_THEME_GIT_PROMPT_BRANCH="%{\x1b[3m%}%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[green]%}%{¤%G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[blue]%}%{x%G%}"
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[red]%}%{+%G%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[red]%}%{↓%G%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%}%{↑%G%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}%{…%G%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}%{✔%G%}"
### =============== Git prompt ================ ###
## Enable completion
zstyle ':completion:*' completer _complete _ignored
zstyle ':completion:*' menu select
setopt completealiases
autoload -Uz compinit
compinit
## Enable ANSI colors
autoload -U color
## Set various options
setopt appendhistory nomatch notify
unsetopt autocd beep extendedglob
bindkey -e
## History
setopt HIST_IGNORE_DUPS
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
## Automatically fix terminal settings
ttyctl -f
stty -ixon -ixoff
## Set a nice prompt
PROMPT='%F{red}[%F{blue}%*%F{red}]%f %F{yellow}bosman%f %F{magenta}[%f%B%F{magenta}%1~%f%b%F{magenta}]%f %(!.%F{red}.%F{green})≫ %f$(git_super_status) '
#RPROMPT=$'%F{cyan}%*%f'
## Set a nice remote prompt
YELLOW="\[\033[38;5;3m\]"
BLUE="\[\033[38;5;4m\]"
ORANGE="\[\033[38;5;202m\]"
MAGENTA="\[\033[38;5;6m\]"
GREEN="\[\033[38;5;41m\]"
NOCOLOR="\[\033[0m\]"
BOL_FANCYPROMPT="${ORANGE}[${BLUE}\t${ORANGE}] ${YELLOW}\h ${MAGENTA}\W ${GREEN}≫${NOCOLOR} "
export BOL_FANCYPROMPT
## Enable colors
LESS='-R'
LESSOPEN='|~/.lessfilter %s'
## Setup editor and pager variables
PAGER="less"
EDITOR="nvim"
VISUAL="${EDITOR}"
#TERM="xterm-termite"
export PAGER EDITOR VISUAL
export INSTALL4J_JAVA_HOME="/usr/lib/jvm/java-8-openjdk/jre"
## Setup the CDPATH with interesting directories
typeset -U path cdpath fpath
cdpath=(
.
~/vagrant
)
alias ls='ls --color=auto'
## Add pastebin support
function Paste { curl -s -d "content='$(cat ${1})'&expire=6h" -o/dev/null -w "%{redirect_url}\n" http://go-paste.service.local:8080/; }
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init () {
printf '%s' "${terminfo[smkx]}"
}
function zle-line-finish () {
printf '%s' "${terminfo[rmkx]}"
}
zle -N zle-line-init
zle -N zle-line-finish
fi
# ssh, scp, ping, host
zstyle ':completion:*:scp:*' tag-order \
'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
zstyle ':completion:*:scp:*' group-order \
users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' tag-order \
users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
zstyle ':completion:*:ssh:*' group-order \
hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns \
'*.*' loopback localhost
zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns \
'<->.<->.<->.<->' '^*.*' '*@*'
zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns \
'^<->.<->.<->.<->' '127.0.0.<->'
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns \
adm bin daemon halt lp named shutdown sync
zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=(
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
/dev/null)"}%%[# ]*}//,/ }
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
)'
bindkey "^[OA" history-beginning-search-backward
bindkey "^[OB" history-beginning-search-forward
for f in ~/.zsh.d/*.zsh; do
source "$f"
done
if [[ $(pidof ssh-agent |wc -w) == 0 ]]; then
ssh-agent -s > ~/.ssh/agent
fi
eval "$(<~/.ssh/agent)"
# The next line updates PATH for the Google Cloud SDK.
if [ -f /opt/google-cloud-sdk/path.zsh.inc ]; then
source '/opt/google-cloud-sdk/path.zsh.inc'
fi

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,134 @@
### =============== Git prompt ================ ###
source "/home/snarbutas/.zsh-git-prompt/zshrc.sh"
ZSH_THEME_GIT_PROMPT_BRANCH="%{\x1b[3m%}%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[green]%}%{¤%G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[blue]%}%{x%G%}"
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[red]%}%{+%G%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg[red]%}%{↓%G%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[blue]%}%{↑%G%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}%{…%G%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}%{✔%G%}"
### =============== Git prompt ================ ###
## Enable completion
zstyle ':completion:*' completer _complete _ignored
zstyle ':completion:*' menu select
setopt completealiases
autoload -Uz compinit
compinit
## Enable ANSI colors
autoload -U color
## Set various options
setopt appendhistory nomatch notify
unsetopt autocd beep extendedglob
bindkey -e
## History
setopt HIST_IGNORE_DUPS
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
## Automatically fix terminal settings
ttyctl -f
stty -ixon -ixoff
## Set a nice prompt
PROMPT='%F{red}[%F{blue}%*%F{red}]%f %F{yellow}bosman%f %F{magenta}[%f%B%F{magenta}%1~%f%b%F{magenta}]%f %(!.%F{red}.%F{green})≫ %f$(git_super_status) '
#RPROMPT=$'%F{cyan}%*%f'
## Set a nice remote prompt
YELLOW="\[\033[38;5;3m\]"
BLUE="\[\033[38;5;4m\]"
ORANGE="\[\033[38;5;202m\]"
MAGENTA="\[\033[38;5;6m\]"
GREEN="\[\033[38;5;41m\]"
NOCOLOR="\[\033[0m\]"
BOL_FANCYPROMPT="${ORANGE}[${BLUE}\t${ORANGE}] ${YELLOW}\h ${MAGENTA}\W ${GREEN}${NOCOLOR} "
export BOL_FANCYPROMPT
## Enable colors
LESS='-R'
LESSOPEN='|~/.lessfilter %s'
## Setup editor and pager variables
PAGER="less"
EDITOR="nvim"
VISUAL="${EDITOR}"
#TERM="xterm-termite"
export PAGER EDITOR VISUAL
## Setup the CDPATH with interesting directories
typeset -U path cdpath fpath
cdpath=(
.
~/vagrant
)
eval "$(rbenv init -)"
alias ll='ls -ltrh'
alias cat='bat'
alias vi='nvim'
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
# ssh, scp, ping, host
zstyle ':completion:*:scp:*' tag-order \
'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
zstyle ':completion:*:scp:*' group-order \
users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' tag-order \
users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:IP\ address *'
zstyle ':completion:*:ssh:*' group-order \
hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:(ssh|scp):*:hosts-host' ignored-patterns \
'*.*' loopback localhost
zstyle ':completion:*:(ssh|scp):*:hosts-domain' ignored-patterns \
'<->.<->.<->.<->' '^*.*' '*@*'
zstyle ':completion:*:(ssh|scp):*:hosts-ipaddr' ignored-patterns \
'^<->.<->.<->.<->' '127.0.0.<->'
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns \
adm bin daemon halt lp named shutdown sync
zstyle -e ':completion:*:(ssh|scp):*' hosts 'reply=(
${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
/dev/null)"}%%[# ]*}//,/ }
${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
${=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
)'
bindkey "^[OA" history-beginning-search-backward
bindkey "^[OB" history-beginning-search-forward
# The next line updates PATH for the Google Cloud SDK.
if [ -f /opt/google-cloud-sdk/path.zsh.inc ]; then
source '/opt/google-cloud-sdk/path.zsh.inc'
fi
source ~/.zsh.d/11-go.zsh