Skip to content

Instantly share code, notes, and snippets.

@mfurquimdev
Created April 10, 2020 23:47
Show Gist options
  • Select an option

  • Save mfurquimdev/125d8b1162d7f9d35f9e396277b027d3 to your computer and use it in GitHub Desktop.

Select an option

Save mfurquimdev/125d8b1162d7f9d35f9e396277b027d3 to your computer and use it in GitHub Desktop.
Configs
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
XDG_CONFIG_HOME="$HOME/.config"
export XDG_CONFIG_HOME
export PATH=${HOME}/bin:${HOME}/.local/bin:$PATH
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
export XDG_CONFIG_HOME="$HOME/.config"
export PYTHONPATH=/usr/lib/python3.8/site-packages:/usr/lib/python3.7/site-packages:/usr/lib/python2.7/site-packages
export CLICOLORS=1
test -r "~/.dir_colors" && eval $(dircolors ~/.dir_colors)
#export LS_COLORS="di=36:ln=35:so=31:pi=33:ex=32:bd=1;36:cd=1;33:su=1;34:sg=1;35:tw=1;37:ow=1;32"
#source /usr/share/LS_COLORS/dircolors.sh
#test -r "${HOME}/.dir_colors" && eval $(dircolors ~/.dir_colors)
TMOUT=0
export TMOUT
readonly TMOUT
export LEDGER_FILE=/home/mfurquim/.finance/2020.journal
# Disallow existing regular files to be overwritten by redirection of shell output
set -o noclobber
shopt -s histappend
bind 'set show-all-if-ambiguous off'
bind 'set completion-ignore-case on'
function p() {
for f in *; do
if [ -f "$f" ]; then
if [[ ! $f == *.png ]]; then
echo -e "\033[38;1;32m$f\033[38;1;0m";
cat "$f";
echo "";
fi;
fi;
done;
}
alias j="vim ~/.vimjournal/\"\$(date '+Week %W-%Y').md\""
alias gl='git log --oneline'
#alias gl='git log --graph --oneline'
alias ga='git add'
alias gs='git status'
alias gc='git commit'
alias gd='git diff'
alias gp='git push'
alias gk='git checkout'
alias gb='git branch'
alias mv='mv -v'
alias rm='rm -v'
alias cp='cp -v'
alias mkdir='mkdir -pv'
alias vim='vim -p'
alias ucc='pushd /home/mfurquim/projetos/SDP_UCC/ucc/App'
alias dvr='pushd /home/mfurquim/projetos/SDP_UCC/ucc/Test/integration/DVR'
alias tucc="pushd /home/mfurquim/projetos/SDP_UCC/ucc/Test/; make clean jail; popd;"
alias tdvr="pushd /home/mfurquim/projetos/SDP_UCC/ucc/Test/integration/DVR; make all run; popd;"
alias ls='ls -F --color --group-directories-first'
alias tree='tree --dirsfirst -FC'
alias t='tree -L 3'
alias t2='tree -L 2'
alias grep='grep --colour -EIin'
alias pac='sudo pacman --noconfirm'
alias bunny="echo -e \"(\ /)\n( . .)\nc(\033[38;1;31m\\\"\033[38;1;0m)(\033[38;1;31m\\\"\033[38;1;0m)\""
trap 'tput sgr0' DEBUG
ESC=$(printf "\e")
F_RED="$ESC[38;5;1m"
F_GREEN="$ESC[38;5;2m"
PS1=''
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
function prompt_right() {
# echo -e "\033[38;5;8m$(date '+%a, %b %d - %H:%M:%S')\033[0m"
echo -e "\033[38;1;3m$(date '+%a, %b %d - %H:%M:%S')\033[0m"
}
function prompt_left() {
# https://www.tutorialkart.com/bash-shell-scripting/bash-split-string/
str=$(pwd)
oldest=""
old=""
current=""
IFS='/' # hyphen (/) is set as delimiter
read -ra ADDR <<< "$str" # str is read into an array as tokens separated by IFS
for i in "${ADDR[@]}"; do # access each element of array
oldest="$old"
old="$current"
current="$i"
done
IFS=' ' # reset to default value after usage
path=""
if [ -z "$oldest" ]
then
if [ -z "$old" ]
then
path="/$current"
else
path="$old/$current"
fi
else
path="$oldest/$old/$current"
fi
echo -e "\u\033[38;1;97m@\033[38;1;0m\h\033[38;5;7m\033[72;1;34m [$path]\033[38;1;93m$(parse_git_branch)\033[0;1;0m"
}
function prompt() {
if [[ $? == 0 ]]; then
err=0
err_color=$F_GREEN
else
err=1
err_color=$F_RED
fi
compensate=12
PS1=$(printf "%*s\r%s\n\$ " "$(($(tput cols)+${compensate}))" "$(prompt_right)" "$(echo -n $err_color)$(prompt_left)")
# Force prompt to write history after every command.
# http://superuser.com/questions/20900/bash-history-loss
history -a; history -c; history -r
}
#EC() {
# echo -e '\e[1;33m'code $?'\e[m\n'
#}
trap "" ERR
function settitle () {
export PREV_COMMAND=${PREV_COMMAND}${@}
printf "\033]0;%s\007" "${BASH_COMMAND//[^[:print:]]/}"
export PREV_COMMAND=${PREV_COMMAND}' | '
}
# Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".
# http://stackoverflow.com/questions/9457233/unlimited-bash-history
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
# Change the file location because certain bash sessions truncate .bash_history file upon close.
# http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login
export HISTFILE=~/.bash_eternal_history
# Bash history: “ignoredups” and “erasedups” setting conflict with common history across sessions
# https://unix.stackexchange.com/questions/18212/bash-history-ignoredups-and-erasedups-setting-conflict-with-common-history/18443#18443?newreg=ad3ea662cd754c148058a0c44d22102f
# https://www.linuxjournal.com/content/using-bash-history-more-efficiently-histcontrol
HISTCONTROL=ignorespace:ignoredups:erasedups
shopt -s histappend
PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
trap 'settitle "$BASH_COMMAND"' DEBUG
export PROMPT_COMMAND=prompt';export PREV_COMMAND=""'
export LFS=/mnt/lfs
export PATH=${HOME}/bin:${HOME}/.local/bin:$PATH
#! /bin/sh
sxhkd &
setxkbmap -layout br
${HOME}/.fehbg
bspc monitor -d 1 2 3 4 5 6 7 8 9 0
bspc config border_width 2
bspc config window_gap 3
bspc config split_ratio 0.618033988749894848204586834365638117720309179805762862135 # Golden
bspc config borderless_monocle true
bspc config gapless_monocle true
# https://www.reddit.com/r/bspwm/comments/4a4375/no_gaps_when_only_one_window_on_the_screen/
bspc config single_monocle true
# https://github.com/LeonGr/dotfiles/blob/master/bspwm/bspwmrc
bspc config focus_by_distance false
bspc config history_aware_focus true
bspc config focus_follows_pointers false
bspc config pointer_follows_focus false
bspc config click_to_focus true
bspc config adaptive raise true
bspc config center_pseudo_tiled true
# https://www.reddit.com/r/bspwm/comments/3crent/inactivewindow_in_compton_with_bspwm/
#mark-wmwin-focused = true;
#mark-ovredir-focused = true;
#inactive-opacity-override = true;
# https://www.reddit.com/r/bspwm/comments/e9u07i/how_to_spawn_new_windows_on_the_right/
bspc config automatic_scheme longest_side
#bspc config automatic_scheme shortest_side
bspc config initial_polarity second_child
#bspc config initial_polarity first_child
bspc rule -a Firefox desktop='^1' follow=on focus=on_
bspc rule -a Spotify split_dir=north desktop='^4'
bspc rule -a Thunderbird split_dir=east desktop='^5'
bspc rule -a Skys plit_dir=west desktop='^5'
bspc rule -a Pidgin split_dir=south desktop='^5'
bspc rule -a 'feh' state=floating
bspc rule -a 'Zathura' split_dir=east state=floating
#bspc rule -a Gimp desktop='^8' state=floating follow=on
#bspc rule -a mplayer2 state=floating
#bspc rule -a Kupfer.py focus=on
#bspc rule -a Screenkey manage=off
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectively.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "0x0-1+1"
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 0
# The height of the entire notification. If the height is smaller
# than the font height and padding combined, it will be raised
# to the font height and padding.
notification_height = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 3
# Defines color of the frame around the notification window.
frame_color = "#aaaaaa"
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
idle_threshold = 120
### Text ###
font = Monospace 8
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = right
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# When word_wrap is set to no, specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Align icons left/right/off
icon_position = off
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 32
# Paths to default icons.
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/firefox -new-tab
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
# Manage dunst's desire for talking
# Can be one of the following values:
# crit: Critical features. Dunst aborts
# warn: Only non-fatal warnings
# mesg: Important Messages
# info: all unimportant stuff
# debug: all less than unimportant stuff
verbosity = mesg
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 10
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines action of mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: If the notification has exactly one action, or one is marked as default,
# invoke it. If there are multiple and no default, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
mouse_left_click = close_current
mouse_middle_click = do_action
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = ctrl+space
# Close all notifications.
close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1". Make sure this key actually exists on your keyboard layout,
# e.g. check output of 'xmodmap -pke'
history = ctrl+grave
# Context menu.
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#222222"
foreground = "#888888"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
[urgency_normal]
background = "#285577"
foreground = "#ffffff"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
[urgency_critical]
background = "#900000"
foreground = "#ffffff"
frame_color = "#ff0000"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# timeout
# urgency
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
#[fullscreen_show_critical]
# msg_urgency = critical
# fullscreen = show
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
[says]
appname = Pidgin
summary = *says*
urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg
#
# wm independent hotkeys
#
# terminal emulator
alt + Return
termite
# program launcher
alt + d
bspc config ignore_ewmh_focus true; bspc rule -a \* -o node=@$(bspc query -D -d):.focused split_dir=south follow=off; dmenu_run
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
#
# bspwm hotkeys
#
# quit/restart bspwm
alt + shift + e
bspc quit
alt + r
bspc wm -r
# close and kill
alt + w
bspc node -c
alt + shift + q
bspc node -k
# lock screen
super + l
XSECURELOCK_SINGLE_AUTH_WINDOW=1 XSECURELOCK_PASSWORD_PROMPT=cursor XSECURELOCK_SHOW_DATETIME=0 XSECURELOCK_SHOW_USERNAME=0 XSECURELOCK_SHOW_HOSTNAME=0 xsecurelock
# alternate between the tiled and monocle layout
alt + f
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest node
super + g
bspc node -s biggest.local
#
# state/flags
#
# set the window state
super + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
alt + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
super + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous node in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local
# focus the next/previous desktop in the current monitor
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
super + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
alt + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
#
# preselect
#
# preselect the direction
alt + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
alt + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
alt + ctrl + space
bspc node -p cancel
alt + space
dunstify "$(date '+%a, %b %d - %H:%M:%S')";
# cancel the preselection for the focused desktop
alt + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# https://www.reddit.com/r/bspwm/comments/esyekd/need_help_to_correctly_move_floating_and_tiling/
#!/bin/sh
#
#bspc query -N -n focused.tiled > /dev/null && {
# bspc node -s "$1"
# exit
#}
#
#step=20
#
#case $1 in
# east) x=$step; y=0;;
# west) x=-$step; y=0;;
# north) x=0; y=-$step;;
# south) x=0; y=$step;;
#esac
#
#bspc node -v "$x" "$y"
#
# expand a window by moving one of its side outward
ctrl + alt + shift + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
ctrl + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
######## Keyboard Volume control keys ##########
XF86AudioPlay
playerctl play
XF86AudioPause
playerctl pause
XF86AudioStop
playerctl stop
XF86AudioNext
playerctl next
XF86AudioPrev
playerctl previous
XF86AudioRaiseVolume
pactl set-sink-volume 0 +2% && dunstify "$(echo "Volume: $(pactl list sinks | \grep "Volume" | cut -d'/' -f 2 | head -n 1 | sed -e "s/ *//" && amixer -c 0 get Master | tail -1 | awk '{print $5}')" | tr '\n' ' ')"
XF86AudioLowerVolume
pactl set-sink-volume 0 -3% && dunstify "$(echo "Volume: $(pactl list sinks | \grep "Volume" | cut -d'/' -f 2 | head -n 1 | sed -e "s/ *//" && amixer -c 0 get Master | tail -1 | awk '{print $5}')" | tr '\n' ' ')"
XF86AudioMute
pactl set-sink-mute 0 toggle && dunstify "$(pactl list sinks | \grep "Mute" | tr -d '[:space:]')";
XF86MonBrightnessUp
xbacklight +10
XF86MonBrightnessDown
xbacklight -10
[options]
allow_bold = true
audible_bell = false
bold_is_bright = true
cell_height_scale = 1.0
cell_width_scale = 1.0
clickable_url = true
#dynamic_title = true
#font = Monospace 9
font = Hack 9
#font = Iosevka size 12
#fullscreen = true
#icon_name = terminal
mouse_autohide = true
scroll_on_output = false
scroll_on_keystroke = true
# Length of the scrollback buffer, 0 disabled the scrollback buffer
# and setting it to a negative value means "infinite scrollback"
scrollback_lines = -1
#search_wrap = true
#urgent_on_bell = true
#hyperlinks = false
# $BROWSER is used by default if set, with xdg-open as a fallback
#browser = xdg-open
# "system", "on" or "off"
#cursor_blink = system
# "block", "underline" or "ibeam"
cursor_shape = underline
# Hide links that are no longer valid in url select overlay mode
#filter_unmatched_urls = true
# Emit escape sequences for extra modified keys
#modify_other_keys = false
# set size hints for the window
#size_hints = false
# "off", "left" or "right"
#scrollbar = off
# Copyright (c) 2016-present Arctic Ice Studio <development@arcticicestudio.com>
# Copyright (c) 2016-present Sven Greb <code@svengreb.de>
# Project: Nord Termite
# Repository: https://github.com/arcticicestudio/nord-termite
# License: MIT
[colors]
# Darkest White
cursor = #d8dee9
# Darkest Black
cursor_foreground = #2e3440
# Darkest White
foreground = #d8dee9
# Darkest White
foreground_bold = #d8dee9
# Darkest Black
background = #2e3440
# Google Darkest Black
#030303
# Google Black
#111111
background = #111111
# Google Lightest Black
#2F2F2F
# Lightest Black
highlight = #4c566a
# Dark Black
color0 = #3b4252
# Red
color1 = #bf616a
# Green
color2 = #a3be8c
# Yellow
color3 = #ebcb8b
# Third Blue
color4 = #81a1c1
# Purple
color5 = #b48ead
# Second Blue
color6 = #88c0d0
# White
color7 = #e5e9f0
# Light Black
#color8 = #434c5e
# Lightest Black
color8 = #4c566a
# Red
color9 = #bf616a
# Green
color10 = #a3be8c
# Yellow
color11 = #ebcb8b
# Third Blue
color12 = #81a1c1
# Purple
color13 = #b48ead
# First Blue
color14 = #8fbcbb
# Lightest White
color15 = #eceff4
[Icon Theme]
Name=Arc
Inherits=Moka,Adwaita,gnome,hicolor
Comment=Arc Icon theme
Example=arrow
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'wakatime/vim-wakatime'
Plugin 'drzel/vim-line-no-indicator'
Plugin 'wesQ3/vim-windowswap'
Plugin 'scrooloose/nerdtree'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
Plugin 'tpope/vim-obsession'
Plugin 'guns/xterm-color-table.vim'
Plugin 'skywind3000/vim-quickui'
Plugin 'machakann/vim-sandwich'
Plugin 'arcticicestudio/nord-vim'
Plugin 'liuchengxu/vim-clap'
Plugin 'kovetskiy/sxhkd-vim'
Plugin 'mhinz/vim-signify'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic — @amix3k
"
" Awesome_version:
" Get this config, nice color schemes and lots of plugins!
"
" Install the awesome version from:
"
" https://github.com/amix/vimrc
"
" Sections:
" -> General
" -> VIM user interface
" -> Colors and Fonts
" -> Files and backups
" -> Text, tab and indent related
" -> Visual mode related
" -> Moving around, tabs and buffers
" -> Status line
" -> Editing mappings
" -> vimgrep searching and cope displaying
" -> Spell checking
" -> Misc
" -> Helper functions
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=500
" Enable filetype plugins
filetype plugin on
filetype indent on
" Set to auto read when a file is changed from the outside
set autoread
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ","
" Fast saving
"nmap <leader>w :w!<cr>
" :W sudo saves the file
" (useful for handling the permission-denied error)
cnoremap WW w !sudo tee % > /dev/null<cr>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set 10 lines to the cursor - when moving vertically using j/k
set so=10
" Turn on the Wild menu
" https://unix.stackexchange.com/questions/43526/is-it-possible-to-create-and-use-menus-in-terminal-based-vim
set wildmenu
set wildmode=full
source $VIMRUNTIME/menu.vim
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
"Always show current position
set ruler
" Height of the command bar
set cmdheight=1
set showcmd
" A buffer becomes hidden when it is abandoned
set hid
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>
" Ignore case when searching
set ignorecase
" When searching try to be smart about cases
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Add a bit extra margin to the left
set foldcolumn=0
set number
set relativenumber
set updatetime=100
" When wrapping, use space b/w numbers
set cpoptions+=n
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting
syntax enable
" https://stackoverflow.com/questions/27235102/vim-randomly-breaks-syntax-highlighting
nnoremap <leader>s :syntax sync minlines=20<cr>
" https://vim.fandom.com/wiki/Fix_syntax_highlighting
autocmd FileType javascript syn sync ccomment javaScriptComment
set t_Co=256
let g:nord_cursor_line_number_background = 1
set cursorline
let g:nord_italic_comments = 1
let g:nord_bold_vertical_split_line = 1
let g:nord_uniform_diff_background = 1
let g:nord_bold = 1
let g:nord_italic = 1
let g:nord_italic_comments = 1
let g:nord_underline = 1
set background=dark
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" Use Unix as the standard file type when creating new files
set ffs=unix,dos,mac
try
"colorscheme desert
"colorscheme corvine
"colorscheme Tomorrow-Night
colorscheme nord
catch
endtry
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set undodir=~/.vim/undodir
set directory=~/.vim/swpdir
" set nobackup
" set nowb
" set noswapfile
" https://stackoverflow.com/questions/5700389/using-vims-persistent-undo
" Put plugins and dictionaries in this dir (also on Windows)
let vimDir = '$HOME/.vim'
let &runtimepath.=','.vimDir
" Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = expand(vimDir . '/undodir')
" Create dirs
call system('mkdir ' . vimDir)
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Be smart when using tabs ;)
set smarttab
" 1 tab == 3 spaces
set tabstop=3
set shiftwidth=3
" Use spaces instead of tabs
set expandtab
" Auto indent
set autoindent
" Smart indent
set smartindent
" https://stackoverflow.com/questions/12814647/showing-single-space-invisible-character-in-vim
set list
" ⸱ U+2E31 WORD SEPARATOR MIDDLE DOT
"set listchars=tab:⥓\ ,space:⸱
set listchars=tab:-⸱,
" Do not Linebreak on any number of characters
set lbr
set tw=0
" Wrap lines
set wrap
set showbreak=↪
" :help fo-table
" Do not auto-wrap text using textwidth
set fo-=t
" Do not auto-wrap comments using textwidth
set fo-=c
" Automatically insert the current comment leader after hitting <Enter> in Insert mode AND 'o' or 'O' in Normal mode
set fo+=ro
" This will trigger a set nowrap on a window you enter and a set wrap on a window you leave
" https://stackoverflow.com/questions/13386295/how-to-activate-word-wrap-on-all-unfocused-windows-in-vim
"autocmd BufEnter * set wrap
"autocmd BufLeave * set nowrap
" how to change vim background color in hex code or rgb color code?
" https://vi.stackexchange.com/questions/9754/how-to-change-vim-background-color-in-hex-code-or-rgb-color-code
" for i in {0..255} ; do printf "\x1b[38;5;${i}mcolour${i} "; done
highlight CursorLine ctermbg=234
highlight CursorLineNR ctermbg=234
augroup CursorLine
au!
au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
augroup END
" This will highlight all characters past 175 columns
" http://blog.ezyang.com/2010/03/vim-textwidth/
augroup vimrc_autocmds
"autocmd BufEnter * highlight OverLength ctermbg=237
autocmd BufEnter * highlight OverLength cterm=bold
autocmd BufEnter * match OverLength /\%175v.*/
augroup END
" https://vim.fandom.com/wiki/Highlight_current_word_to_find_cursor
"nnoremap <C-K> :call HighlightNearCursor()<CR>
"function HighlightNearCursor()
" if !exists("s:highlightcursor")
" match Todo /\k*\%#\k*/
" let s:highlightcursor=1
" else
" match None
" unlet s:highlightcursor
" endif
"endfunction
"https://stackoverflow.com/questions/1919028/how-to-show-vertical-line-to-wrap-the-line-in-vim
"nnoremap <Leader>H :call<SID>LongLineHLToggle()<cr>
"highlight OverLength ctermbg=none cterm=none
"match OverLength /\%>175v/
"fun! s:LongLineHLToggle()
" if !exists('w:longlinehl')
" autocmd BufEnter * highlight OverLength cterm=underline
" let w:longlinehl = matchadd('OverLength', '.\%>175v', 0)
" echo "Long lines highlighted"
" else
" call matchdelete(w:longlinehl)
" unl w:longlinehl
" echo "Long lines unhighlighted"
" endif
"endfunction
" https://stackoverflow.com/questions/8450919/how-can-i-delete-all-hidden-buffersc
"function! DeleteHiddenBuffers()
" let tpbl=[]
" let closed = 0
" call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
" for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
" if getbufvar(buf, '&mod') == 0
" silent execute 'bwipeout' buf
" let closed += 1
" endif
" endfor
" echo "Closed ".closed." hidden buffers"
"endfunction
" Code folds are saved and restored:
" https://www.freecodecamp.org/news/learn-linux-vim-basic-features-19134461ab85/#9b6b
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
" Fold at matching braces
nnoremap <leader>f /{<CR>mf%zf'f:noh<cr>
" Indent correctly at inner object of braces
nnoremap <leader>i =i{
" F8 para indentar todo o codigo
noremap <F8> mzgg=G'z
""""""""""""""""""""""""""""""
" => Visual mode related
""""""""""""""""""""""""""""""
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Moving around, tabs, windows and buffers
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Map <Space> to / (search) and Ctrl-<Space> to ? (backwards search)
map <space> /
map <c-space> ?
" Disable highlight when <leader><cr> is pressed
map <silent> <leader><cr> :noh<cr>
" Up is actually go one line up
nnoremap k gk
nnoremap j gj
" Smart way to move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Open new split panes to right and bottom, which feels more natural than Vim’s default:
set splitbelow
set splitright
" Close all the buffers
map <leader>ba :bufdo bd<cr>
map <leader>l :bnext<cr>
map <leader>h :bprevious<cr>
" Useful mappings for managing tabs
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>t<leader> :tabnext
" Let 'tl' toggle between this and the last accessed tab
let g:lasttab = 1
nmap <Leader>tl :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()
" Opens a new tab with the current buffer's path
" Super useful when editing files in the same directory
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
" Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
" Specify the behavior when switching between buffers
try
set switchbuf=useopen,usetab,newtab
set stal=2
catch
endtry
" Return to last edit position when opening files (You want this!)
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
""""""""""""""""""""""""""""""
" => Status line
""""""""""""""""""""""""""""""
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
function! StatuslineGit()
let l:branchname = GitBranch()
return strlen(l:branchname) > 0?' '.l:branchname.' ':''
endfunction
" Always show the status line
set laststatus=2
" Format the status line
set statusline=
set statusline+=%#StatusLineNC#%*
set statusline+=%{StatuslineGit()}
" Relative position in file (not as percent, but a sliding bar
set statusline+=\ %{LineNoIndicator()}
" Read only flag
set statusline+=\ %r
"set statusline+=%f
set statusline+=%#StatusLineNC#%*
set statusline+=%{&buftype!='terminal'?expand('%:p:h:h:t').'\/'.expand('%:p:h:t').'\/'.expand('%:t'):expand('%')} " dir/dir/filename.ext
" Modified flag
set statusline+=\ %m
" Fill horizontal space
set statusline+=%=
" Formatoptions
set statusline+=[%{&fo}]
" Tracking session flag
set statusline+=\ %{ObsessionStatus()}
" Current line and column
set statusline+=\ %l:%c
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Editing mappings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Remap VIM 0 to first non-blank character
"map 0 ^
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>mw mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" Quickly open a buffer for scribble
map <leader>q :e ~/buffer<cr>
" Quickly open a markdown buffer for scribble
map <leader>x :e ~/buffer.md<cr>
" Toggle paste mode on and off
map <leader>pp :setlocal paste!<cr>
map <C-n> :NERDTreeToggle<CR>
" VIMRC de FELIPE JALES
"
set cinoptions=g0,:s,b1,=0,(0,0{,is " opcoes de indentacao... ':help cinoptions'
set title
" incluindo path do projeto nas tags
set tags=./tags,./TAGS,tags,TAGS,~/projetos/tags,~/projetos/TAGS
" Copia e cola entre instâncias diferentes do vim sem usar o clipboard do " S.O.,
" além disso evitando problemas com a autoidentação ao colar
vmap <silent> ,y y:sp! ~/.vim/clipboard<CR>eggdG"0p:x!<CR>
nmap <silent> ,y :new<CR>:call setline(1,getregtype())<CR>o<Esc>P:wq! ~/.vim/clipboard<CR>
map <silent> ,p :r ~/.vim/clipboard<CR>
"""""
" Funcao grep melhorada
let &path = getcwd() . '/**'
function! Grep(args)
let l:lista = split(a:args)
if len(l:lista) == 3
let l:_arg = l:lista[0]
let l:_name = substitute(l:lista[1], "\\s", "*", "g")
let l:_path = simplify(l:lista[2])
elseif len(l:lista) == 2
let l:_arg = "-RIn"
let l:_name = substitute(l:lista[0], "\\s", "*", "g")
let l:_path = simplify(l:lista[1])
elseif len(l:lista) == 1
let l:_arg = "-RIn"
let l:_name = substitute(l:lista[0], "\\s", "*", "g")
let l:_path = "."
else
echo "Invalid Arguments!"
return
endif
let l:string = "grep " . l:_arg . " " . l:_name . " " . l:_path . " |grep -v /.dep/ |grep -v /.cross-dep/ |grep -v /.ppc-dep/ |grep -v /.arm-dep/ |grep -v /doc/ 2>/dev/null"
let l:list = system(l:string)
let l:num = strlen(substitute(l:list, "[^\n]", "", "g"))
if l:num < 1
echo "Not Found"
return
endif
let l:count = 0
let l:_listNum = split(l:list, "\n")
let l:_list = split(l:list, "\n")
for line in l:_list
echo l:count + 1 . " " . l:line
let l:_listNum[l:count] = strpart(l:_list[l:count], stridx(l:_list[l:count], ":") + 1)
let l:_listNum[l:count] = strpart(l:_listNum[l:count], 0, stridx(l:_listNum[l:count], ":"))
let l:_list[l:count] = strpart(l:_list[l:count], 0, stridx(l:_list[l:count], ":"))
let l:count += 1
endfor
let l:input = input("Which ? (<enter>=nenhum)\n")
if strlen(substitute(l:input, "[0-9]", "", "g"))>0
echo "Not a number"
return
endif
if strlen(l:input)==0
return
endif
execute ":vsplit". "+" . l:_listNum[l:input - 1] . " " . l:_list[l:input - 1]
endfunction
command! -nargs=1 Grep :call Grep("<args>")
map <C-g> :Grep
""Spell to git commits
"set spelllang=pt
"au FileType gitcommit set spell
au BufRead,BufNewFile * let b:timelyRedrawn = localtime()
au CursorHold * call UpdateTimely()
let g:redraw_time = 20
function! UpdateTimely()
if((localtime() - b:timelyRedrawn) >= g:redraw_time)
redraw!
syntax sync fromstart
let b:timelyRedrawn = localtime()
endif
echo strftime("%a, %b %d - %H:%M:%S")
endfunction
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! title Nord XResources +
! project nord-xresources +
! version 0.1.0 +
! repository https://github.com/arcticicestudio/nord-xresources +
! author Arctic Ice Studio +
! email development@arcticicestudio.com +
! copyright Copyright (C) 2016 +
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define nord0 #2E3440
#define nord1 #3B4252
#define nord2 #434C5E
#define nord3 #4C566A
#define nord4 #D8DEE9
#define nord5 #E5E9F0
#define nord6 #ECEFF4
#define nord7 #8FBCBB
#define nord8 #88C0D0
#define nord9 #81A1C1
#define nord10 #5E81AC
#define nord11 #BF616A
#define nord12 #D08770
#define nord13 #EBCB8B
#define nord14 #A3BE8C
#define nord15 #B48EAD
*.foreground: nord4
*.background: nord0
*.cursorColor: nord4
*fading: 35
*fadeColor: nord3
*.color0: nord1
*.color1: nord11
*.color2: nord14
*.color3: nord13
*.color4: nord9
*.color5: nord15
*.color6: nord8
*.color7: nord5
*.color8: nord3
*.color9: nord11
*.color10: nord14
*.color11: nord13
*.color12: nord9
*.color13: nord15
*.color14: nord7
*.color15: nord6
!new config for rofi #new config for rofi
/* ! Use extended color scheme */
rofi.color-enabled: true
! ! ! Color scheme for normal row
rofi.color-normal: argb:00000000, #D8DEE9 , argb:00000000, #efefef , #1B2B34
! ! ! Color scheme for urgent row
rofi.color-urgent: argb:00000000, #F99157 , argb:00000000, #F99157 , #1B2B34
! ! ! Color scheme for active row
rofi.color-active: argb:00000000, #6699CC , argb:00000000, #6699CC , #1B2B34
! ! ! Color scheme windowx
rofi.color-window: argb:ee222222, #FAC863 , #ffffff
! ! ! Separator style (none, dash, solid)
x! rofi.separator-style: solid
Xft.dpi: 96
/* rofi.color-enabled: true */
/* ! bg border separator */
/* rofi.color-window: #1d2021, #a89984, #a89984 */
/* ! ! bg fg bg-alt hl-bg hl-fg */
/* rofi.color-normal: #1d2021, #ebdbb2, #282828, #504945, #fbf1c7 */
/* rofi.color-active: #d79921, #1d2021, #d79921, #fabd2f, #1d2021 */
/* rofi.color-urgent: #cc241d, #1d2021, #cc241d, #fb4934, #1d2021 */
Xcursor.theme: pArch-24
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.antialias: true
Xft.rgba: rgb
#!/bin/bash
m_date=$(date '+%a, %b %d - %H:%M:%S');
statusinfo=$(echo -e ${m_date}")
dunstify "$statusinfo";
#!/bin/bash
TMPBG=/tmp/screen.png
LOCK=${HOME}/bin/lock.png
RES=$(xrandr | grep 'current' | sed -E 's/.*current\s([0-9]+)\sx\s([0-9]+).*/\1x\2/')
ffmpeg -f x11grab -video_size $RES -y -i $DISPLAY -i $LOCK -filter_complex "boxblur=6:1,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -vframes 1 $TMPBG -loglevel quiet
i3lock -i $TMPBG
rm $TMPBG
#!/bin/bash
m_volume=$(pactl list sinks | \grep "Volume" | cut -d'/' -f 2 | head -n 1 | sed -e "s/ *//")
statusinfo=$(echo -e "Volume: $m_volume")
dunstify "$statusinfo";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment