Skip to content

Instantly share code, notes, and snippets.

@thraizz
Created October 12, 2020 09:20
Show Gist options
  • Select an option

  • Save thraizz/f106ead51a50d4cddf96d5d83d595014 to your computer and use it in GitHub Desktop.

Select an option

Save thraizz/f106ead51a50d4cddf96d5d83d595014 to your computer and use it in GitHub Desktop.
πŸ’œ dotfiles for reddit πŸ’œ
" ==============================================================================
" Name: One Half Dark
" Author: Son A. Pham <sp@sonpham.me>
" Url: https://github.com/sonph/onehalf
" License: The MIT License (MIT)
"
" A dark vim color scheme based on Atom's One. See github.com/sonph/onehalf
" for installation instructions, a light color scheme, versions for other
" editors/terminals, and a matching theme for vim-airline.
" ==============================================================================
set background=dark
highlight clear
syntax reset
let g:colors_name="onehalfdark"
let colors_name="onehalfdark"
let s:black = { "gui": "#282c34", "cterm": "236" }
let s:red = { "gui": "#e06c75", "cterm": "168" }
let s:green = { "gui": "#98c379", "cterm": "114" }
let s:yellow = { "gui": "#e5c07b", "cterm": "180" }
let s:blue = { "gui": "#61afef", "cterm": "75" }
let s:purple = { "gui": "#c678dd", "cterm": "176" }
let s:cyan = { "gui": "#56b6c2", "cterm": "73" }
let s:white = { "gui": "#dcdfe4", "cterm": "188" }
let s:fg = s:white
let s:bg = s:black
let s:comment_fg = { "gui": "#5c6370", "cterm": "241" }
let s:gutter_bg = { "gui": "#282c34", "cterm": "236" }
let s:gutter_fg = { "gui": "#919baa", "cterm": "247" }
let s:cursor_line = { "gui": "#313640", "cterm": "237" }
let s:color_col = { "gui": "#313640", "cterm": "237" }
let s:selection = { "gui": "#474e5d", "cterm": "239" }
let s:vertsplit = { "gui": "#313640", "cterm": "237" }
function! s:h(group, fg, bg, attr)
if type(a:fg) == type({})
exec "hi " . a:group . " guifg=" . a:fg.gui . " ctermfg=" . a:fg.cterm
else
exec "hi " . a:group . " guifg=NONE cterm=NONE"
endif
if type(a:bg) == type({})
exec "hi " . a:group . " guibg=" . a:bg.gui . " ctermbg=" . a:bg.cterm
else
exec "hi " . a:group . " guibg=NONE ctermbg=NONE"
endif
if a:attr != ""
exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
else
exec "hi " . a:group . " gui=NONE cterm=NONE"
endif
endfun
" User interface colors {
call s:h("Normal", s:fg, s:bg, "")
call s:h("NonText", s:fg, "", "")
call s:h("Cursor", s:purple, s:blue, "")
call s:h("CursorColumn", "", s:cursor_line, "")
call s:h("CursorLine", "", s:cursor_line, "")
call s:h("LineNr", s:gutter_fg, s:gutter_bg, "")
call s:h("CursorLineNr", s:fg, "", "")
call s:h("DiffAdd", s:green, "", "")
call s:h("DiffChange", s:yellow, "", "")
call s:h("DiffDelete", s:red, "", "")
call s:h("DiffText", s:blue, "", "")
call s:h("IncSearch", s:bg, s:yellow, "")
call s:h("Search", s:bg, s:yellow, "")
call s:h("ErrorMsg", s:fg, "", "")
call s:h("ModeMsg", s:fg, "", "")
call s:h("MoreMsg", s:fg, "", "")
call s:h("WarningMsg", s:red, "", "")
call s:h("Question", s:purple, "", "")
call s:h("Pmenu", s:bg, s:fg, "")
call s:h("PmenuSel", s:fg, s:blue, "")
call s:h("PmenuSbar", "", s:selection, "")
call s:h("PmenuThumb", "", s:fg, "")
call s:h("SpellBad", s:red, "", "")
call s:h("SpellCap", s:yellow, "", "")
call s:h("SpellLocal", s:yellow, "", "")
call s:h("SpellRare", s:yellow, "", "")
call s:h("StatusLine", s:blue, s:cursor_line, "")
call s:h("StatusLineNC", s:comment_fg, s:cursor_line, "")
call s:h("TabLine", s:comment_fg, s:cursor_line, "")
call s:h("TabLineFill", s:comment_fg, s:cursor_line, "")
call s:h("TabLineSel", s:fg, s:bg, "")
call s:h("Visual", "", s:selection, "")
call s:h("VisualNOS", "", s:selection, "")
call s:h("ColorColumn", "", s:color_col, "")
call s:h("Conceal", s:fg, "", "")
call s:h("Directory", s:blue, "", "")
call s:h("VertSplit", s:vertsplit, s:vertsplit, "")
call s:h("Folded", s:fg, "", "")
call s:h("FoldColumn", s:fg, "", "")
call s:h("SignColumn", s:fg, "", "")
call s:h("MatchParen", s:blue, "", "underline")
call s:h("SpecialKey", s:fg, "", "")
call s:h("Title", s:green, "", "")
call s:h("WildMenu", s:fg, "", "")
" }
" Syntax colors {
call s:h("Comment", s:comment_fg, "", "")
call s:h("Constant", s:cyan, "", "")
call s:h("String", s:green, "", "")
call s:h("Character", s:green, "", "")
call s:h("Number", s:yellow, "", "")
call s:h("Boolean", s:yellow, "", "")
call s:h("Float", s:yellow, "", "")
call s:h("Identifier", s:red, "", "")
call s:h("Function", s:blue, "", "")
call s:h("Statement", s:purple, "", "")
call s:h("Conditional", s:purple, "", "")
call s:h("Repeat", s:purple, "", "")
call s:h("Label", s:purple, "", "")
call s:h("Operator", s:fg, "", "")
call s:h("Keyword", s:red, "", "")
call s:h("Exception", s:purple, "", "")
call s:h("PreProc", s:yellow, "", "")
call s:h("Include", s:blue, "", "")
call s:h("Define", s:purple, "", "")
call s:h("Macro", s:purple, "", "")
call s:h("PreCondit", s:yellow, "", "")
call s:h("Type", s:yellow, "", "")
call s:h("StorageClass", s:yellow, "", "")
call s:h("Structure", s:yellow, "", "")
call s:h("Typedef", s:yellow, "", "")
call s:h("Special", s:blue, "", "")
call s:h("SpecialChar", s:fg, "", "")
call s:h("Tag", s:fg, "", "")
call s:h("Delimiter", s:fg, "", "")
call s:h("SpecialComment", s:fg, "", "")
call s:h("Debug", s:fg, "", "")
call s:h("Underlined", s:fg, "", "")
call s:h("Ignore", s:fg, "", "")
call s:h("Error", s:red, s:gutter_bg, "")
call s:h("Todo", s:purple, "", "")
" }
" Plugins {
" GitGutter
call s:h("GitGutterAdd", s:green, s:gutter_bg, "")
call s:h("GitGutterDelete", s:red, s:gutter_bg, "")
call s:h("GitGutterChange", s:yellow, s:gutter_bg, "")
call s:h("GitGutterChangeDelete", s:red, s:gutter_bg, "")
" Fugitive
call s:h("diffAdded", s:green, "", "")
call s:h("diffRemoved", s:red, "", "")
" }
" Git {
call s:h("gitcommitComment", s:comment_fg, "", "")
call s:h("gitcommitUnmerged", s:red, "", "")
call s:h("gitcommitOnBranch", s:fg, "", "")
call s:h("gitcommitBranch", s:purple, "", "")
call s:h("gitcommitDiscardedType", s:red, "", "")
call s:h("gitcommitSelectedType", s:green, "", "")
call s:h("gitcommitHeader", s:fg, "", "")
call s:h("gitcommitUntrackedFile", s:cyan, "", "")
call s:h("gitcommitDiscardedFile", s:red, "", "")
call s:h("gitcommitSelectedFile", s:green, "", "")
call s:h("gitcommitUnmergedFile", s:yellow, "", "")
call s:h("gitcommitFile", s:fg, "", "")
hi link gitcommitNoBranch gitcommitBranch
hi link gitcommitUntracked gitcommitComment
hi link gitcommitDiscarded gitcommitComment
hi link gitcommitSelected gitcommitComment
hi link gitcommitDiscardedArrow gitcommitDiscardedFile
hi link gitcommitSelectedArrow gitcommitSelectedFile
hi link gitcommitUnmergedArrow gitcommitUnmergedFile
" }
let g:terminal_color_0 = s:black.gui
let g:terminal_color_1 = s:red.gui
let g:terminal_color_2 = s:green.gui
let g:terminal_color_3 = s:yellow.gui
let g:terminal_color_4 = s:blue.gui
let g:terminal_color_5 = s:purple.gui
let g:terminal_color_6 = s:cyan.gui
let g:terminal_color_7 = s:white.gui
let g:terminal_color_8 = s:black.gui
let g:terminal_color_9 = s:red.gui
let g:terminal_color_10 = s:green.gui
let g:terminal_color_11 = s:yellow.gui
let g:terminal_color_12 = s:blue.gui
let g:terminal_color_13 = s:purple.gui
let g:terminal_color_14 = s:cyan.gui
let g:terminal_color_15 = s:white.gui
let g:terminal_color_background = s:bg.gui
let g:terminal_color_foreground = s:fg.gui
;==========================================================
;
;
; β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
; β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—
; β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
; β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—
; β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘
; β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
background = ${xrdb:background}
; The alternative background is transparent
background-alt = #00ffffff
background-alt2 = ${xrdb:color3}
foreground = ${xrdb:foreground}
foreground-alt = ${xrdb:color0}
primary = ${xrdb:color5}
secondary = ${xrdb:color2}
alert = #bd2c40
[bar/main]
width = 100%
background = ${colors.background}
height = 34
fixed-center = true
separator = %{F#33ffffff} | %{F-}
enable-ipc = true
font-0 = hack:style=regular,bold:size=10
font-1 = fontawesome:pixelsize=14;0
font-2 = noto sans symbols2:style=regular:pixelsize=12;1
line-size = 3
line-color = #f00
border-size = 18
border-top-size = 5
border-bottom-size = 5
border-color = #00000000
padding-left = 6
padding-right = 6
module-margin-left = 2
module-margin-right = 2
modules-left = mpd
modules-right = pacmd eth temperature date
tray-position = right
tray-padding = 2
tray-color = ${colors.foreground-alt}
cursor-click = pointer
cursor-scroll = ns-resize
[bar/secondary]
width = 100%
background = ${colors.background}
height = 34
fixed-center = true
separator = %{F#33ffffff} | %{F-}
enable-ipc = true
font-0 = hack:style=regular,bold:size=10
font-1 = fontawesome:pixelsize=14;0
font-2 = noto sans symbols2:style=regular:pixelsize=12;1
line-size = 3
line-color = #f00
border-size = 18
border-top-size = 5
border-bottom-size = 5
border-color = #00000000
padding-left = 6
padding-right = 6
module-margin-left = 2
module-margin-right = 2
modules-left = temperature
modules-right = weather
tray-position = right
tray-padding = 2
tray-color = ${colors.foreground}
tray-background = ${colors.background}
cursor-click = pointer
cursor-scroll = ns-resize
[bar/main-i3]
inherit = bar/main
monitor = ${env:MONITOR:DP-4}
modules-left = mpd pacmd
modules-center = i3
modules-right = cpu eth date
wm-restack = i3
scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev
[bar/secondary-i3]
inherit = bar/secondary
monitor = ${env:MONITOR:DP-1}
modules-left = live temperature
modules-right = weather
modules-center = i3
wm-restack = i3
cursor-click = pointer
cursor-scroll = ns-resize
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
pin-workspaces = true
label-mode-padding = 4
label-mode-foreground = ${colors.primary}
label-mode-background = ${colors.secondary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-foreground = ${colors.primary}
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 4
; unfocused = Inactive workspace on any monitor
label-unfocused = %{F${colors.foreground-alt}%index:0:1%%{F-}
label-unfocused-padding = 4
; visible = Active workspace on unfocused monitor
label-visible = %index:0:1%
label-visible-foreground = ${colors.secondary}
label-visible-background = ${colors.background-alt}
label-visible-underline= ${colors.secondary}
label-visible-padding = 4
; urgent = Workspace with urgency hint set
label-urgent = %index:0:1%
label-urgent-background = ${colors.alert}
label-urgent-padding = 4
[module/eth]
type = internal/network
interface = enp39s0
interval = 3.0
label-connected = %local_ip%
label-connected-foreground = ${colors.foreground}
label-connected-background = ${colors.background}
label-disconnected = %ifname% disconnected
format-disconnected = <label-disconnected>
label-disconnected-foreground = ${colors.foreground}
[module/date]
type = internal/date
interval = 5
date = "%d.%m,"
time = %H:%M
time-alt = %H:%M:%S
label = %date% %time%
label-foreground = ${colors.foreground}
label-background = ${colors.background}
[module/pacmd]
type = custom/script
exec = $HOME/scripts/get_current_output.sh
click-left = $HOME/scripts/switch_current_output.sh
format-underline = ${colors.background}
label-foreground = ${colors.foreground}
label-padding = 3
label-background = ${colors.background}
[module/weather]
type = custom/script
exec = curl wttr.in/${1:-KΓΆln}\?lang=de\&format="+%c+%t+%o" --silent
label-foreground = ${colors.foreground}
format-underline = ${xrdb:color3}
#!/bin/bash
artist=$(playerctl metadata --format "{{artist}}")
title=$(playerctl metadata --format "{{title}}")
s=""
titlelength=$(echo $title | awk '{print length}')
if [ $titlelength -gt 2 ]; then
if [ $titlelength -gt 10 ]; then
s=$(echo $title | cut -d' ' -f1-4)
else
s=$title
fi
fi
artistlength=$(echo $artist | awk '{print length}')
if [ $artistlength -gt 2 ]; then
if [ $artistlength -gt 10 ]; then
s=$s' - '$(echo $artist | cut -d' ' -f1-4)
else
s=$s' - '$artist
fi
fi
strlen=$(echo $s | awk '{print length}')
if [ $strlen -eq 0 ]; then
s="No player found."
fi
echo $s
#/bin/bash
pacmd list-sources | grep -q "Steinberg UR22mkII"
if [ $? -eq 0 ]; then
echo "Output: STEINBERG"
fi
pacmd list-sources | grep -q "TU104 HD Audio Controller Digital Stereo"
if [ $? -eq 0 ]; then
echo "Output: SPEAKERS"
fi
#!/bin/bash
# To launch rofi you have to use this command:
rofi -show window -mode window -window-thumbnail -theme /path/to/rofitheme.rasi
* {
active-background: #6ba86d;
active-foreground: @foreground;
normal-background: @background;
normal-foreground: @foreground;
urgent-background: #fe6d32;
urgent-foreground: @foreground;
alternate-active-background: @background;
alternate-active-foreground: @foreground;
alternate-normal-background: @background;
alternate-normal-foreground: @foreground;
alternate-urgent-background: @background;
alternate-urgent-foreground: @foreground;
selected-active-background: #d8dee9;
selected-active-foreground: @foreground;
selected-normal-background: #6ba86d;
selected-normal-foreground: @foreground;
selected-urgent-background: #af9a0a;
selected-urgent-foreground: @foreground;
background-color: rgba(0,0,0,10%);
background: #282c34;
foreground: #dcdfe4;
border-color: @background;
spacing: 0;
border: 0;
padding: 0;
}
window {
background-color: @background;
width: 75%;
padding: 4px;
children: [ listview ];
}
mainbox {
border: 10;
}
inputbar {
enabled: false;
}
message {
enabled: false;
}
textbox {
enabled: false;
}
listview {
columns: 5;
fixed-height: true;
lines: 1;
}
element {
width: 15em;
}
element-text {
enabled: false;
}
element-icon {
padding: 10px;
size: 15em;
}
element-icon selected{
background-color: @selected-active-background;
}
set nocompatible " be iMproved, required
set noshowmode
set shell=/bin/zsh
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'thraizz/vim-notes'
Plugin 'xolox/vim-misc'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/nerdtree'
Plugin 'Yggdroot/indentLine'
Plugin 'ciaranm/detectindent'
Plugin 'dense-analysis/ale'
Plugin 'posva/vim-vue'
Plugin 'junegunn/goyo.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-repeat'
Plugin 'fadein/vim-FIGlet'
Plugin 'sonph/onehalf', {'rtp': 'vim/'}
Plugin 'itchyny/lightline.vim'
Plugin 'mattn/emmet-vim'
Plugin 'vimlab/split-term.vim'
Plugin 'mileszs/ack.vim'
Plugin 'jeetsukumaran/vim-indentwise'
call vundle#end() " required
filetype plugin indent on " required
""" Behaviour on Events: Autocommands
autocmd StdinReadPre * let s:std_in=1
" Show NERDTree when opening a directory with vim
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
" Resize the window automatically
autocmd VimResized * wincmd =
""" Making VIM look nice: Visual Settings
syntax on
set splitbelow
set relativenumber
set conceallevel=1
set laststatus=2
set cursorline
set t_Co=256
if (strftime("%H") >= 6 && strftime("%H") < 18)
colorscheme light
else
colorscheme dark
endif
" if exists('+termguicolors')
" let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
" set termguicolors
" endif
""" Plugin Configurations
" ALE Vim settings, a syntanx linter
let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
let g:ale_linters = {'javascript': ['eslint'], 'vue': ['eslint'], 'python': ['flake8']}
let g:ale_fixers = {'javascript': ['eslint'], 'vue': ['eslint'], 'python': ['autopep8']}
let g:ale_fix_on_save = 1
" CtrlP Settings
let g:ctrlp_user_command = 'fd --type f --hidden --follow --exclude .git'
" Emmet Settings
let g:user_emmet_leader_key=','
let g:indentLine_conceallevel=1
let g:indentLine_char='|'
let g:indentLine_enabled=1
let g:ackprg = 'rg --vimgrep --type-not sql --smart-case'
" Auto close the Quickfix list after pressing '<enter>' on a list item
let g:ack_autoclose = 1
" Any empty ack search will search for the work the cursor is on
let g:ack_use_cword_for_empty_search = 1
let g:lightline = { 'colorscheme': 'onehalfdark' }
""" Keymaps
" Escape with jj
imap jj <ESC>:noh<CR>
" Show current files in Buffer with Ctrl+f
map <C-f> :CtrlPBuffer<CR>
" Show NERDTree with Ctrl+n
map <C-n> :NERDTreeToggle<CR>
map <silent> <F8> /^\(<\{7\}\\|>\{7\}\\|=\{7\}\\|\|\{7\}\)\( \\|$\)<cr>
" In insert or command mode, move normally by using Ctrl
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
inoremap <S-Tab> <C-d>
cnoremap <C-h> <Left>
cnoremap <C-j> <Down>
cnoremap <C-k> <Up>
cnoremap <C-l> <Right>
nnoremap <C-s> :Ack!<Space>
" Navigate quickfix list with ease
nnoremap <silent> [q :cprevious<CR>
nnoremap <silent> ]q :cnext<CR>
nnoremap <S-Tab> <<
noremap <F9> :!%:p<ENTER>
" Don't jump to first match
cnoreabbrev Ack Ack!
" Maps <leader>/ so we're ready to type the search keyword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment