Compare commits

..

1 Commits

Author SHA1 Message Date
ea61e071c5
Sign commits true
All checks were successful
dotfiles/pipeline/head This commit looks good
2021-08-31 15:50:51 +02:00
29 changed files with 69 additions and 1518 deletions

1
.gitignore vendored
View File

@ -3,4 +3,3 @@ id_rsa.pub
id_rsa-cert.pub id_rsa-cert.pub
known_hosts known_hosts
fish_variables fish_variables
roles/dotfiles/files/fish/fundle/

8
Jenkinsfile vendored
View File

@ -8,12 +8,4 @@ pipeline {
} }
} }
} }
post {
failure {
emailext body: 'Please check #$BUILD_NUMBER $PROJECT_NAME - $BUILD_STATUS! See $BUILD_URL', subject: 'Build #$BUILD_NUMBER $PROJECT_NAME - $BUILD_STATUS!', recipientProviders: [developers(), requestor()]
}
fixed {
emailext body: '$BUILD_STATUS, see $BUILD_URL', subject: 'Build #$BUILD_NUMBER $PROJECT_NAME - $BUILD_STATUS!', recipientProviders: [developers(), requestor()]
}
}
} }

View File

@ -1,4 +1,4 @@
Ansible must be installed. Ansible must be installed.
Invoke with Invoke with
`ansible-playbook -i hosts.yaml dotfiles.yml -K` `ansible-playbook -i hosts.ini dotfiles.yml -K`

View File

@ -1,10 +1,9 @@
--- ---
# - fix symlinks for folders
- hosts: all - hosts: all
name: Dotfiles
roles: roles:
- dotfiles - dotfiles
tasks: tasks:
- name: Debug - debug:
ansible.builtin.debug: msg:
msg: "System operating with {{ ansible_distribution }} {{ ansible_distribution_major_version }}"
"System operating with {{ ansible_distribution }} {{ ansible_distribution_major_version }}"

View File

@ -1,384 +0,0 @@
#!/usr/bin/env bash
#
# git-sync
#
# synchronize tracking repositories
#
# 2012-20 by Simon Thum and contributors
# Licensed as: CC0
#
# This script intends to sync via git near-automatically
# in "tracking" repositories where a nice history is not
# crucial, but having one at all is.
#
# Unlike the myriad of scripts to do just that already available,
# it follows the KISS principle: It is small, requires nothing but
# git and bash, but does not even try to shield you from git.
#
# Mode sync (default)
#
# Sync will likely get from you from a dull normal git repo with trivial
# changes to an updated dull normal git repo equal to origin. No more,
# no less. The intent is to do everything that's needed to sync
# automatically, and resort to manual intervention as soon
# as something non-trivial occurs. It is designed to be safe
# in that it will likely refuse to do anything not known to
# be safe.
#
# Mode check
#
# Check only performs the basic checks to make sure the repository
# is in an orderly state to continue syncing, i.e. committing
# changes, pull etc. without losing any data. When check returns
# 0, sync can start immediately. This does not, however, indicate
# that syncing is at all likely to succeed.
# command used to auto-commit file modifications
DEFAULT_AUTOCOMMIT_CMD="git add -u ; git commit -m \"%message\";"
# command used to auto-commit all changes
ALL_AUTOCOMMIT_CMD="git add -A ; git commit -m \"%message\";"
# default commit message substituted into autocommit commands
DEFAULT_AUTOCOMMIT_MSG="changes from $(uname -n) on $(date)"
# AUTOCOMMIT_CMD="echo \"Please commit or stash pending changes\"; exit 1;"
# TODO mode for stash push & pop
print_usage() {
cat << EOF
usage: $0 [-h] [-n] [-s] [MODE]
Synchronize the current branch to a remote backup
MODE may be either "sync" (the default) or "check", to verify that the branch is ready to sync
OPTIONS:
-h Show this message
-n Commit new files even if branch.\$branch_name.syncNewFiles isn't set
-s Sync the branch even if branch.\$branch_name.sync isn't set
EOF
}
sync_new_files_anyway="false"
sync_anyway="false"
while getopts "hns" opt ; do
case $opt in
h )
print_usage
exit 0
;;
n )
sync_new_files_anyway="true"
;;
s )
sync_anyway="true"
;;
esac
done
shift $((OPTIND-1))
#
# utility functions, some adapted from git bash completion
#
__log_msg()
{
echo git-sync: $1
}
# echo the git dir
__gitdir()
{
if [ "true" = "$(git rev-parse --is-inside-work-tree "$PWD" | head -1)" ]; then
git rev-parse --git-dir "$PWD" 2>/dev/null
fi
}
# echos repo state
git_repo_state ()
{
local g="$(__gitdir)"
if [ -n "$g" ]; then
if [ -f "$g/rebase-merge/interactive" ]; then
echo "REBASE-i"
elif [ -d "$g/rebase-merge" ]; then
echo "REBASE-m"
else
if [ -d "$g/rebase-apply" ]; then
echo "AM/REBASE"
elif [ -f "$g/MERGE_HEAD" ]; then
echo "MERGING"
elif [ -f "$g/CHERRY_PICK_HEAD" ]; then
echo "CHERRY-PICKING"
elif [ -f "$g/BISECT_LOG" ]; then
echo "BISECTING"
fi
fi
if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then
echo "|BARE"
else
echo "|GIT_DIR"
fi
elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
git diff --no-ext-diff --quiet --exit-code || echo "|DIRTY"
# if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ]; then
# git rev-parse --verify refs/stash >/dev/null 2>&1 && s="$"
# fi
#
# if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then
# if [ -n "$(git ls-files --others --exclude-standard)" ]; then
# u="%"
# fi
# fi
#
# if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
# __git_ps1_show_upstream
# fi
fi
else
echo "NOGIT"
fi
}
# check if we only have untouched, modified or (if configured) new files
check_initial_file_state()
{
local syncNew="$(git config --get --bool branch.$branch_name.syncNewFiles)"
if [[ "true" == "$syncNew" || "true" == "$sync_new_files_anyway" ]]; then
# allow for new files
if [ ! -z "$(git status --porcelain | grep -E '^[^ \?][^M\?] *')" ]; then
echo "NonNewOrModified"
fi
else
# also bail on new files
if [ ! -z "$(git status --porcelain | grep -E '^[^ ][^M] *')" ]; then
echo "NotOnlyModified"
fi
fi
}
# look for local changes
# used to decide if autocommit should be invoked
local_changes()
{
if [ ! -z "$(git status --porcelain | grep -E '^(\?\?|[MARC] |[ MARC][MD])*')" ]; then
echo "LocalChanges"
fi
}
# determine sync state of repository, i.e. how the remote relates to our HEAD
sync_state()
{
local count="$(git rev-list --count --left-right $remote_name/$branch_name...HEAD)"
case "$count" in
"") # no upstream
echo "noUpstream"
false
;;
"0 0")
echo "equal"
true
;;
"0 "*)
echo "ahead"
true
;;
*" 0")
echo "behind"
true
;;
*)
echo "diverged"
true
;;
esac
}
# exit, issue warning if not in sync
exit_assuming_sync() {
if [ "equal" == "$(sync_state)" ] ; then
__log_msg "In sync, all fine."
exit 0;
else
__log_msg "Synchronization FAILED! You should definitely check your repository carefully!"
__log_msg "(Possibly a transient network problem? Please try again in that case.)"
exit 3
fi
}
#
# Here git-sync actually starts
#
# first some sanity checks
rstate="$(git_repo_state)"
if [[ -z "$rstate" || "|DIRTY" = "$rstate" ]]; then
__log_msg "Preparing. Repo in $(__gitdir)"
elif [[ "NOGIT" = "$rstate" ]] ; then
__log_msg "No git repository detected. Exiting."
exit 128 # matches git's error code
else
__log_msg "Git repo state considered unsafe for sync: $(git_repo_state)"
exit 2
fi
# determine the current branch (thanks to stackoverflow)
branch_name=$(git symbolic-ref -q HEAD)
branch_name=${branch_name##refs/heads/}
if [ -z "$branch_name" ] ; then
__log_msg "Syncing is only possible on a branch."
git status
exit 2
fi
# while at it, determine the remote to operate on
remote_name=$(git config --get branch.$branch_name.pushRemote)
if [ -z "$remote_name" ] ; then
remote_name=$(git config --get remote.pushDefault)
fi
if [ -z "$remote_name" ] ; then
remote_name=$(git config --get branch.$branch_name.remote)
fi
if [ -z "$remote_name" ] ; then
__log_msg "the current branch does not have a configured remote."
echo
__log_msg "Please use"
echo
__log_msg " git branch --set-upstream-to=[remote_name]/$branch_name"
echo
__log_msg "replacing [remote_name] with the name of your remote, i.e. - origin"
__log_msg "to set the remote tracking branch for git-sync to work"
exit 2
fi
# check if current branch is configured for sync
if [[ "true" != "$(git config --get --bool branch.$branch_name.sync)" && "true" != "$sync_anyway" ]] ; then
echo
__log_msg "Please use"
echo
__log_msg " git config --bool branch.$branch_name.sync true"
echo
__log_msg "to enlist branch $branch_name for synchronization."
__log_msg "Branch $branch_name has to have a same-named remote branch"
__log_msg "for git-sync to work."
echo
__log_msg "(If you don't know what this means, you should change that"
__log_msg "before relying on this script. You have been warned.)"
echo
exit 1
fi
# determine mode
if [[ -z "$1" || "$1" == "sync" ]]; then
mode="sync"
elif [[ "check" == "$1" ]]; then
mode="check"
else
__log_msg "Mode $1 not recognized"
exit 100
fi
__log_msg "Mode $mode"
__log_msg "Using $remote_name/$branch_name"
# check for intentionally unhandled file states
if [ ! -z "$(check_initial_file_state)" ] ; then
__log_msg "There are changed files you should probably handle manually."
git status
exit 1
fi
# if in check mode, this is all we need to know
if [ $mode == "check" ] ; then
__log_msg "check OK; sync may start."
exit 0
fi
# check if we have to commit local changes, if yes, do so
if [ ! -z "$(local_changes)" ]; then
autocommit_cmd=""
config_autocommit_cmd="$(git config --get branch.$branch_name.autocommitscript)"
# discern the three ways to auto-commit
if [ ! -z "$config_autocommit_cmd" ]; then
autocommit_cmd="$config_autocommit_cmd"
elif [[ "true" == "$(git config --get --bool branch.$branch_name.syncNewFiles)" || "true" == "$sync_new_files_anyway" ]]; then
autocommit_cmd=${ALL_AUTOCOMMIT_CMD}
else
autocommit_cmd=${DEFAULT_AUTOCOMMIT_CMD}
fi
commit_msg="$(git config --get branch.$branch_name.syncCommitMsg)"
if [ "" == "$commit_msg" ]; then
commit_msg=${DEFAULT_AUTOCOMMIT_MSG}
fi
autocommit_cmd=$(echo "$autocommit_cmd" | sed "s/%message/$commit_msg/")
__log_msg "Committing local changes using ${autocommit_cmd}"
eval $autocommit_cmd
# after autocommit, we should be clean
rstate="$(git_repo_state)"
if [[ ! -z "$rstate" ]]; then
__log_msg "Auto-commit left uncommitted changes. Please add or remove them as desired and retry."
exit 1
fi
fi
# fetch remote to get to the current sync state
# TODO make fetching/pushing optional
__log_msg "Fetching from $remote_name/$branch_name"
git fetch $remote_name $branch_name
if [ $? != 0 ] ; then
__log_msg "git fetch $remote_name returned non-zero. Likely a network problem; exiting."
exit 3
fi
case "$(sync_state)" in
"noUpstream")
__log_msg "Strange state, you're on your own. Good luck."
exit 2
;;
"equal")
exit_assuming_sync
;;
"ahead")
__log_msg "Pushing changes..."
git push $remote_name $branch_name:$branch_name
if [ $? == 0 ]; then
exit_assuming_sync
else
__log_msg "git push returned non-zero. Likely a connection failure."
exit 3
fi
;;
"behind")
__log_msg "We are behind, fast-forwarding..."
git merge --ff --ff-only $remote_name/$branch_name
if [ $? == 0 ]; then
exit_assuming_sync
else
__log_msg "git merge --ff --ff-only returned non-zero ($?). Exiting."
exit 2
fi
;;
"diverged")
__log_msg "We have diverged. Trying to rebase..."
git rebase $remote_name/$branch_name
if [[ $? == 0 && -z "$(git_repo_state)" && "ahead" == "$(sync_state)" ]] ; then
__log_msg "Rebasing went fine, pushing..."
git push $remote_name $branch_name:$branch_name
exit_assuming_sync
else
__log_msg "Rebasing failed, likely there are conflicting changes. Resolve them and finish the rebase before repeating git-sync."
exit 1
fi
# TODO: save master, if rebasing fails, make a branch of old master
;;
esac

View File

@ -7,28 +7,4 @@ if status --is-login
end end
end end
fundle plugin 'edc/bass' eval (keychain --eval --agents ssh,gpg 82CD152AAAE9CAF77EACB29E73F092605AF3286C)
fundle plugin 'danhper/fish-ssh-agent'
fundle init
# run `fundle install` in the terminal
# bass to run utilities written in for bash in fish
if test -e /opt/ros/noetic/setup.bash
bass source /opt/ros/noetic/setup.bash
end
if test -e /home/rothe/catkin_ws/install/setup.bash
bass source /home/rothe/catkin_ws/install/setup.bash
end
if test -e /home/rothe/catkin_ws/install/setup.bash
bass source ~/.profile
end
fish_add_path ~/go/bin/
fish_add_path ~/bin/
# being able to use ssh in systemd user service
systemctl --user import-environment SSH_AUTH_SOCK
# set work specific stuff in there like GIT_AUTHOR_EMAIL and JIRA_API_TOKEN
bass source ~/.profile

View File

@ -1,4 +0,0 @@
# Defined in - @ line 1
function cam --wraps='gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0' --description 'alias cam=gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0'
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0 $argv;
end

View File

@ -1,4 +0,0 @@
# Defined in - @ line 1
function cdc --wraps='cd ~/catkin_ws/src/' --description 'alias cdc=cd ~/catkin_ws/src/'
cd ~/catkin_ws/src/ $argv;
end

View File

@ -1,4 +0,0 @@
# Defined in - @ line 1
function cds --wraps='cd ~/src/' --description 'alias cds=cd ~/src/'
cd ~/src/ $argv;
end

View File

@ -1,4 +0,0 @@
# Defined in - @ line 1
function did
echo "* $(date +"%F") $argv" >> ~/notes/did.md;
end

View File

@ -1,3 +0,0 @@
function didc --wraps='cat ~/notes/did.md | tail -n 10' --description 'alias didc=cat ~/notes/did.md | tail -n 10'
cat ~/notes/did.md | tail -n 10 $argv;
end

View File

@ -1,3 +0,0 @@
function dide --wraps='vim ~/notes/did.md' --wraps=vim\ \'+normal\ G\'\ \~/notes/did.md --description alias\ dide=vim\ \'+normal\ G\'\ \~/notes/did.md
vim '+normal G' ~/notes/did.md $argv;
end

View File

