Initial commit

This commit is contained in:
Pavle Portic 2019-06-08 01:46:49 +02:00
commit 822a4b46e9
Signed by: TheEdgeOfRage
GPG Key ID: 6758ACE46AA2A849
34 changed files with 13516 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

31
dot_Xresources Normal file
View File

@ -0,0 +1,31 @@
! -- Color settings
*foreground: #ebdbb2
*background: #282828
!black
*color0: #1d2021
*color8: #665c54
!red
*color1: #cc241d
*color9: #fb4934
!green
*color2: #98971a
*color10: #b8bb26
!yellow
*color3: #d79921
*color11: #fabd2f
!blue
*color4: #388588
*color12: #72a591
!magenta
*color5: #b16286
*color13: #d3869b
!cyan
*color6: #689d6a
*color14: #8ec07c
!white
*color7: #dbae93
*color15: #fbf1c7
Xcursor.theme: Human

3
dot_config/flake8 Normal file
View File

@ -0,0 +1,3 @@
[flake8]
max-line-length = 256
ignore = E202,W191,W391,E117

249
dot_config/i3/config Normal file
View File

@ -0,0 +1,249 @@
# vim: syntax=i3config ft=i3config ts=4 sts=4 sw=4 noet
#
# i3 config file
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $foreground #ebdbb2
set $background #282828
set $color0 #1d2021
set $color1 #cc241d
set $color2 #98971a
set $color3 #d79921
set $color4 #458588
set $color5 #b16286
set $color6 #689d6a
set $color7 #a89984
set $color8 #665c54
set $color9 #fb4934
set $color10 #b8bb26
set $color11 #fabd2f
set $color12 #83a598
set $color13 #d3869b
set $color14 #8ec07c
set $color15 #fbf1c7
set $color16 #d65d0e
set $color17 #fe8019
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Pragmata Pro, FontAwesome 11
#class background border text split
client.focused $color8 $color8 $foreground $color7
client.focused_inactive $background $background $color7 $color0
client.unfocused $color0 $background $color8 $color0
client.urgent $color1 $color1 $foreground $color1
client.background $background
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec roxterm
# kill focused window
bindsym $mod+Shift+q kill
# start rofi (a program launcher)
bindsym $mod+space exec "rofi -show drun"
bindsym $mod+BackSpace exec "rofi -show drun"
# change focus
bindsym $mod+h focus left
bindsym $mod+n focus down
bindsym $mod+e focus up
bindsym $mod+i focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+n move down
bindsym $mod+Shift+e move up
bindsym $mod+Shift+i move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+c split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (tabbed, toggle split)
bindsym $mod+s layout toggle split
bindsym $mod+t layout tabbed
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
bindsym $mod+Shift+BackSpace floating toggle
bindsym $mod+g focus mode_toggle
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev
# 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
bindsym $mod+p workspace 
bindsym $mod+w workspace 
bindsym $mod+m workspace 
# 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
bindsym $mod+Shift+p move container to workspace 
bindsym $mod+Shift+w move container to workspace 
bindsym $mod+Shift+m move container to workspace 
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Control+l exec "i3lock -e -i ~/pictures/wallpapers/jahorina.png -t"
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym n resize shrink height 10 px or 10 ppt
bindsym e resize grow height 10 px or 10 ppt
bindsym i resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize shrink height 10 px or 10 ppt
bindsym Up resize grow height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +2% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -2% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec light -A 10 # increase screen brightness
bindsym XF86MonBrightnessDown exec light -U 10 # decrease screen brightness
bindsym Shift+XF86MonBrightnessUp exec light -A 5 # increase screen brightness
bindsym Shift+XF86MonBrightnessDown exec light -U 5 # decrease screen brightness
# Cmus controls
bindsym XF86AudioPlay exec "cmus-remote -u"
bindsym XF86AudioNext exec "cmus-remote -n"
bindsym XF86AudioPrev exec "cmus-remote -r"
# Take screenshot
bindsym Print exec myazo
assign [class="(?i)firefox"] 
assign [class="(?i)chromium"] 
assign [class="Telegram"] 
assign [class="(?i)riot"] 
assign [class="Thunderbird"] 
for_window [class="Lxappearance"] floating enable
new_window pixel 2
hide_edge_borders smart
exec_always python ~/.config/i3/i3-autoname-workspaces.py &
exec telegram-desktop >/dev/null 2>/dev/null &
exec riot-desktop >/dev/null 2>/dev/null &
exec roxterm -e cmus >/dev/null 2>/dev/null &
exec env GTK_THEME=Arc-Solid gtk-launch firefox >/dev/null 2>/dev/null &
exec gtk-launch thunderbird >/dev/null 2>/dev/null &
set $mode_power (1) shutdown, (2) reboot, (3) exit i3, (4) reload i3
mode "$mode_power" {
bindsym 1 exec --no-startup-id "shutdown now", mode "default"
bindsym 2 exec --no-startup-id "reboot", mode "default"
bindsym 3 exec --no-startup-id "i3-msg exit", mode "default"
bindsym 4 exec --no-startup-id "~/sbin/i3-reload", mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Shift+x mode "$mode_power"
set $mode_kb_select (1) US, (2) Colemak, (3) Latin, (4) Cyrillic, (5) DE
mode "$mode_kb_select" {
bindsym 1 exec --no-startup-id "setxkbmap -layout us", mode "default"
bindsym 2 exec --no-startup-id "setxkbmap -layout custom -variant colemak -option ctrl:swapcaps", mode "default"
bindsym 3 exec --no-startup-id "setxkbmap -layout rs -variant latin", mode "default"
bindsym 4 exec --no-startup-id "setxkbmap -layout rs", mode "default"
bindsym 5 exec --no-startup-id "setxkbmap -layout de", mode "default"
bindsym Escape mode "default"
}
bindsym $mod+F12 mode "$mode_kb_select"
bar {
position top
tray_output none
status_command ~/.local/share/bumblebee-status/bumblebee-status -m \
cmus \
sensors \
layout \
pasource \
pasink \
date \
time \
-p engine.workspacewheel=False \
date.format="%a, %Y-%m-%d" \
time.format="%H:%M:%S" \
-t gruvbox-powerline
wheel_up_cmd nop
wheel_down_cmd nop
colors {
background $color0
focused_workspace $color8 $color8 $foreground
active_workspace $color8 $color8 $foreground
inactive_workspace $color8 $color0 $foreground
urgent_workspace $color9 $color1 $foreground
}
}
bar {
position bottom
status_command ~/.local/share/bumblebee-status/bumblebee-status -m \
traffic \
nic \
cpu \
memory \
-p engine.workspacewheel=False \
traffic.hide_down=True \
traffic.exclude="lo,virbr,docker,vboxnet,veth,br" \
nic.exclude="lo,virbr,docker,vboxnet,veth,br" \
-t gruvbox-powerline
wheel_up_cmd nop
wheel_down_cmd nop
colors {
background $color0
focused_workspace $color8 $color8 $foreground
active_workspace $color8 $color8 $foreground
inactive_workspace $color8 $color0 $foreground
urgent_workspace $color9 $color1 $foreground
}
}

View File

@ -0,0 +1,198 @@
#!/usr/bin/env python3
# This script listens for i3 events and updates workspace names to show icons
# for running programs. It contains icons for a few programs, but more can
# easily be added by inserting them into WINDOW_ICONS below.
#
# Dependencies
# * xorg-xprop - install through system package manager
# * i3ipc - install with pip
# * fontawesome - install with pip
#
# Installation:
# * Download this script and place it in ~/.config/i3/ (or anywhere you want)
# * Add "exec_always ~/.config/i3/i3-autoname-workspaces.py &" to your i3 config
# * Restart i3: "$ i3-msg restart"
#
# Configuration:
# The default i3 config's keybingings reference workspaces by name, which is an
# issue when using this script because the "names" are constantaly changing to
# show window icons. Instead, you'll need to change the keybindings to
# reference workspaces by number. Change lines like:
# bindsym $mod+1 workspace 1
# To:
# bindsym $mod+1 workspace number 1
import re
import signal
import subprocess as proc
import sys
import fontawesome as fa
import i3ipc
# Add icons here for common programs you use. The keys are the X window class
# (WM_CLASS) names (lower-cased) and the icons can be any text you want to
# display.
#
# Most of these are character codes for font awesome:
# http://fortawesome.github.io/Font-Awesome/icons/
#
# If you're not sure what the WM_CLASS is for your application, you can use
# xprop (https://linux.die.net/man/1/xprop). Run `xprop | grep WM_CLASS`
# then click on the application you want to inspect.
WINDOW_ICONS = {
'blender': fa.icons['cube'],
'blueman-manager': fa.icons['bluetooth'],
'chromium': fa.icons['chrome'],
'cities.x64': fa.icons['city'],
'code': fa.icons['code'],
'darktable': fa.icons['camera'],
'dwarf_fortress': fa.icons['fort-awesome'],
'eclipse': fa.icons['code'],
'emacs': fa.icons['code'],
'evince': fa.icons['file-pdf'],
'factorio': fa.icons['cog'],
'feh': fa.icons['image'],
'firefox': fa.icons['firefox'],
'firefox-developer': fa.icons['firefox'],
'ghb': fa.icons['video'],
'gimp': fa.icons['file-image'],
'google-chrome': fa.icons['chrome'],
'gparted': fa.icons['hdd'],
'gpicview': fa.icons['image'],
'gsmartcontrol': fa.icons['hdd'],
'inkscape': fa.icons['pen-nib'],
'jetbrains-studio': fa.icons['code'],
'kicad': fa.icons['microchip'],
'roxterm': fa.icons['terminal'],
'ksp.x86_64': fa.icons['space-shuttle'],
'libreoffice-impress': fa.icons['file-powerpoint'],
'libreoffice-writer': fa.icons['file-alt'],
'lutris': fa.icons['gamepad'],
'minecraft 1.12.2': fa.icons['cube'],
'mirage': fa.icons['image'],
'mpv': fa.icons['video'],
'multimc': fa.icons['cube'],
'mupdf': fa.icons['file-pdf'],
'nm-connection-editor': fa.icons['wifi'],
'org-openstreetmap-josm-gui-mainapplication': fa.icons['map'],
'pavucontrol': fa.icons['volume-up'],
'qbittorrent': fa.icons['download'],
'qtcreator': fa.icons['code'],
'riot': fa.icons['comments'],
'seahorse': fa.icons['lock'],
'spotify': fa.icons['spotify'],
'sqlitebrowser': fa.icons['database'],
'steam': fa.icons['steam'],
'subl': fa.icons['file-alt'],
'subl3': fa.icons['file-alt'],
'surviving mars': fa.icons['rocket'],
'telegram-desktop': fa.icons['telegram'],
'terraria.bin.x86_64': fa.icons['tree'],
'thunderbird': fa.icons['envelope'],
'vim': fa.icons['code'],
'virt-manager': fa.icons['desktop'],
'virtualbox manager': fa.icons['desktop'],
'vivifyscrum': fa.icons['check'],
'vlc': fa.icons['video'],
'wire': fa.icons['comments'],
'wireshark': fa.icons['network-wired'],
'zathura': fa.icons['file-pdf'],
'zenity': fa.icons['window-maximize'],
}
# This icon is used for any application not in the list above
DEFAULT_ICON = '*'
# Used so that we can keep the workspace's name when we add icons to it.
# Returns a dictionary with the following keys: 'num', 'shortname', and 'icons'
# Any field that's missing in @name will be None in the returned dict
def parse_workspace_name(name):
match = re.match(r'(?P<num>\d+):?(?P<shortname>\w+)? ?(?P<icons>.+)?', name)
return match.groupdict()
# Given a dictionary with 'num', 'shortname', 'icons', return the formatted name
# by concatenating them together.
def construct_workspace_name(parts):
new_name = str(parts['num'])
if parts['shortname'] or parts['icons']:
new_name += ':'
if parts['shortname']:
new_name += parts['shortname']
if parts['icons']:
new_name += ' ' + parts['icons']
return new_name
# Returns an array of the values for the given property from xprop. This
# requires xorg-xprop to be installed.
def xprop(win_id, property):
try:
prop = proc.check_output(['xprop', '-id', str(win_id), property], stderr=proc.DEVNULL)
prop = prop.decode('utf-8')
print(re.findall('"([^"]+)"', prop))
return re.findall('"([^"]+)"', prop)
except proc.CalledProcessError:
print("Unable to get property for window '%d'" % win_id)
return None
def icon_for_window(window):
classes = xprop(window.window, 'WM_CLASS')
if classes is not None and len(classes) > 0:
for cls in classes:
cls = cls.lower() # case-insensitive matching
if cls in WINDOW_ICONS:
return WINDOW_ICONS[cls]
print('No icon available for: %s' % str(classes))
return DEFAULT_ICON
# renames all workspaces based on the windows present
def rename_workspaces(i3):
for workspace in i3.get_tree().workspaces():
if '' not in workspace.name and '' not in workspace.name and '' not in workspace.name:
name_parts = parse_workspace_name(workspace.name)
name_parts['icons'] = ' '.join([icon_for_window(w) for w in workspace.leaves()])
new_name = construct_workspace_name(name_parts)
i3.command('rename workspace "%s" to "%s"' % (workspace.name, new_name))
# rename workspaces to just numbers and shortnames.
# called on exit to indicate that this script is no longer running.
def undo_window_renaming(i3):
for workspace in i3.get_tree().workspaces():
name_parts = parse_workspace_name(workspace.name)
name_parts['icons'] = None
new_name = construct_workspace_name(name_parts)
i3.command('rename workspace "%s" to "%s"' % (workspace.name, new_name))
i3.main_quit()
sys.exit(0)
if __name__ == '__main__':
i3 = i3ipc.Connection()
# exit gracefully when ctrl+c is pressed
for sig in [signal.SIGINT, signal.SIGTERM]:
signal.signal(sig, lambda signal, frame: undo_window_renaming(i3))
# call rename_workspaces() for relevant window events
def window_event_handler(i3, e):
if e.change in ['new', 'close', 'move']:
rename_workspaces(i3)
i3.on('window', window_event_handler)
rename_workspaces(i3)
i3.main()

View File

@ -0,0 +1,15 @@
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/documents/"
XDG_DOWNLOAD_DIR="$HOME/downloads/"
XDG_MUSIC_DIR="$HOME/music/"
XDG_PICTURES_DIR="$HOME/pictures/"
XDG_VIDEOS_DIR="$HOME/videos/"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"

23
dot_config/rofi/config Normal file
View File

@ -0,0 +1,23 @@
! vim: set ft=xdefaults:
! General settings
rofi.levenshtein-sort: false
rofi.matching: fuzzy
rofi.modi: drun,ssh
! Styling
rofi.color-window: #1d2021,#665c54
rofi.color-normal: #1d2021,#665c54,#1d2021,#665c54,#1d2021
rofi.bc: #1d2021
rofi.location: 0
rofi.lines: 10
rofi.bw: 0
rofi.hide-scrollbar: true
rofi.font: Pragmata Pro 13
rofi.separator-style: none
rofi.show-icons: false
! Running
rofi.terminal: terminator
rofi.ssh-command: {terminal} -x "{ssh-client} {host}"
rofi.run-command: {cmd}
rofi.run-shell-command: {terminal} -c "{cmd}"

View File

@ -0,0 +1,20 @@
[roxterm colour scheme]
foreground=#ebebdbdbb2b2
background=#282828282828
palette_size=16
0=#282828282828
1=#cccc24241d1d
2=#989897971a1a
3=#d7d799992121
4=#383885858888
5=#b1b162628686
6=#68689d9d6a6a
7=#dbdbaeae9393
8=#66665c5c5454
9=#fbfb49493434
10=#b8b8bbbb2626
11=#fafabdbd2f2f
12=#7272a5a59191
13=#d3d386869b9b
14=#8e8ec0c07c7c
15=#ebebdbdbb2b2

View File

@ -0,0 +1,4 @@
[roxterm options]
prefer_dark_theme=0
warn_close=1
only_warn_running=1

View File

@ -0,0 +1,13 @@
[roxterm profile]
font=Pragmata Pro 11
always_show_tabs=0
colour_scheme=Default
bell_highlights_tab=0
audible_bell=0
autowrap=1
cursor_blink_mode=2
scrollbar_pos=0
limit_scrollback=0
vspacing=8
hide_menubar=1
scroll_on_keystroke=1

31
dot_config/twmn/twmn.conf Normal file
View File

@ -0,0 +1,31 @@
[gui]
absolute_position=
always_on_top=true
background_color=#3c3836
bounce=false
bounce_duration=500
font=Ubuntu
font_size=26
font_variant=regular
foreground_color=#fbf1c7
height=80
in_animation=38
in_animation_duration=150
opacity=100
out_animation=13
out_animation_duration=150
position=top_right
screen=0
[icons]
info_icon=
warning_icon=
critical_icon=
[main]
activate_command=
duration=5000
enable_shortcuts=true
host=127.0.0.1
port=9797
sound_command=

2057
dot_config/zsh/antigen.zsh Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
# Function to generate random string from /dev/urandom
< /dev/urandom tr -dc 'A-Za-z0-9%+,-./:=@^_' | head -c $1

View File

@ -0,0 +1,10 @@
# Function to add files and folders to the .gitignore file
if (( $# < 1 )); then
echo "Need at least one argument"
fi
for var in "$@"; do
echo "$var" >> .gitignore
done

View File

@ -0,0 +1,16 @@
# vim: ft=zsh
# Wrapper function for pbincli for easier output parsing
LOGFILE="$HOME/.local/share/pbincli/pbincli.log"
DATADIR="$HOME/.local/share/pbincli"
mkdir -p $DATADIR
echo "-------------------------------------------" >> $LOGFILE
date --iso-8601=seconds >> $LOGFILE
OUTPUT=$(pbincli send $@)
echo $OUTPUT >> $LOGFILE
echo "" >> $LOGFILE
echo $OUTPUT | tail -n1 | cut -d $'\t' -f 3

View File

@ -0,0 +1,4 @@
# Function to Calculate the sha256sum of a string
echo -n "$@" | sha256sum | base64 | head -n1 | tr -d '\n'

View File

@ -0,0 +1,2 @@
autoload -Uz *

File diff suppressed because it is too large Load Diff

15
dot_gitconfig Normal file
View File

@ -0,0 +1,15 @@
[user]
name = Pavle Portic
email = pavle.portic@tilda.center
signingkey = 6758ACE46AA2A849
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
[diff]
tool = vimdiff
[difftool]
prompt = false
[commit]
gpgsign = true
[pull]
rebase = true

View File

@ -0,0 +1,4 @@
#!/bin/zsh
ffmpeg -n -i "$1" -acodec libmp3lame -ab 320k -map_metadata 0 -id3v2_version 3 "$2" &> /dev/null

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# resize-test.sh
# Copyright (C) 2018 pavle <pavle.portic@tilda.center>
#
# Distributed under terms of the MIT license.
#
echo "Resizing "$1
RES=$(identify -format '%G\n' $1)
XRES=$(echo $RES | cut -d "x" -f1)
YRES=$(echo $RES | cut -d "x" -f2)
if (( XRES > YRES )); then
convert $1 -resize x$2 $1
else
convert $1 -resize $2x $1
fi

View File

@ -0,0 +1,22 @@
#!/bin/zsh
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi

View File

@ -0,0 +1,43 @@
#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 232-255 are a grayscale ramp, intentionally leaving out
# display the colors
# first the system ones:
print "ANSI colors:\n";
for ($color = 0; $color < 8; $color++) {
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m\n";
for ($color = 8; $color < 16; $color++) {
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m\n\n";
# now the color cube
print "Color cube, 6x6x6:\n";
for ($green = 0; $green < 6; $green++) {
for ($red = 0; $red < 6; $red++) {
for ($blue = 0; $blue < 6; $blue++) {
$color = 16 + ($red * 36) + ($green * 6) + $blue;
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m ";
}
print "\n";
}
# now the grayscale ramp
print "Grayscale ramp:\n";
for ($color = 232; $color < 256; $color++) {
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m\n";

View File

@ -0,0 +1,17 @@
#!/bin/bash
# Print True color test strip
awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{
s=" ";
for (colnum = 0; colnum<term_cols; colnum++) {
r = 255-(colnum*255/term_cols);
g = (colnum*510/term_cols);
b = (colnum*255/term_cols);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
printf "%s\033[0m", substr(s,colnum%2+1,1);
}
printf "\n";
}'

View File

@ -0,0 +1 @@
/home/pavle/dev/webdev/myazo/client/myazo.py

View File

@ -0,0 +1 @@
/home/pavle/dev/webdev/myazo/client/myazo-image.py

View File

@ -0,0 +1 @@
/home/pavle/dev/python/rpncalc/rpncalc.py

View File

@ -0,0 +1,8 @@
/*
* %FFILE%
* Copyright (C) %YEAR% %USER% <%MAIL%>
*
* Distributed under terms of the %LICENSE% license.
*/
%HERE%

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>%CLASS%</title>
</head>
<body>
%HERE%
</body>
</html>

View File

@ -0,0 +1,9 @@
/*
* %FFILE%
* Copyright (C) %YEAR% %USER% <%MAIL%>
*
* Distributed under terms of the %LICENSE% license.
*/
%HERE%

View File

@ -0,0 +1,11 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © %YEAR% %USER% <%MAIL%>
#
# Distributed under terms of the %LICENSE% license.
%HERE%

325
dot_spacevim Normal file
View File

@ -0,0 +1,325 @@
" vim: set ft=vim: syntax=vim
" Use exclude option if you don't want the full Layer,
" e.g., Layer 'better-defaults', { 'exclude': 'itchyny/vim-cursorword' }
function! Layers()
Layer 'better-defaults', { 'exclude': [
\ 'kshenoy/vim-signature',
\ 'google/vim-searchindex',
\ 'mhinz/vim-startify',
\ ] }
Layer 'unite'
Layer 'airline'
Layer 'programming', { 'exclude': [
\ 'luochen1990/rainbow',
\ ] }
Layer 'editing'
Layer 'fzf'
Layer 'git'
Layer 'syntax-checking'
Layer 'deoplete', {'exclude': [
\ 'eagletmt/neco-ghc',
\ 'sebastianmarkow/deoplete-rust',
\ 'zchee/deoplete-go',
\ ]}
Layer 'c-c++'
Layer 'docker'
Layer 'html'
Layer 'javascript'
Layer 'markdown'
Layer 'python', {'exclude': [
\ 'python-mode/python-mode',
\ ]}
endfunction
function! UserInit()
Plug 'morhetz/gruvbox'
Plug 'chr4/nginx.vim'
Plug 'Firef0x/PKGBUILD.vim'
Plug 'alvan/vim-closetag'
Plug 'lepture/vim-jinja'
Plug 'aperezdc/vim-template'
Plug 'elzr/vim-json'
Plug 'andymass/vim-matchup'
Plug 'zchee/deoplete-jedi', { 'for': 'python' }
Plug 'davidhalter/jedi-vim', { 'for': 'python' }
Plug 'idbrii/vim-remarkjs'
Plug 'idbrii/vim-gogo'
Plug 'edkolev/tmuxline.vim'
Plug 'tpope/vim-repeat'
Plug 'diepm/vim-rest-console'
Plug 'RRethy/vim-hexokinase'
Plug 'mbbill/undotree'
endfunction
" Override the existing configurations and add extras here.
function! UserConfig()
set termguicolors
color gruvbox
set encoding=utf8
set shell=/bin/bash
set autochdir
set laststatus=2
"set timeoutlen=300
"set backspace=2
set showcmd
set wrap
set linebreak
set number
set relativenumber
set cursorline
set cursorcolumn
set tabstop=4
set shiftwidth=4
set softtabstop=4
set textwidth=0
set noexpandtab
set autoindent
set background=dark
set list
set listchars=tab:│\ ,trail:~,extends:>,precedes:<
set splitright
set splitbelow
set foldmethod=indent
" Persistent undo
set undofile
set undodir=~/.local/share/nvim/undodir
" Set default LICENSE
let g:license = 'BSD-3-Clause'
let g:email = 'pavle.portic@tilda.center'
" Set python path
let g:python_host_prog = '/usr/bin/python'
" Backspace and Enter as G and gg
nnoremap <CR> G
nnoremap <BS> gg
vnoremap <CR> G
vnoremap <BS> gg
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colemak-Vim Mappings
"
" The idea is to use HNEI as arrows keeping the traditional Vim homerow style and changing as
" little else as possible. This means JKL are free to use and NEI need new keys.
" - k/K is the new n/N ["next/prev search"]
" - l/L is the new i/I ["insert"].
" - m/M is the new e/E ["jump" to EOW].
" - j/J is the new m/M ["marks"]
" - H/I skip to the beginning and end of lines. Much more intuitive than ^/$.
" - l replaces i as the "inner" modifier [e.g. "dlw" becomes "dlw"].
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" HNEI arrows.
noremap <silent> n j
noremap <silent> e k
noremap <silent> i l
" Merge lines
noremap <silent> N J
" Last search.
noremap k n
noremap K N
" mark
noremap j m
noremap J M
" l/L insert
noremap l i
noremap L I
" EOW.
noremap m e
noremap M E
" End of line
noremap I $
noremap H ^
noremap <C-N> <C-E>
noremap <C-E> <C-P>
" Disable default space action
noremap <Space> <NOP>
" Autoindent code
nmap <F7> jzgg=G`z
" Buffer actions
nnoremap <silent> <Tab> :bn<CR>
nnoremap <silent> <S-Tab> :bp<CR>
nnoremap <silent> <leader>bd :bp \| bd #<cr>
" Unhighlight search results with \
noremap <silent> \ :let @/ = ""<CR>
if !exists('g:vim_better_default_window_key_mapping') ||
\ g:vim_better_default_window_key_mapping
nnoremap <Leader>wn <C-W>j
nnoremap <Leader>we <C-W>k
nnoremap <Leader>wh <C-W>h
nnoremap <Leader>wi <C-W>l
nnoremap <Leader>wH <C-W>5<
nnoremap <Leader>wI <C-W>5>
nnoremap <Leader>wN :resize +5<CR>
nnoremap <Leader>wE :resize -5<CR>
endif
" Easymotion colemak bindings
map <Leader>nn <Plug>(easymotion-bd-f)
nmap <Leader>nn <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
nmap <Leader>nN <Plug>(easymotion-overwin-f2)
" Jump to line
map <Leader>ne <Plug>(easymotion-bd-jk)
nmap <Leader>ne <Plug>(easymotion-overwin-line)
" Jump to word
map <Leader>nw <Plug>(easymotion-bd-w)
nmap <Leader>nw <Plug>(easymotion-overwin-w)
" FZF mappings
noremap <C-P> :GFiles<CR>
noremap <leader>ff :Files<CR>
noremap <C-G> :Lines<CR>
noremap <C-Q> :Buffers<CR>
noremap <C-T> :Tags<CR>
noremap <leader>? :Maps<CR>
" Nerdcommenter maps
nmap <Leader>/ <Plug>NERDCommenterToggle
vmap <Leader>/ <Plug>NERDCommenterToggle
" Fugitive maps
nnoremap <silent> <Leader>gd :Gvdiff<CR>
" Undotree maps
nnoremap <F3> :UndotreeToggle<cr>
""""""""""""""""""""""
" Plugin configuration
""""""""""""""""""""""
" Airline settings
let g:airline_powerline_fonts = 1
let g:airline_theme='gruvbox'
" Tmuxline settings
let g:airline#extensions#tmuxline#enabled = 0
" Emmet settings
let g:user_emmet_mode='nv'
let g:user_emmet_leader_key='<Leader>e'
" Closetag config
let g:closetag_filenames = '*.html,*.xhtml,*.hbs,*.vue'
" Per filetype indentation settings
let g:jsx_ext_required = 1
augroup filetypeDefinitions
autocmd Filetype i3 setl noet ts=2 sts=2 sw=2
autocmd Filetype html,jinja.html,blade setl noet ts=2 sts=2 sw=2
autocmd Filetype javascript,js,vue,json,jsx setl noet ts=4 sts=4 sw=4
autocmd Filetype python setl noet ts=4 sw=4 sts=4 tw=0
autocmd Filetype c,cpp setl noet ts=4 sts=4 sw=4
autocmd Filetype rst setl autoindent& cindent& smartindent& indentexpr& noet ts=3 sts=3 sw=3
autocmd Filetype tex setl et ts=4 sts=4 sw=4
augroup END
augroup filetypedetect
autocmd BufNew,BufNewFile,BufRead *.network,*.netdev :setfiletype systemd
augroup END
" Don't insert title into new files
autocmd! spacevimNewFile BufNewFile *.py,*.cpp,*.c,*.sh,*.java,*.pl
" Format json file
command! FormatJSON %!python -m json.tool
" Format braces in C file
command! FormatBraces %s/\n\s*{/ {/g
command! W :execute ':silent w !sudo tee % > /dev/null' | :edit!
autocmd! spacevimStart
" Strip trailing whitespaces on save
" autocmd Filetype * autocmd BufWritePre <buffer> :StripWhitespace
" Remove trailing spaces
fun! <SID>StripTrailingWhitespaces()
let l = line('.')
let c = col('.')
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd FileType * autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
" Py-mode settings
" let g:pymode_virtualenv = 1
" let g:pymode_virtualenv_enabled = 1
" let g:pymode_doc_bind = 'E'
" nnoremap E <NOP>
" Jedi completion settings
let g:jedi#completions_enabled = 0
let g:jedi#documentation_command = 'E'
" Vue syntax highlight speedup
let g:vue_disable_pre_processors=1
" Ale settings
let g:airline#extensions#ale#enabled = 1
let g:ale_linters = {
\ 'c': ['gcc'],
\ 'cpp': ['gcc'],
\ 'vue': ['eslint'],
\ 'javascript': ['eslint'],
\ }
let g:ale_lint_on_insert_leave = 1
let g:ale_fix_on_save = 0
" fzf config
let g:fzf_colors = {
\ 'fg': ['fg', 'GruvboxGray'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'GruvboxRed'],
\ 'fg+': ['fg', 'GruvboxGreen'],
\ 'bg+': ['bg', 'GruvboxBg1'],
\ 'hl+': ['fg', 'GruvboxRed'],
\ 'info': ['fg', 'GruvboxOrange'],
\ 'prompt': ['fg', 'GruvboxBlue'],
\ 'header': ['fg', 'GruvboxBlue'],
\ 'pointer': ['fg', 'Error'],
\ 'marker': ['fg', 'Error'],
\ 'spinner': ['fg', 'Statement'],
\ }
" Configure vim-template directory
let g:templates_directory = ['~/.local/share/nvim/templates']
" Vim rest console settings
let g:vrc_curl_opts = {
\ '-s' : '',
\ '-i' : '',
\ }
" NERDCommenter configuration
let g:NERDCustomDelimiters = { 'vue': { 'left': '//' }, 'systemd': { 'left': '#' } }
" Polyglot configuration
let g:polyglot_disabled = ['systemd']
" Hexokinase configuration
let g:Hexokinase_ftAutoload = ['css', 'scss', 'sass', 'stylus']
endfunction

26
dot_xinitrc Normal file
View File

@ -0,0 +1,26 @@
#!/bin/bash
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
source /etc/X11/xinit/xinitrc.d/50-systemd-user.sh
xset fp rehash
xset dpms 3600 3600 3600
xset s 3600 3600
xhost +localhost
xhost +natrium
xcape -e 'Control_L=Escape'
xbindkeys
feh --bg-fill /home/pavle/pictures/wallpapers/arboreal_serenity.jpg
exec i3

148
dot_zshrc Normal file
View File

@ -0,0 +1,148 @@
# vim: ft=zsh
# History settings
HISTFILE=~/.config/zsh/histfile
HISTSIZE=10000
SAVEHIST=10000
setopt HIST_IGNORE_DUPS
# Misc options
setopt autocd extendedglob notify
# setopt SOURCE_TRACE
unsetopt beep nomatch
bindkey -v
source ~/.config/zsh/antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Load plugins from oh-my-zsh
antigen bundle archlinux
antigen bundle aws
antigen bundle colored-man-pages
antigen bundle colorize
antigen bundle common-aliases
antigen bundle copybuffer
antigen bundle docker
antigen bundle docker-compose
antigen bundle extract
antigen bundle git
# Additional antigen plugins
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle MichaelAquilina/zsh-you-should-use
antigen bundle zsh-users/zsh-completions
# Load theme
antigen theme https://gitlab.theedgeofrage.com/TheEdgeOfRage/boban-zsh.git
antigen apply
# Completion options
zstyle :compinstall filename '$HOME/.zshrc'
zstyle ':completion:*' menu select
fpath=(~/.config/zsh/completions ~/.config/zsh/functions $fpath)
autoload -Uz compinit && compinit
autoload -Uz ~/.config/zsh/functions/*
# Aliases
alias '...'='../..'
alias '....'='../../..'
alias '.....'='../../../..'
alias '......'='../../../../..'
alias '.......'='../../../../../..'
alias '........'='../../../../../../..'
alias ls='ls --group-directories-first --color=always --time-style=long-iso'
alias cl=clear
alias cdl='cd ~/ && cl'
alias rmr='rm -rIf'
alias mkdir='mkdir -p'
alias df='df -h'
alias ran=ranger
alias -g WC='| wc -l'
alias rcp='rsync -rPv'
alias cal='cal -m'
alias grep='grep -Hn --color=always'
alias -g NO='>/dev/null 2>&1'
alias -g clip='xclip -selection c'
alias db='sudo duplicity-backup -c /etc/duplicity/duplicity-backup.conf'
alias wakerouter='wol 18:a9:05:39:c4:4d'
alias myip='curl icanhazip.com'
alias -g vim='nvim'
alias manage='python manage.py'
alias zpool='sudo zpool'
alias 'zpool import'='zpool import -d /dev/disk/by-id'
alias zfs='sudo zfs'
alias fdisk='sudo fdisk'
alias cfn='cfn-lint'
alias diff='diff -y --suppress-common-lines'
alias -g HASH='| sha256sum | base64 H -n1 | clip'
alias cz=chezmoi
# Systemctl aliases
alias sctl='sudo systemctl'
alias sstatus='sudo systemctl status'
alias sstart='sudo systemctl start'
alias srestart='sudo systemctl restart'
alias sreload='sudo systemctl reload'
alias sstop='sudo systemctl stop'
alias senable='sudo systemctl enable'
alias sdisable='sudo systemctl disable'
alias hib='sudo systemctl suspend'
alias suctl='systemctl --user'
alias sustatus='systemctl --user status'
alias sustart='systemctl --user start'
alias surestart='systemctl --user restart'
alias sureload='systemctl --user reload'
alias sustop='systemctl --user stop'
alias suenable='systemctl --user enable'
alias sudisable='systemctl --user disable'
# Oh my zsh alias override
alias gcom='gco master'
alias yar='yay'
alias -g du='du -sh'
alias -g duf='du -sh * | sort -h'
alias -g dufa='du -sh * .* | sort -h'
alias la='ls -a'
alias ll='ls -lah'
unalias -m 'fd'
unalias -m 'ff'
unalias -m '_'
unalias -m 'please'
unalias -m 'rm'
# Variable exports
export VISUAL="nvim"
export EDITOR="nvim"
export BROWSER='firefox'
export XDG_CONFIG_HOME="$HOME/.config"
export MAKEFLAGS="-j $(nproc --all)"
export GPG_TTY=$(tty)
export ANDROID_HOME="$HOME/.android/sdk"
export PATH="$HOME/.local/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$HOME/.yarn/bin:$PATH"
export QT_QPA_PLATFORMTHEME="qt5ct"
export LC_ALL="en_DK.UTF-8"
# Bind home and end
bindkey "\033[H" beginning-of-line
bindkey "\033[F" end-of-line
# zle -N zle-line-init
TRAPWINCH() {
zle && { zle reset-prompt; zle -R }
}
# Load fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='rg --files --hidden --follow -g "!{.git,node_modules,__pycache__}/*" 2> /dev/null'
export FZF_DEFAULT_OPTS='
--color fg:#928374,bg:#282828,hl:#fb4934
--color fg+:#b8bb26,bg+:#3c3836,hl+:#fb4934
--color info:#fe8019,prompt:#83a598,header:#83a598
--color pointer:#fb4934,marker:#fb4934,spinner:#ffff60
'
source ~/.local/bin/start-ssh-agent