@ -1,453 +0,0 @@
set __fundle_current_version '0.7.0'
function __fundle_seq -a upto
seq 1 1 $upto 2>/dev/null
end
function __fundle_next_arg -a index
set -l args $argv[2..-1]
set -l arg_index (math $index + 1)
if test (count $args) -lt $arg_index
echo "missing argument for $args[$index]"
return 1
end
set -l arg $args[$arg_index]
switch $arg
case '--*'
echo "expected argument for $args[$index], got $arg"; and return 1
case '*'
echo $arg; and return 0
end
end
function __fundle_compare_versions -a version1 -a version2
for i in (__fundle_seq 4)
set -l v1 (echo $version1 | cut -d '.' -f $i | sed -Ee 's/[a-z]+//g')
set -l v2 (echo $version2 | cut -d '.' -f $i | sed -Ee 's/[a-z]+//g')
if test \( -n $v1 -a -z $v2 \) -o \( -n $v1 -a -n $v2 -a $v1 -lt $v2 \)
echo -n "lt"; and return 0
else if test \( -z $v1 -a -n $v2 \) -o \( -n $v1 -a -n $v2 -a $v1 -gt $v2 \)
echo -n "gt"; and return 0
end
end
echo -n "eq"; and return 0
end
function __fundle_date -d "returns a date"
set -l d (date +%s%N)
if echo $d | string match -rvq 'N'
echo $d
else
gdate +%s%N
end
return 0
end
function __fundle_self_update -d "updates fundle"
set -l fundle_repo_url "https://github.com/tuvistavie/fundle.git"
# This `sed` stays for now since doing it easily with `string` requires "--filter", which is only in 2.6.0
set -l latest (command git ls-remote --tags $fundle_repo_url | sed -n -e 's|.*refs/tags/v\(.*\)|\1|p' | tail -n 1)
if test (__fundle_compare_versions $latest (__fundle_version)) != "gt"
echo "fundle is already up to date"; and return 0
else
set -l file_url_template 'https://raw.githubusercontent.com/tuvistavie/fundle/VERSION/functions/fundle.fish'
set -l file_url (string replace 'VERSION' -- "v$latest" $file_url_template)
set -l tmp_file (mktemp /tmp/fundle.XXX)
set -l update_message "fundle has been updated to version $latest"
curl -Ls $file_url > $tmp_file; and mv $tmp_file (status -f); and echo $update_message; and return 0
end
end
function __fundle_url_rev -d "prints the revision from the url" -a git_url
set -l rev (echo $git_url | cut -d '#' -f 2 -s)
if test -n "$rev"
echo $rev
else
echo HEAD
end
end
function __fundle_remote_url -d "prints the remote url from the full git url" -a git_url
echo $git_url | cut -d '#' -f 1
end
function __fundle_rev_parse -d "prints the revision if any" -a dir -a commitish
set -l sha (command git --git-dir $dir rev-parse -q --verify $commitish 2>/dev/null)
if test $status -eq 0
echo -n $sha
return 0
end
return 1
end
function __fundle_commit_sha -d "returns sha of the commit-ish" -a dir -a commitish
if test -d "$dir/.git"
set dir "$dir/.git"
end
if __fundle_rev_parse $dir "origin/$commitish"
return 0
end
__fundle_rev_parse $dir $commitish
end
function __fundle_plugins_dir -d "returns fundle directory"
if test -z "$fundle_plugins_dir"
if test -n "$XDG_CONFIG_HOME"
echo $XDG_CONFIG_HOME/fish/fundle
else
echo $HOME/.config/fish/fundle
end
else
echo $fundle_plugins_dir
end
end
function __fundle_no_git -d "check if git is installed"
# `command -q` is >= 2.5.0
if not command -s git > /dev/null 2>&1
echo "git needs to be installed and in the path"
return 0
end
return 1
end
function __fundle_check_date -d "check date"
if date +%s%N | string match -rvq 'N'
return 0
end
if command -s gdate > /dev/null 2>&1
return 0
end
echo "You need to have a GNU date compliant date installed to use profiling. Use 'brew install coreutils' on OSX"
return 1
end
function __fundle_get_url -d "returns the url for the given plugin" -a repo
echo "https://github.com/$repo.git"
end
function __fundle_plugin_index -d "returns the index of the plugin" -a plugin
for i in (__fundle_seq (count $__fundle_plugin_names))
if test "$__fundle_plugin_names[$i]" = "$plugin"
return $i
end
end
# NOTE: should never reach this point
echo "could not find plugin: $plugin"
exit 1
end
function __fundle_checkout_revision -a plugin -a git_url
set -l plugin_dir (__fundle_plugins_dir)/$plugin
set -l git_dir $plugin_dir/.git
set -l sha (__fundle_commit_sha $git_dir (__fundle_url_rev $git_url))
if test $status -eq 0
command git --git-dir="$git_dir" --work-tree="$plugin_dir" checkout -q -f $sha
else
echo "Could not checkout $plugin revision $sha"
return 1
end
end
function __fundle_update_plugin -d "update the given plugin" -a plugin -a git_url
echo "Updating $plugin"
set -l remote_url (__fundle_remote_url $git_url)
set -l git_dir (__fundle_plugins_dir)/$plugin/.git
command git --git-dir=$git_dir remote set-url origin $remote_url 2>/dev/null
command git --git-dir=$git_dir fetch -q 2>/dev/null
__fundle_checkout_revision $plugin $git_url
end
function __fundle_install_plugin -d "install the given plugin" -a plugin -a git_url
if __fundle_no_git
return 1
end
set -l plugin_dir (__fundle_plugins_dir)/$plugin
set -l git_dir $plugin_dir/.git
set -l remote_url (__fundle_remote_url $git_url)
if test -d $plugin_dir
echo "$argv[1] installed in $plugin_dir"
return 0
else
echo "Installing $plugin"
command git clone -q $remote_url $plugin_dir
__fundle_checkout_revision $plugin $git_url
end
end
function __fundle_update -d "update the given plugin, or all if unspecified" -a plugin
if test -n "$plugin"; and test ! -d (__fundle_plugins_dir)/$plugin/.git
echo "$plugin not installed. You may need to run 'fundle install'"
return 1
end
if test -n "$plugin"
set -l index (__fundle_plugin_index $plugin)
__fundle_update_plugin "$plugin" $__fundle_plugin_urls[$index]
else
for i in (__fundle_seq (count $__fundle_plugin_names))
__fundle_update_plugin $__fundle_plugin_names[$i] $__fundle_plugin_urls[$i]
end
end
end
function __fundle_show_doc_msg -d "show a link to fundle docs"
if test (count $argv) -ge 1
echo $argv
end
echo "See the docs for more info. https://github.com/tuvistavie/fundle"
end
function __fundle_load_plugin -a plugin -a path -a fundle_dir -a profile -d "load a plugin"
if begin; set -q __fundle_loaded_plugins; and contains $plugin $__fundle_loaded_plugins; end
return 0
end
set -l plugin_dir (string replace -r '/.$' '' -- "$fundle_dir/$plugin/$path")
if not test -d $plugin_dir
__fundle_show_doc_msg "$plugin not installed. You may need to run 'fundle install'"
return 0
end
# Take everything but "plugin-" from the last path component
set -l plugin_name (string replace -r '.*/(plugin-)?(.*)$' '$2' -- $plugin)
set -l init_file "$plugin_dir/init.fish"
set -l conf_dir "$plugin_dir/conf.d"
set -l bindings_file "$plugin_dir/key_bindings.fish"
set -l functions_dir "$plugin_dir/functions"
set -l completions_dir "$plugin_dir/completions"
set -l plugin_paths $__fundle_plugin_name_paths
if begin; test -d $functions_dir; and not contains $functions_dir $fish_function_path; end
set fish_function_path $fish_function_path[1] $functions_dir $fish_function_path[2..-1]
end
if begin; test -d $completions_dir; and not contains $completions_dir $fish_complete_path; end
set fish_complete_path $fish_complete_path[1] $completions_dir $fish_complete_path[2..-1]
end
if test -f $init_file
source $init_file
else if test -d $conf_dir
# read all *.fish files in conf.d
for f in $conf_dir/*.fish
source $f
end
else
# For compatibility with oh-my-fish themes, if there is no `init.fish` file in the plugin,
# which is the case with themses, the root directory of the plugin is trerated as a functions
# folder, so we include it in the `fish_function_path` variable.
if not contains $plugin_dir $fish_function_path
set fish_function_path $fish_function_path[1] $plugin_dir $fish_function_path[2..-1]
end
end
if test -f $bindings_file
set -g __fundle_binding_paths $bindings_file $__fundle_binding_paths
end
set -g __fundle_loaded_plugins $plugin $__fundle_loaded_plugins
set -l dependencies (printf '%s\n' $plugin_paths $__fundle_plugin_name_paths | sort | uniq -u)
for dependency in $dependencies
set -l name_path (string split : -- $dependency)
if test "$profile" -eq 1
set -l start_time (__fundle_date +%s%N)
__fundle_load_plugin $name_path[1] $name_path[2] $fundle_dir $profile
set -l ellapsed_time (math \((__fundle_date +%s%N) - $start_time\) / 1000)
echo "$name_path[1]": {$ellapsed_time}us
else
__fundle_load_plugin $name_path[1] $name_path[2] $fundle_dir $profile
end
end
emit "init_$plugin_name" $plugin_dir
end
function __fundle_bind -d "set up bindings"
if functions -q fish_user_key_bindings; and not functions -q __fish_user_key_bindings
functions -c fish_user_key_bindings __fish_user_key_bindings
end
function fish_user_key_bindings
for bindings in $__fundle_binding_paths
source $bindings
end
if functions -q __fish_user_key_bindings
__fish_user_key_bindings
end
end
end
function __fundle_init -d "initialize fundle"
set -l fundle_dir (__fundle_plugins_dir)
if test (count $__fundle_plugin_names) -eq 0
__fundle_show_doc_msg "No plugin registered. You need to call 'fundle plugin NAME' before using 'fundle init'. \
Try reloading your shell if you just edited your configuration."
return 1
end
set -l profile 0
if begin; contains -- -p $argv; or contains -- --profile $argv; and __fundle_check_date; end
set profile 1
end
for name_path in $__fundle_plugin_name_paths
set -l name_path (string split : -- $name_path)
if test "$profile" -eq 1
set -l start_time (__fundle_date +%s%N)
__fundle_load_plugin $name_path[1] $name_path[2] $fundle_dir $profile
set -l ellapsed_time (math \((__fundle_date +%s%N) - $start_time\) / 1000)
echo "$name_path[1]": {$ellapsed_time}us
else
__fundle_load_plugin $name_path[1] $name_path[2] $fundle_dir $profile
end
end
__fundle_bind
end
function __fundle_install -d "install plugin"
if test (count $__fundle_plugin_names) -eq 0
__fundle_show_doc_msg "No plugin registered. You need to call 'fundle plugin NAME' before using 'fundle install'"
end
for i in (__fundle_seq (count $__fundle_plugin_names))
__fundle_install_plugin $__fundle_plugin_names[$i] $__fundle_plugin_urls[$i] $argv
end
set -l original_plugins_count (count (__fundle_list -s))
__fundle_init
# if plugins count increase after init, new plugins have dependencies
# install new plugins dependencies if any
if test (count (__fundle_list -s)) -gt $original_plugins_count
__fundle_install $argv
end
end
function __fundle_clean -d "cleans fundle directory"
set -l fundle_dir (__fundle_plugins_dir)
set -l used_plugins (__fundle_list -s)
set -l installed_plugins $fundle_dir/*/*/
for installed_plugin in $installed_plugins
set -l plugin (string trim --chars="/" \
(string replace -r -- "$fundle_dir" "" $installed_plugin))
if not contains $plugin $used_plugins
echo "Removing $plugin"
rm -rf $fundle_dir/$plugin
end
end
end
function __fundle_plugin -d "add plugin to fundle" -a name
set -l plugin_url ""
set -l plugin_path "."
set -l argv_count (count $argv)
set -l skip_next true
if test $argv_count -eq 0 -o -z "$argv"
echo "usage: fundle plugin NAME [[--url] URL] [--path PATH]"
return 1
else if test $argv_count -gt 1
for i in (__fundle_seq (count $argv))
test $skip_next = true; and set skip_next false; and continue
set -l arg $argv[$i]
switch $arg
case '--url'
set plugin_url (__fundle_next_arg $i $argv)
test $status -eq 1; and echo $plugin_url; and return 1
set skip_next true
case '--path'
set plugin_path (__fundle_next_arg $i $argv)
test $status -eq 1; and echo $plugin_path; and return 1
set skip_next true
case '--*'
echo "unknown flag $arg"; and return 1
case '*'
test $i -ne 2; and echo "invalid argument $arg"; and return 1
set plugin_url $arg
end
end
end
test -z "$plugin_url"; and set plugin_url (__fundle_get_url $name)
if not contains $name $__fundle_plugin_names
set -g __fundle_plugin_names $__fundle_plugin_names $name
set -g __fundle_plugin_urls $__fundle_plugin_urls $plugin_url
set -g __fundle_plugin_name_paths $__fundle_plugin_name_paths $name:$plugin_path
end
end
function __fundle_version -d "prints fundle version"
echo $__fundle_current_version
end
function __fundle_print_help -d "prints fundle help"
echo "usage: fundle (init | plugin | list | install | update | clean | self-update | version | help)"
end
function __fundle_list -d "list registered plugins"
if begin; contains -- -s $argv; or contains -- --short $argv; end
for name in $__fundle_plugin_names
echo $name
end
else
for i in (__fundle_seq (count $__fundle_plugin_names))
echo {$__fundle_plugin_names[$i]}\n\t{$__fundle_plugin_urls[$i]}
end
end
end
function fundle -d "run fundle"
if __fundle_no_git
return 1
end
set -l sub_args ""
switch (count $argv)
case 0
__fundle_print_help
return 1
case 1
case '*'
set sub_args $argv[2..-1]
end
switch $argv[1]
case "init"
__fundle_init $sub_args
case "plugin"
__fundle_plugin $sub_args
case "list"
__fundle_list $sub_args
case "plugins"
echo "'fundle plugins' has been replaced by 'fundle list'"
case "install"
__fundle_install $sub_args
case "update"
__fundle_update $sub_args
case "clean"
__fundle_clean
case "self-update"
__fundle_self_update
case "version" -v --version
__fundle_version
case "help" -h --help
__fundle_print_help
return 0
case "*"
__fundle_print_help
return 1
end
end

View File

@ -1,169 +0,0 @@
# -*- conf -*-
# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd)
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
# login-shell=no
# app-id=foot
# title=foot
# locked-title=no
font=Roboto Mono:size=10
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# line-height=<font metrics>
# letter-spacing=0
# horizontal-letter-offset=0
# vertical-letter-offset=0
# underline-offset=<font metrics>
# box-drawings-uses-font-glyphs=no
dpi-aware=no
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed
# pad=2x2 # optionally append 'center'
# resize-delay-ms=100
# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body}
# bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
# selection-target=primary
# workers=<number of logical CPUs>
[environment]
# name=value
[bell]
# urgent=no
# notify=no
# command=
# command-focused=no
[scrollback]
# lines=1000
# multiplier=3.0
# indicator-position=relative
# indicator-format=
[url]
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]
[cursor]
# style=block
# color=<inverse foreground/background>
# blink=no
# beam-thickness=1.5
# underline-thickness=<font underline thickness>
[mouse]
# hide-when-typing=no
# alternate-scroll-mode=yes
[colors]
foreground=dbdee9
background=0e1420
regular0=5b6272
regular1=bf616a
regular2=a3be8c
regular3=ebcb8b
regular4=81a1c1
regular5=b48ead
regular6=88c0d0
regular7=e5e9f0
bright0=4c566a
bright1=bf616a
bright2=a3be8c
bright3=ebcb8b
bright4=81a1c1
bright5=b48ead
bright6=8fbcbb
bright7=eceff4
[csd]
# preferred=server
# size=26
# font=<primary font>
# color=<foreground color>
# hide-when-typing=no
# border-width=0
# border-color=<csd.color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>
[key-bindings]
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# clipboard-copy=Control+Shift+c XF86Copy
# clipboard-paste=Control+Shift+v XF86Paste
# primary-paste=Shift+Insert
# search-start=Control+Shift+r
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
# fullscreen=none
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# show-urls-launch=Control+Shift+u
# show-urls-copy=none
# show-urls-persistent=none
# prompt-prev=Control+Shift+z
# prompt-next=Control+Shift+x
# unicode-input=none
# noop=none
[search-bindings]
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Mod1+BackSpace Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-to-word-boundary=Control+w
# extend-to-next-whitespace=Control+Shift+w
# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste
# primary-paste=Shift+Insert
# unicode-input=none
[url-bindings]
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t
[text-bindings]
# \x03=Mod4+c # Map Super+c -> Ctrl+c
[mouse-bindings]
# selection-override-modifiers=Shift
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-row=BTN_LEFT-3
# vim: ft=dosini

View File

@ -8,8 +8,5 @@
st = status st = status
co = checkout co = checkout
br = branch br = branch
[filter "lfs"] [commit]
smudge = git-lfs smudge -- %f gpgsign = true
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f

View File

@ -1,17 +1,15 @@
set $mod Mod4 set $mod Mod4
font pango:Roboto Medium 8 font pango:Roboto Medium 8
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen. # screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux, # NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it. # and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet exec --no-startup-id nm-applet
exec --no-startup-id "setxkbmap de"
# Use pactl to adjust volume in PulseAudio. # Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status set $refresh_i3status killall -SIGUSR1 i3status
@ -30,7 +28,7 @@ new_window 1pixel
bindsym $mod+Return exec gnome-terminal bindsym $mod+Return exec gnome-terminal
# set background # set background
exec --no-startup-id "hsetroot -center ~/pictures/wallpaper/voxel-city-by-huntingfluff.jpg" exec --no-startup-id "hsetroot -center ~/pictures/wallpaper/malle.png"
# lock # lock
bindsym Mod1+l exec i3lock-fancy bindsym Mod1+l exec i3lock-fancy
@ -39,7 +37,7 @@ bindsym Mod1+l exec i3lock-fancy
bindsym Mod1+s exec i3lock-fancy && systemctl suspend bindsym Mod1+s exec i3lock-fancy && systemctl suspend
# screenshot # screenshot
bindsym --release Print exec "flameshot gui -p '/home/rothe/pictures/shots/'" bindsym --release Print exec "scrot -s '%Y-%m-%d-%H-%M-%S.png' -e 'mv $f ~/pictures/shots/'"
# kill focused window # kill focused window
bindsym $mod+Shift+q kill bindsym $mod+Shift+q kill

View File

@ -10,7 +10,6 @@ order += "disk /"
order += "load" order += "load"
order += "memory" order += "memory"
order += "tztime local" order += "tztime local"
order += "time"
wireless _first_ { wireless _first_ {
format_up = "%essid %quality %ip" format_up = "%essid %quality %ip"
@ -24,9 +23,6 @@ ethernet _first_ {
battery all { battery all {
format = "battery %status %percentage %remaining" format = "battery %status %percentage %remaining"
last_full_capacity = true
integer_battery_capacity = true
low_threshold = 15
} }
load { load {
@ -41,9 +37,5 @@ memory {
} }
tztime local { tztime local {
format = "%a, %d.%m.%Y CW %V" format = "%a, %d.%m.%Y %H:%M"
}
time {
format = "%H:%M"
} }

View File

@ -1,13 +0,0 @@
profile {
output eDP-1 disable
output HDMI-A-2 enable
}
profile {
output eDP-1 enable
}
profile {
output eDP-1 disable
output DP-1 enable
}

View File

@ -1,4 +1 @@
configuration { rofi.theme: /usr/share/rofi/themes/Arc-Dark.rasi
font: "Roboto Mono 10";
}
@theme "/usr/share/rofi/themes/Arc-Dark.rasi"

View File

@ -1,2 +1,13 @@
AddKeysToAgent yes AddKeysToAgent yes
SendEnv GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME Host base
HostName skaq5lpru2kvl6hu.myfritz.net
Port 2222
User johannes
Host ovh
HostName 51.89.23.55
Port 2222
User rothe
Host strato
HostName ssh.strato.de
Port 22
User 510616466.swh.strato-hosting.eu

View File

@ -1,238 +0,0 @@
# swayidle -> configure idle timers
# kanshi -> automatic display selection
# grimshot -> screnshots
# foot -> terminal
# swaylock -> lock screen
# dmenu
# i3status
# mako-notifier -> notifications
# gammastep -> redshift
# wl-clipboard -> copy stuff
# wdisplays -> interactive display configuration
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term foot
set $menu dmenu_path | dmenu | xargs swaymsg exec --
set $wallpaper ~/pictures/wallpaper/voxel-city-by-huntingfluff.jpg
# screenshot
bindsym --release Print exec grimshot copy area
bindsym --release Shift+Print exec grimshot --notify save active
# lock
bindsym Mod1+l exec swaylock -f -i $wallpaper -s fill
# titlebars
default_border pixel
default_floating_border pixel
hide_edge_borders smart
titlebar_padding 5 1
# notifications
exec_always "pkill mako; mako --ignore-timeout=1 --default-timeout=5000"
# redshift
exec gammastep -l50.81:6.37
# Fix for slow application startup and full screen share
# https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start
# https://github.com/emersion/xdg-desktop-portal-wlr#running
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway
# dynamic monitor configuration, see ~/.config/kanshi/config, get outputs with swaymsg -t get_outputs
exec_always "pkill kanshi; kanshi"
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg $wallpaper fill
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
exec swayidle -w \
timeout 1800 'swaylock -f -c 000000' \
timeout 3600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f -c 000000'
exec ~/bin/nextcloud
exec ~/bin/logseq
for_window [title="Logseq"] move scratchpad, resize set 1280 800
bindsym $mod+m scratchpad show
#exec chromium --name="todoist" --app="https://todoist.com/app/filter/2267226798" --new-window
#for_window [app_id="todoist"] move scratchpad, resize set 1280 800
#bindsym $mod+t [app_id="todoist"] scratchpad show
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
input * {
xkb_layout "de"
}
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+q kill
# Start your launcher
bindsym $mod+d exec $menu
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#
# Workspaces:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position bottom
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
#status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
status_command i3status
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}

View File

@ -38,5 +38,3 @@ set-window-option -g window-status-bell-style fg=colour232,bg=colour253
# Correct colors # Correct colors
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc" set -ga terminal-overrides ",*256col*:Tc"
set -g history-limit 150000

View File

@ -1,53 +1,19 @@
set number set number
set colorcolumn=88 set colorcolumn=80
set background=dark set background=dark
set cursorline set cursorline
set shell=/bin/sh
syntax on syntax on
au BufNewFile,BufRead *.go set tabstop=4 softtabstop=4 shiftwidth=4 " python
\ expandtab autoindent fileformat=unix au BufNewFile,BufRead *.py,*.go set tabstop=4 softtabstop=4 shiftwidth=4
au BufNewFile,BufRead *.js set tabstop=4 softtabstop=4 shiftwidth=4 \ textwidth=79 expandtab autoindent fileformat=unix
\ expandtab autoindent fileformat=unix au BufNewFile,BufRead *.yaml set tabstop=2 softtabstop=2 shiftwidth=2
au BufNewFile,BufRead *.toml set tabstop=4 softtabstop=4 shiftwidth=4 \ textwidth=79 expandtab autoindent fileformat=unix
\ expandtab autoindent fileformat=unix au BufNewFile,BufRead *.html,*.css set tabstop=2 softtabstop=2 shiftwidth=2
au BufNewFile,BufRead *.json set tabstop=2 softtabstop=2 shiftwidth=2
\ expandtab autoindent fileformat=unix
au BufNewFile,BufRead *.yaml set tabstop=2 softtabstop=2 shiftwidth=2
\ expandtab autoindent fileformat=unix
au BufNewFile,BufRead *.html,*.css set tabstop=2 softtabstop=2 shiftwidth=2
\ expandtab autoindent colorcolumn=0 \ expandtab autoindent colorcolumn=0
au BufNewFile,BufRead *.launch set filetype=xml au BufNewFile,BufRead *.launch set filetype=xml
autocmd FileType debcontrol :set colorcolumn=80 textwidth=80
augroup py " vim-plug
autocmd FileType python :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
autocmd FileType python nnoremap <F9> :Black<CR> :Isort <CR>
augroup end
augroup terraform
autocmd FileType terraform :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
autocmd FileType terraform nnoremap <F9> :! terraform fmt<CR>
augroup end
augroup go
autocmd FileType go :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
au FileType go nmap <F9> <Plug>(go-fmt)<Plug>(go-lint)
au FileType go nmap <F7> <Plug>(go-build)
au FileType go nmap <F8> <Plug>(go-run)
au FileType go nmap gd <Plug>(go-def)
augroup end
augroup sh
autocmd FileType sh :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
augroup end
autocmd FileType dockerfile :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
autocmd FileType bzl :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
autocmd FileType nginx :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
autocmd FileType gitcommit :set spell
autocmd FileType markdown :set spell
" vim-plug automatic install for the first time
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" :PlugInstall to install new one " :PlugInstall to install new one
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
Plug 'dense-analysis/ale' Plug 'dense-analysis/ale'
@ -59,20 +25,13 @@ Plug 'vim-airline/vim-airline'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
Plug 'luochen1990/rainbow' Plug 'luochen1990/rainbow'
Plug 'psf/black', {'branch': 'main'} Plug 'psf/black'
Plug 'fisadev/vim-isort'
Plug 'jvirtanen/vim-hcl' " HCL files used by terraform
Plug 'hashivim/vim-terraform'
Plug 'Yggdroot/indentLine'
" show git diff in sign column " show git diff in sign column
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
" Themes " Themes
Plug 'sainnhe/sonokai' Plug 'sainnhe/sonokai'
" Language specific " Language specific
Plug 'vim-python/python-syntax' Plug 'vim-python/python-syntax'
Plug 'wgwoods/vim-systemd-syntax'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'cespare/vim-toml',{ 'branch': 'main' }
call plug#end() call plug#end()
" Theme " Theme
@ -81,38 +40,34 @@ if has('termguicolors')
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors set termguicolors
endif endif
let g:sonokai_style = 'atlantis' "let g:sonokai_style = 'shusia'
let g:sonokai_enable_italic = 1
let g:sonokai_disable_italic_comment = 1 let g:sonokai_disable_italic_comment = 1
colorscheme sonokai colorscheme sonokai
let g:airline_theme = 'sonokai' let g:airline_theme = 'sonokai'
" Ale " Ale
let g:ale_linters = {'python': ['flake8', 'mypy'],} let g:ale_linters = {'python': ['flake8', 'pylint'],}
let g:ale_fixers = {'python': ['black', 'isort']} let g:ale_fixers = {}
let g:ale_python_pylint_options = '--disable=C0111' let g:ale_fixers.python = ['black']
let g:ale_python_mypy_options = '--ignore-missing-imports --disallow-untyped-defs --disallow-incomplete-defs'
let g:ale_python_flake8_options = '--max-line-length=88 --ignore=E501,W503'
" Black " Black
let g:black_linelength = 88 let g:black_linelength = 80
" ycm " ycm
let g:ycm_autoclose_preview_window_after_insertion = 1 let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_autoclose_preview_window_after_completion = 1 let g:ycm_autoclose_preview_window_after_completion = 1
" isort
let g:vim_isort_python_version = 'python3'
let g:vim_isort_config_overrides = {'profile': 'black'}
" NERDTREE " NERDTREE
" open nerdtree when no file is specified on startup " open nerdtree when no file is specified on startup
autocmd StdinReadPre * let s:std_in=1 autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" toggle nerdtree keyboard shortcut " toggle nerdtree keyboard shortcut
map <C-t> :NERDTreeToggle<CR> map <C-t> :NERDTreeToggle<CR>
nnoremap <F9> :Black<CR>
" RAINBOW_PARENTHESES " RAINBOW_PARENTHESES
"au FileType c,cpp,py call rainbow#load() au FileType c,cpp,py call rainbow#load()
" python syntax " python syntax
let g:python_highlight_all = 1 let g:python_highlight_all = 1
@ -120,19 +75,3 @@ let g:python_highlight_func_calls = 0
" enable rainbow brackets " enable rainbow brackets
let g:rainbow_active = 1 let g:rainbow_active = 1
" vim-go
let g:go_def_mapping_enabled = 0
" terraform
let g:terraform_fmt_on_save = 1
let g:terraform_align = 1
"underline spell errors in terminals
hi SpellBad ctermfg=218 cterm=underline
" workaround for https://github.com/vim/vim/issues/11766
let &t_BE = ""
let &t_BD = "\e[?2004l"
exec "set t_PS=\e[200~"
exec "set t_PE=\e[201~"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 KiB

View File

@ -1,10 +0,0 @@
extends: relaxed
rules:
line-length: disable
braces:
level: warning
max-spaces-inside: 1
brackets:
level: warning
max-spaces-inside: 1

View File

@ -1,73 +1,51 @@
--- ---
# Install base packages # Install base packages
- name: Install necessary packages - name: Install necessary packages
become: true become: yes
become_method: sudo become_method: su
become_user: root become_user: root
ansible.builtin.apt: apt:
name: name:
- ack - ack
- arandr
- bat
- black # code formatting - black # code formatting
- bsdmainutils # ncal calendar
- dmenu
- feh # set background - feh # set background
- fish - fish
- flameshot
- flake8
- fonts-roboto
- foot
- fzf - fzf
- gammastep
- grimshot
- htop - htop
- hsetroot - hsetroot
- ispell - ispell
- i3 - i3
- i3lock-fancy - i3lock-fancy
- i3status
- kanshi
- keychain - keychain
- mako-notifier - ncal
- mypy
- pass - pass
- python3-pylint-common - python3-pylint-common
- pulseaudio-utils # pactl volume control - pulseaudio-utils # pactl volume control
- ripgrep
- rofi # dmenu replacement - rofi # dmenu replacement
- scrot # screenshot - scrot # screenshot
- shellcheck
- sway
- swayidle
- swaylock
- tmux - tmux
- vim - vim
- vim-nox
- wdisplays
- wl-clipboard
- yamllint
state: present state: present
cache_valid_time: 3600 cache_valid_time: 3600
- name: Remove old backup - name: Remove old backup
ansible.builtin.file: file:
path: '{{ home }}/tmp/dotfiles_backup' path: '{{ home }}/tmp/dotfiles_backup'
state: absent state: absent
- name: Create new backup dir - name: Create new backup dir
ansible.builtin.file: file:
path: '{{ home }}/tmp/dotfiles_backup' path: '{{ home }}/tmp/dotfiles_backup'
state: directory state: directory
mode: 0755 mode: 0700
- name: Backup stuff - name: Backup stuff
ansible.builtin.copy: copy:
src: '{{ item }}' src: '{{ item }}'
dest: '/tmp/dotfiles_backup' dest: '{{ home }}/tmp/dotfiles_backup'
remote_src: true # copy the folder from the host instead of ansible remote_src: True # copy the folder from the host instead of ansible
mode: 0755 mode: 0600
ignore_errors: true ignore_errors: yes
loop: loop:
# dirs (without trailing '/' copies the whole dir) # dirs (without trailing '/' copies the whole dir)
- '{{ home }}/.config/fish' - '{{ home }}/.config/fish'
@ -77,40 +55,29 @@
- '{{ home }}/.ssh/config' - '{{ home }}/.ssh/config'
- '{{ home }}/.config/i3/config' - '{{ home }}/.config/i3/config'
- '{{ home }}/.config/i3status/config' - '{{ home }}/.config/i3status/config'
- '{{ home }}/.config/rofi/config.rasi' - '{{ home }}/.config/rofi/config'
- '{{ home }}/.config/kanshi/config'
- '{{ home }}/.config/foot/foot.ini'
- '{{ home }}/.config/yamllint/config'
- '{{ home }}/.gitconfig' - '{{ home }}/.gitconfig'
- '{{ home }}/.gnupg/gpg-agent.conf' - '{{ home }}/.gnupg/gpg-agent.conf'
- '{{ home }}/.sway/config'
- name: Make sure folders exist - name: Make sure folders exist
ansible.builtin.file: file:
path: '{{ item }}' path: '{{ item }}'
state: directory state: directory
mode: 0755 mode: 0700
loop: loop:
- '{{ home }}/.config/i3/' - '{{ home }}/.config/i3/'
- '{{ home }}/.config/i3status/' - '{{ home }}/.config/i3status/'
- '{{ home }}/.config/rofi/' - '{{ home }}/.config/rofi/'
- '{{ home }}/.config/tmux/'
- '{{ home }}/.config/kanshi/'
- '{{ home }}/.config/foot/'
- '{{ home }}/.ssh/' - '{{ home }}/.ssh/'
- '{{ home }}/pictures/shots/' - '{{ home }}/pictures/shots/'
- '{{ home }}/.gnupg/' - '{{ home }}/.gnupg/'
- '{{ home }}/.sway/'
- '{{ home }}/.config/yamllint/'
- '{{ home }}/bin/'
- '{{ home }}/.local/share/systemd/user'
- name: Link files - name: Link files
ansible.builtin.file: file:
src: '{{ item.src }}' src: '{{ item.src }}'
dest: '{{ item.dest }}' dest: '{{ item.dest }}'
state: link state: link
force: true force: True
loop: loop:
- src: '{{ files_dir }}/vimrc' - src: '{{ files_dir }}/vimrc'
dest: '{{ home }}/.vimrc' dest: '{{ home }}/.vimrc'
@ -119,9 +86,9 @@
- src: '{{ files_dir }}/i3status_config' - src: '{{ files_dir }}/i3status_config'
dest: '{{ home }}/.config/i3status/config' dest: '{{ home }}/.config/i3status/config'
- src: '{{ files_dir }}/rofi_config' - src: '{{ files_dir }}/rofi_config'
dest: '{{ home }}/.config/rofi/config.rasi' dest: '{{ home }}/.config/rofi/config'
- src: '{{ files_dir }}/tmux.conf' - src: '{{ files_dir }}/tmux.conf'
dest: '{{ home }}/.config/tmux/tmux.conf' dest: '{{ home }}/.tmux.conf'
- src: '{{ files_dir }}/ssh_config' - src: '{{ files_dir }}/ssh_config'
dest: '{{ home }}/.ssh/config' dest: '{{ home }}/.ssh/config'
- src: '{{ files_dir }}/fish' - src: '{{ files_dir }}/fish'
@ -132,13 +99,3 @@
dest: '{{ home }}/.gitconfig' dest: '{{ home }}/.gitconfig'
- src: '{{ files_dir }}/gpg-agent.conf' - src: '{{ files_dir }}/gpg-agent.conf'
dest: '{{ home }}/.gnupg/gpg-agent.conf' dest: '{{ home }}/.gnupg/gpg-agent.conf'
- src: '{{ files_dir }}/sway_config'
dest: '{{ home }}/.sway/config'
- src: '{{ files_dir }}/kanshi_config'
dest: '{{ home }}/.config/kanshi/config'
- src: '{{ files_dir }}/foot.ini'
dest: '{{ home }}/.config/foot/foot.ini'
- src: '{{ files_dir }}/bin/git-sync'
dest: '{{ home }}/bin/git-sync'
- src: '{{ files_dir }}/yamllint_config'
dest: '{{ home }}/.config/yamllint/config'

View File

@ -1,7 +0,0 @@
[Unit]
Description=Sync notes with git-sync
[Service]
Type=oneshot
WorkingDirectory={{ home }}/notes/
ExecStart={{ home }}/bin/git-sync -ns

View File

@ -1,8 +0,0 @@
[Unit]
Description=Note sync timer
[Timer]
OnCalendar=hourly
[Install]
WantedBy=timers.target