From af9348928c28e9c9c89a9c03ac10c3029848659c Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 2 Feb 2017 13:52:46 +0000 Subject: [PATCH] [WIP] Push all of the ultrahaptics changes! --- Makefile | 4 + awesome/utils.lua | 2 +- bin/qutebrowser | 4 + git/config | 8 +- git/gitk | 62 +++++++++++ mpd/mpd.conf.orig | 30 ++++++ msmtprc | 14 +-- mutt/accounts/office365 | 4 + mutt/hooks | 12 +-- mutt/muttrc | 4 +- mutt/muttrc.orig | 132 ++++++++++++++++++++++++ offlineimap/config | 40 ++++---- offlineimap/utils.py | 23 ++--- pms/rc | 71 +++++++++++++ pms/rc_ | 71 +++++++++++++ qutebrowser/bookmarks/urls | 2 + qutebrowser/keys.conf | 21 ++-- qutebrowser/quickmarks | 1 - vim/ftplugin/cpp.vim | 21 ++-- vim/ultisnips/cpp.snippets | 8 +- vim/vimrc | 8 +- weechat/buffer_autoset.conf | 7 ++ weechat/fifo.conf | 14 +++ weechat/plugins.conf | 34 +++---- weechat/ruby/colorizer.rb | 198 ++++++++++++++++++++++++++++++++++++ weechat/sec.conf | 4 +- xkb/UH-LPT044.xkb | 8 ++ xprofile | 7 +- zshenv | 5 + zshrc | 1 + 30 files changed, 722 insertions(+), 98 deletions(-) create mode 100755 bin/qutebrowser create mode 100644 git/gitk create mode 100644 mpd/mpd.conf.orig create mode 100644 mutt/accounts/office365 create mode 100644 mutt/muttrc.orig create mode 100644 pms/rc create mode 100644 pms/rc_ create mode 100644 qutebrowser/bookmarks/urls create mode 100644 weechat/fifo.conf create mode 100644 weechat/ruby/colorizer.rb create mode 100644 xkb/UH-LPT044.xkb diff --git a/Makefile b/Makefile index 8af2d32..4961cd4 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,10 @@ mpd: systemd systemctl --user start mpd .PHONY: mpd +pms: + ln -sfT $(APATH)/pms ~/.config/pms +.PHONY: pms + ncmpcpp: ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp mkdir -p ~/.local/share/mpd/lyrics diff --git a/awesome/utils.lua b/awesome/utils.lua index 0f12be1..de240de 100644 --- a/awesome/utils.lua +++ b/awesome/utils.lua @@ -71,7 +71,7 @@ function utils.get_default_sink() local f = io.popen('ponymix defaults --short') line = f:read('*l') f:close() - return string.match(line, "^sink%s*%d*%s*(.-)%s") + return string.match(line, "^sink%s*%d*%s*(.-)%s") or "" end function utils.joinTables(t1, t2) diff --git a/bin/qutebrowser b/bin/qutebrowser new file mode 100755 index 0000000..4e4eff6 --- /dev/null +++ b/bin/qutebrowser @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +export QUTE_QTBUG54419_PATCHED=1 +~/src/qutebrowser/qutebrowser.py --backend webengine "$@" diff --git a/git/config b/git/config index 0e41b1f..f641960 100644 --- a/git/config +++ b/git/config @@ -1,6 +1,6 @@ [user] name = Samir Benmendil - email = me@rmz.io + email = samir.benmendil@ultrahaptics.com [color] branch = auto status = auto @@ -31,3 +31,9 @@ autosquash = true [status] submodulesummary = true +[pull] + rebase = interactive +[branch "master"] + rebase = preserve +[branch "develop"] + rebase = preserve diff --git a/git/gitk b/git/gitk new file mode 100644 index 0000000..f109f2e --- /dev/null +++ b/git/gitk @@ -0,0 +1,62 @@ +set mainfont {sans 9} +set textfont {monospace 9} +set uifont {sans 9 bold} +set tabstop 8 +set findmergefiles 0 +set maxgraphpct 50 +set maxwidth 16 +set cmitmode patch +set wrapcomment none +set autoselect 1 +set autosellen 40 +set showneartags 1 +set maxrefs 20 +set visiblerefs {"master"} +set hideremotes 0 +set showlocalchanges 1 +set datetimeformat {%Y-%m-%d %H:%M:%S} +set limitdiffs 1 +set uicolor grey85 +set want_ttk 1 +set bgcolor white +set fgcolor black +set uifgcolor black +set uifgdisabledcolor #999 +set colors {lime red blue magenta darkgrey brown orange} +set diffcolors {red "#00a000" blue} +set mergecolors {red blue lime purple brown "#009090" magenta "#808000" "#009000" "#ff0080" cyan "#b07070" "#70b0f0" "#70f0b0" "#f0b070" "#ff70b0"} +set markbgcolor #e0e0ff +set diffcontext 3 +set selectbgcolor gray85 +set foundbgcolor yellow +set currentsearchhitbgcolor orange +set extdifftool meld +set perfile_attrs 0 +set headbgcolor lime +set headfgcolor black +set headoutlinecolor black +set remotebgcolor #ffddaa +set tagbgcolor yellow +set tagfgcolor black +set tagoutlinecolor black +set reflinecolor black +set filesepbgcolor #aaaaaa +set filesepfgcolor black +set linehoverbgcolor #ffff80 +set linehoverfgcolor black +set linehoveroutlinecolor black +set mainheadcirclecolor yellow +set workingfilescirclecolor red +set indexcirclecolor lime +set circlecolors {white blue gray blue blue} +set linkfgcolor blue +set circleoutlinecolor black +set geometry(main) 1916x1028+0+19 +set geometry(state) normal +set geometry(topwidth) 1916 +set geometry(topheight) 649 +set geometry(pwsash0) "1239 1" +set geometry(pwsash1) "1683 1" +set geometry(botwidth) 802 +set geometry(botheight) 374 +set permviews {} diff --git a/mpd/mpd.conf.orig b/mpd/mpd.conf.orig new file mode 100644 index 0000000..d53f829 --- /dev/null +++ b/mpd/mpd.conf.orig @@ -0,0 +1,30 @@ +# An example configuration file for MPD can be found at: +# /usr/share/doc/mpd/ + +bind_to_address "any" +music_directory "~/music" +playlist_directory "~/.local/share/mpd/playlists" +db_file "~/.local/share/mpd/database" +log_file "~/.local/share/mpd/log" +pid_file "~/.local/share/mpd/pid" +state_file "~/.local/share/mpd/state" +sticker_file "~/.local/share/mpd/sticker.sql" + +<<<<<<< Updated upstream +======= +# input { +# plugin "curl" +# } + +>>>>>>> Stashed changes +audio_output { + type "pulse" + name "My Pulse Output" +} + +audio_output { + type "fifo" + name "fifo" + path "/tmp/mpd.fifo" + format "44100:16:2" +} diff --git a/msmtprc b/msmtprc index cf450a7..06b1295 100644 --- a/msmtprc +++ b/msmtprc @@ -3,17 +3,17 @@ tls on tls_trust_file /etc/ssl/certs/ca-certificates.crt logfile ~/.msmtp/msmtp.log -# gmail -account gmail -host smtp.gmail.com +# office365 +account office365 +host smtp.office365.com port 587 protocol smtp auth on -user samir.benmendil@gmail.com -passwordeval "pass gmail.com/msmtp" +user samir.benmendil@ultrahaptics.com +passwordeval "pass ultrahaptics/office365/samir.benmendil@ultrahaptics.com" # unimaas inherits from gmail -account unimaas : gmail +account unimaas : office365 #set default account -account default : gmail +account default : office365 diff --git a/mutt/accounts/office365 b/mutt/accounts/office365 new file mode 100644 index 0000000..b90ae5c --- /dev/null +++ b/mutt/accounts/office365 @@ -0,0 +1,4 @@ +# vim: ft=muttrc +set realname = "Samir Benmendil" +set from = "samir.benmendil@ultrahaptics.com" +my_hdr Bcc: samir.benmendil@ultrahaptics.com diff --git a/mutt/hooks b/mutt/hooks index f1f39aa..55b0fd7 100644 --- a/mutt/hooks +++ b/mutt/hooks @@ -1,10 +1,10 @@ # vim: ft=muttrc -reply-hook . source ~/.mutt/accounts/gmail +reply-hook . source ~/.mutt/accounts/office365 reply-hook "%L chakra" source ~/.mutt/accounts/chakra reply-hook "%L unimaas" source ~/.mutt/accounts/unimaas reply-hook "%L cadscan" source ~/.mutt/accounts/cadscan -folder-hook . source ~/.mutt/accounts/gmail +folder-hook . source ~/.mutt/accounts/office365 folder-hook chakra source ~/.mutt/accounts/chakra folder-hook unimaas source ~/.mutt/accounts/unimaas folder-hook cadscan source ~/.mutt/accounts/cadscan @@ -13,13 +13,13 @@ folder-hook * "exec collapse-all" # limit inbox to Unread and Flagged mails folder-hook inbox push '=(=U|=F)' -# delete mails older than 3 months -folder-hook inbox push '!~(~U|~F|~d<3m)' +# delete mails older than 3 months +# folder-hook inbox push '!~(~U|~F|~d<3m)' # limit youtube to Unread and Flagged mails -folder-hook youtube push '=(=U|=F)' +# folder-hook youtube push '=(=U|=F)' # delete other mails -folder-hook youtube push '!~(~U|~F)' +# folder-hook youtube push '!~(~U|~F)' # open video in mpv folder-hook * bind index,pager m mail diff --git a/mutt/muttrc b/mutt/muttrc index 6b6fd8d..4fdd496 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -75,10 +75,10 @@ alternative_order text/plain text/enriched text/html # save html for last # IMAP: offlineimap set folder = "~/mail" # mail folder -set spoolfile = "+gmail/inbox" # set inbox +set spoolfile = "+office365/inbox" # set inbox unset record # do not move sent msgs to a folder, gmail does that unset move # do not move read msgs, gmail does that -set postponed = "+gmail/drafts" # drafts folder +set postponed = "+office365/drafts" # drafts folder set header_cache = "~/.cache/mutt" # cache headers for speedss source ~/.mutt/mailboxes # source mailboxes generetated by offlineimap diff --git a/mutt/muttrc.orig b/mutt/muttrc.orig new file mode 100644 index 0000000..666e2dc --- /dev/null +++ b/mutt/muttrc.orig @@ -0,0 +1,132 @@ +# general settings +alternates -group me samir.benmendil@gmail.com ram-z@hotmail.com @rmz.io +alternates -group me -group chakra ram-z@chakra chakra@rmz.io +alternates -group me -group unimaas s.benmendil@student.maastrichtuniversity.nl +alternates -group me -group cadscan sb@cad-scan.co.uk + +set mail_check = 0 +set envelope_from +set forward_format = "Fwd: %s" +set forward_quote = yes + +set edit_headers = yes # more power +set askcc = yes # ask until I have goobook completion in vim +set editor = vim # d'uh +set include = yes # don't ask, just do +set delete = yes # don't ask, just do +set date_format = "!%b %d, %Y at %-H:%M" # use 24-hour clock + +# send clacks +my_hdr X-Clacks-Overhead: GNU Terry Pratchett +my_hdr Bcc: sent@rmz.io + +# goobook +set query_command = "goobook query '%s'" + +# sort/threading +set sort = threads +set sort_aux = last-date-received +set sort_re = yes +set duplicate_threads = yes +set collapse_unread = no + +# lists +subscribe -group chakra ^chakra-.*@googlegroups.com +subscribe -group clementine clementine-player@googlegroups.com +subscribe -group ros @lists.ros.org$ +subscribe -group sailfish @lists.sailfishos.org +subscribe -group neovim ^neovim.*github.com +subscribe -group mutt mutt-users@mutt.org +subscribe -group qutebrowser ^qutebrowser.* +subscribe -group lug @mailman.lug.org.uk + +# performance tuning +set read_inc = 1000 # nb of messages read before printing status +set write_inc = 1000 # nb of messages written before printing status +set time_inc = 100 # time interval (ms) between status print + +# look and feel +set pager_index_lines = 12 +set pager_context = 5 +set pager_stop = yes # don't jump to next message +set resolve = yes # jump when flagging +set menu_scroll = yes +set wrap = 78 +set reflow_wrap = 78 # reflow received format=flowed msgs +set text_flowed = yes # write f=f messages +set smart_wrap = yes # wrap at word boundaries +set tilde = yes # fills end of messages with tilde +set markers = no +set mark_old = no # leave messages as new if unread +set status_on_top = yes # also help on bottom +set wait_key = no # don't wait for enter key +set index_format="[%Z] %{%e/%m} %15.15L %?M?+ ?%s" + +# header +ignore * +unignore from: to: cc: date: subject: x-clacks-overhead: +unhdr_order * +hdr_order from: to: cc: date: subject: x-clacks-overhead: + +# deal with crap +set mailcap_path = ~/.mutt/mailcap +auto_view text/html # view html automatically +alternative_order text/plain text/enriched text/html # save html for last + +# IMAP: offlineimap +set folder = "~/mail" # mail folder +set spoolfile = "+office365/inbox" # set inbox +unset record # do not move sent msgs to a folder, gmail does that +unset move # do not move read msgs, gmail does that +set postponed = "+office365/drafts" # drafts folder +set header_cache = "~/.cache/mutt" # cache headers for speedss +source ~/.mutt/mailboxes # source mailboxes generetated by offlineimap + +<<<<<<< Updated upstream +# SMTP: msmtp +set sendmail = /usr/bin/msmtp # use msmtp +set send_charset="utf-8" # only utf8 +======= +# IMAP: ultrahaptics +# source "printf 'set my_uhpass=\"%s\"' $(pass ultrahaptics/office365/samir.benmendil@ultrahaptics.com) |" +# set imap_user="samir.benmendil@ultrahaptics.com" +# set imap_pass=$my_uhpass +# set folder="imaps://outlook.office365.com:993" +# set spoolfile = +INBOX +# set header_cache=~/.cache/mutt +# set message_cachedir=~/.cache/mutt +# set ssl_use_sslv3=yes +# set ssl_force_tls=yes +# set ssl_starttls=yes + +# mailboxes + +# # IMAP: offlineimap +# set folder = "~/mail" # mail folder +# set spoolfile = "+gmail/inbox" # set inbox +# unset record # do not move sent msgs to a folder, gmail does that +# unset move # do not move read msgs, gmail does that +# set postponed = "+gmail/drafts" # drafts folder +# set header_cache = "~/.cache/mutt" # cache headers for speedss +# source ~/.mutt/mailboxes # source mailboxes generetated by offlineimap + +# SMTP: msmtp (with queue) +set sendmail = ~/.msmtp/msmtpq # use msmtp message queue +set sendmail_wait = -1 # fork sendmail to the background +set send_charset="us-ascii:utf-8" # only use ascii and utf8 +>>>>>>> Stashed changes + +# GnuPG +set crypt_autosign = yes # autosign messages +set crypt_replyencrypt = yes # encrypt replies to encrypted messages +set crypt_replysign = yes # sign replies to signed messages +set crypt_replysignencrypted = yes # you get the idea +set crypt_verify_sig = yes # verify signatures +set pgp_long_ids = yes # use 64 bit key IDs +set pgp_mime_auto = no # don't fallback to inline mime +set pgp_use_gpg_agent = yes # don't ask for passwords +source /usr/share/doc/mutt/samples/gpg.rc + +source ~/.mutt/hooks +source ~/.mutt/bindings +source ~/.mutt/colors/badfox # color theme diff --git a/offlineimap/config b/offlineimap/config index 4b63ed6..ca1a8b1 100644 --- a/offlineimap/config +++ b/offlineimap/config @@ -1,6 +1,6 @@ [general] metadata = $XDG_DATA_HOME/offlineimap -accounts = gmail +accounts = office365 maxsyncaccounts = 1 #ui = basic #ignore-readonly = no @@ -18,9 +18,9 @@ footer = "\n" # sort_keyfunc = lambda d: (d['accountname'], d['foldername']) sort_keyfunc = sort_key -[Account gmail] -localrepository = gmail-local -remoterepository = gmail-remote +[Account office365] +localrepository = office365-local +remoterepository = office365-remote autorefresh = 10 quick = -1 # presynchook = imapfilter @@ -29,31 +29,29 @@ quick = -1 status_backend = sqlite # maxsize = 2000000 # maxage = 10 -#maildir-windows-compatible = no -synclabels = yes -labelsheader = X-Label -filterheaders = X-Label -#ignorelabels = \Inbox, \Starred, \Sent, \Draft, \Spam, \Trash, \Important -ignorelabels = \Draft, \Important -[Repository gmail-local] -type = GmailMaildir -localfolders = ~/mail/gmail +[Repository office365-local] +type = Maildir +localfolders = ~/mail/office365 #sep = . #restoreatime = no nametrans = translocal -[Repository gmail-remote] -type = Gmail -remoteuser = samir.benmendil@gmail.com +[Repository office365-remote] +type = IMAP +remotehost = outlook.office365.com +remoteuser = samir.benmendil@ultrahaptics.com +# remotepasseval = nametrans = transremote -# folderfilter = lambda foldername: foldername in ['[Google Mail]/All Mail', '[Google Mail]/Drafts', '[Google Mail]/Bin'] +folderfilter = lambda foldername: foldername in mapping +# folderfilter = lambda foldername: foldername in ['Archive', 'INBOX', 'Drafts', 'Sent', 'Junk Email', 'Deleted Items'] sslcacertfile = /etc/ssl/certs/ca-certificates.crt -trashfolder = '[Google Mail]/Bin' -spamfolder = '[Google Mail]/Spam' -usecompression = yes +# trashfolder = '[Google Mail]/Bin' +# spamfolder = '[Google Mail]/Spam' +# usecompression = yes maxconnections = 3 holdconnectionopen = yes keepalive = 60 -auth_mechanisms = GSSAPI, CRAM-MD5, PLAIN, LOGIN +# auth_mechanisms = GSSAPI, CRAM-MD5, PLAIN, LOGIN +#TODO (sb:20170113) # readonly = True diff --git a/offlineimap/utils.py b/offlineimap/utils.py index 5b6976c..5396cd4 100644 --- a/offlineimap/utils.py +++ b/offlineimap/utils.py @@ -1,11 +1,9 @@ -mapping = { 'INBOX': 'inbox' - , '[Google Mail]/All Mail': 'archive' - , '[Google Mail]/Drafts': 'drafts' - , '[Google Mail]/Important': 'important' - , '[Google Mail]/Sent Mail': 'sent' - , '[Google Mail]/Spam': 'spam' - , '[Google Mail]/Starred': 'flagged' - , '[Google Mail]/Bin': 'bin' +mapping = { 'INBOX': 'inbox' + , 'Archive': 'archive' + , 'Drafts': 'drafts' + , 'Sent': 'sent' + , 'Junk Email': 'spam' + , 'Deleted Items': 'bin' } r_mapping = { val: key for key, val in mapping.items() } @@ -16,14 +14,7 @@ def transremote(foldername): def translocal(foldername): return r_mapping.get(foldername, foldername) -top = [ 'inbox' - , 'flagged' - , 'chakra' - , 'unimaas' - , 'clementine' - , 'youtube' - , 'hotmail' - ] +top = [ 'inbox' ] bot = [ 'archive' , 'drafts' diff --git a/pms/rc b/pms/rc new file mode 100644 index 0000000..3e23559 --- /dev/null +++ b/pms/rc @@ -0,0 +1,71 @@ +set scroll=centered +set startuplist=Queue +set columns=artist track title album year length +set nomouse +set followwindow + +color fields.track cyan +color headers brightgray + +unbind all + +bind : command-mode +bind x rehash +bind ^A select . +bind up move-up +bind down move-down +bind k move-up +bind j move-down +bind pageup move-pgup +bind pagedown move-pgdn +bind home move-home +bind end move-end +bind ^E scroll-down +bind ^Y scroll-up +bind left prev-window +bind right next-window +bind J move 1 +bind K move -1 +bind insert toggle-select +bind return play +bind p pause +bind backspace stop +bind a add +bind A add-to +bind delete remove +bind h next +bind t prev + +bind space toggle-play +bind B play-album +bind b add-album +bind R goto-random +bind S add-random +bind ( prev-of album +bind ) next-of album +bind [ prev-of artist +bind ] next-of artist + +bind / quick-find +bind ^F filter +bind ^G clear-filters +bind n next-result +bind u update +bind U update thisdir +bind g goto-current +bind i info +bind - volume -5 +bind + volume +5 +bind M mute +bind 8 seek -5 +bind 9 seek 5 +bind r repeat + +bind 1 change-window playlist +bind 2 change-window library +bind w change-window windowlist +bind F12 activate-list +bind ^X delete-list +bind tab last-window + +bind ^D quit diff --git a/pms/rc_ b/pms/rc_ new file mode 100644 index 0000000..3e23559 --- /dev/null +++ b/pms/rc_ @@ -0,0 +1,71 @@ +set scroll=centered +set startuplist=Queue +set columns=artist track title album year length +set nomouse +set followwindow + +color fields.track cyan +color headers brightgray + +unbind all + +bind : command-mode +bind x rehash +bind ^A select . +bind up move-up +bind down move-down +bind k move-up +bind j move-down +bind pageup move-pgup +bind pagedown move-pgdn +bind home move-home +bind end move-end +bind ^E scroll-down +bind ^Y scroll-up +bind left prev-window +bind right next-window +bind J move 1 +bind K move -1 +bind insert toggle-select +bind return play +bind p pause +bind backspace stop +bind a add +bind A add-to +bind delete remove +bind h next +bind t prev + +bind space toggle-play +bind B play-album +bind b add-album +bind R goto-random +bind S add-random +bind ( prev-of album +bind ) next-of album +bind [ prev-of artist +bind ] next-of artist + +bind / quick-find +bind ^F filter +bind ^G clear-filters +bind n next-result +bind u update +bind U update thisdir +bind g goto-current +bind i info +bind - volume -5 +bind + volume +5 +bind M mute +bind 8 seek -5 +bind 9 seek 5 +bind r repeat + +bind 1 change-window playlist +bind 2 change-window library +bind w change-window windowlist +bind F12 activate-list +bind ^X delete-list +bind tab last-window + +bind ^D quit diff --git a/qutebrowser/bookmarks/urls b/qutebrowser/bookmarks/urls new file mode 100644 index 0000000..68fa878 --- /dev/null +++ b/qutebrowser/bookmarks/urls @@ -0,0 +1,2 @@ +https://ultrahaptics.atlassian.net/secure/Dashboard.jspa JIRA +http://uhbuild.cloudapp.net:8111/project.html?projectId=SensationEditor&branch_SensationEditor=__all_branches__ TeamCity - Sensation Editor diff --git a/qutebrowser/keys.conf b/qutebrowser/keys.conf index b635a97..fc53584 100644 --- a/qutebrowser/keys.conf +++ b/qutebrowser/keys.conf @@ -46,9 +46,6 @@ leave-mode [normal] # Keybindings for normal mode. -clear-keychain ;; search - - set-cmd-text -s :open o @@ -253,9 +250,6 @@ open -w -- {clipboard} open -w -- {primary} wP -quickmark-save - m - set-cmd-text -s :quickmark-load b @@ -265,9 +259,6 @@ set-cmd-text -s :quickmark-load -t set-cmd-text -s :quickmark-load -w wb -bookmark-add - M - set-cmd-text -s :bookmark-load gb @@ -451,6 +442,18 @@ record-macro run-macro @ +spawn mpv {url} + m + +hint links spawn mpv {url} + M + +clear-keychain ;; search ;; fake-key + + +clear-keychain ;; search + + [insert] # Keybindings for insert mode. # Since normal keypresses are passed through, only special keys are diff --git a/qutebrowser/quickmarks b/qutebrowser/quickmarks index 8b13789..e69de29 100644 --- a/qutebrowser/quickmarks +++ b/qutebrowser/quickmarks @@ -1 +0,0 @@ - diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index 7631f49..82e3170 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -16,22 +16,23 @@ let b:load_doxygen_syntax = 1 augroup fswitch au BufEnter *.h let b:fswitchdst = 'cpp,c' - au BufEnter *.h let b:fswitchlocs = 'reg:|include.*|source|' + au BufEnter *.h let b:fswitchlocs = 'reg:|include.*|src|' au BufEnter *.cpp let b:fswitchdst = 'hpp,h' - au BufEnter *.cpp let b:fswitchlocs = 'reg:|source|include/**|' + au BufEnter *.cpp let b:fswitchlocs = 'reg:|src|include/**|' augroup END nnoremap gd :YcmCompleter GoTo nnoremap d :vs:YcmCompleter GoTo setlocal foldmethod=syntax +setlocal foldlevel=99 " set foldlevel according to number of matches of 'namespace' and 'class' not " containing ';' -function! InitialFoldLevel() - let v:errmsg = "" - keepjumps keeppatterns silent! 1,/}/s/^\(namespace\|class\) \+[^;]*$//n - if v:errmsg == "" - let &foldlevel=str2nr(split(v:statusmsg)[0]) - endif -endf -call InitialFoldLevel() +" function! InitialFoldLevel() +" let v:errmsg = "" +" keepjumps keeppatterns silent! 1,/}/s/^\(namespace\|class\) \+[^;]*$//n +" if v:errmsg == "" +" let &foldlevel=str2nr(split(v:statusmsg)[0]) +" endif +" endf +" call InitialFoldLevel() diff --git a/vim/ultisnips/cpp.snippets b/vim/ultisnips/cpp.snippets index c98a71b..4159d06 100644 --- a/vim/ultisnips/cpp.snippets +++ b/vim/ultisnips/cpp.snippets @@ -6,7 +6,7 @@ snippet inc "#include <>" b endsnippet snippet Inc "#include \'\'" b -#include "${1:`!p snip.rv = snip.basename+".h"`}" +#include "${1:`!p snip.rv = snip.basename+".hpp"`}" endsnippet snippet cl "class .. (class)" b @@ -100,3 +100,9 @@ auto ${1:alias}(Args&&... args) return ${2:function}(std::forward(args)...); } endsnippet + +snippet uhc "Ultrahaptics Copyright" b +/****************************************************************************** + * Copyright : `date +%Y` Ultrahaptics * + ******************************************************************************/ +endsnippet diff --git a/vim/vimrc b/vim/vimrc index 90fbf5d..9b5c202 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -74,6 +74,7 @@ Plugin 'derekwyatt/vim-protodef' " Check LucHermites plugins: https://github.com/LucHermitte/lh-cpp Plugin 'wincent/loupe' Plugin 'Ram-Z/vimwiki' +Plugin 'alepez/vim-gtest' call vundle#end() @@ -607,6 +608,7 @@ let g:tagbar_iconchars = ['+', '-'] " tcomments {{{2 let g:tcommentTextObjectInlineComment = 'gic' +" let g:tcommentOptions = { 'whitespace' : 'no' } " ultisnips {{{2 let g:UltiSnipsEditSplit = 'vertical' @@ -701,7 +703,11 @@ function! YRRunAfterMaps() endfunction " youcompleteme {{{2 -let g:ycm_extra_conf_globlist = ['~/src/*','/mnt/data/src/*'] +let g:ycm_extra_conf_globlist = [ + \ '~/src/*', + \ '/mnt/data/src/*', + \ '/mnt/common/src/*' + \ ] let g:ycm_global_ycm_extra_conf = expand('$XDG_CONFIG_HOME/vim/ycm_extra_conf.py') let g:ycm_extra_conf_vim_data = ['getcwd()'] let g:ycm_add_preview_to_completeopt = 1 diff --git a/weechat/buffer_autoset.conf b/weechat/buffer_autoset.conf index 0cc0b92..519613c 100644 --- a/weechat/buffer_autoset.conf +++ b/weechat/buffer_autoset.conf @@ -1,6 +1,13 @@ # # weechat -- buffer_autoset.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [look] instant = on diff --git a/weechat/fifo.conf b/weechat/fifo.conf new file mode 100644 index 0000000..904985d --- /dev/null +++ b/weechat/fifo.conf @@ -0,0 +1,14 @@ +# +# weechat -- fifo.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# + +[file] +enabled = on +path = "%h/weechat_fifo" diff --git a/weechat/plugins.conf b/weechat/plugins.conf index d640621..aa4de52 100644 --- a/weechat/plugins.conf +++ b/weechat/plugins.conf @@ -6,15 +6,6 @@ fifo.fifo = "on" guile.check_license = "off" lua.check_license = "off" -lua.matrix.autojoin_on_invite = "on" -lua.matrix.backlog_lines = "120" -lua.matrix.debug = "off" -lua.matrix.encrypted_message_color = "lightgreen" -lua.matrix.homeserver_url = "https://matrix.org/" -lua.matrix.local_echo = "on" -lua.matrix.password = "" -lua.matrix.typing_notices = "on" -lua.matrix.user = "" perl.beep.beep_command_dcc = "$bell" perl.beep.beep_command_highlight = "$bell" perl.beep.beep_command_pv = "$bell" @@ -76,18 +67,18 @@ python.slack_extension.switch_buffer_on_join = "1" python.slack_extension.trigger_value = "0" python.slack_extension.unfurl_ignore_alt_text = "0" ruby.check_license = "off" +ruby.colorizer.buffer_regex = "" +ruby.colorizer.rule.0 = "" +ruby.colorizer.rule.1 = "" +ruby.colorizer.rule.2 = "" +ruby.colorizer.rule.3 = "" +ruby.colorizer.rule.4 = "" +ruby.colorizer.rule.8 = "Succeeded/lightgreen" +ruby.colorizer.rule.9 = "Failed/lightred" +ruby.colorizer.rule.count = "10" tcl.check_license = "off" [desc] -lua.matrix.autojoin_on_invite = "Automatically join rooms you are invited to (default: "on")" -lua.matrix.backlog_lines = "Number of lines to fetch from backlog upon connecting (default: "120")" -lua.matrix.debug = "Print a lot of extra information to help with finding bugs and other problems. (default: "off")" -lua.matrix.encrypted_message_color = "Print encrypted mesages with this color (default: "lightgreen")" -lua.matrix.homeserver_url = "Full URL including port to your homeserver (including trailing slash) or use default matrix.org (default: "https://matrix.org/")" -lua.matrix.local_echo = "Print lines locally instead of waiting for return from server (default: "on")" -lua.matrix.password = "Your homeserver password (default: "")" -lua.matrix.typing_notices = "Send typing notices when you type (default: "on")" -lua.matrix.user = "Your homeserver username (default: "")" perl.beep.beep_command_dcc = "command for beep on dcc, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")" perl.beep.beep_command_highlight = "command for beep on highlight, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")" perl.beep.beep_command_pv = "command for beep on private message, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")" @@ -114,3 +105,10 @@ python.screen_away.interval = "How often in seconds to check screen status" python.screen_away.message = "Away message" python.screen_away.set_away = "Set user as away." python.screen_away.time_format = "time format append to away message" +ruby.colorizer.buffer_regex = "Only colorize text in buffers with names that match this regex. Leaving this empty matches all buffer names." +ruby.colorizer.rule.0 = "A colorizing rule of the form: / Empty rules are ignored." +ruby.colorizer.rule.1 = "A colorizing rule of the form: / Empty rules are ignored." +ruby.colorizer.rule.2 = "A colorizing rule of the form: / Empty rules are ignored." +ruby.colorizer.rule.3 = "A colorizing rule of the form: / Empty rules are ignored." +ruby.colorizer.rule.4 = "A colorizing rule of the form: / Empty rules are ignored." +ruby.colorizer.rule.count = "The maximum number of rules to look for in your config." diff --git a/weechat/ruby/colorizer.rb b/weechat/ruby/colorizer.rb new file mode 100644 index 0000000..21c15bb --- /dev/null +++ b/weechat/ruby/colorizer.rb @@ -0,0 +1,198 @@ +# vim: set noet nosta sw=4 ts=4 : +# +# Colorizer +# Michael B. Hix +# http://code.hix.io/projects/colorizer +# +# Color certain parts of text in certain buffers based on rules. +# + +# +# Options: +# +# plugins.var.ruby.colorizer.buffer_regex +# Buffers with names matching this regex are colorized. All buffers are +# colorized if this option is empty. +# +# plugins.var.ruby.colorizer.rule.count +# This is the maximum number of rules to load. +# +# plugins.var.ruby.colorizer.rule.X +# X is zero or a positive integer. Rules are strings consisting of a regular +# expression followed immediately by a slash and a Weechat color name. The +# regular expressions are case-insensitive. +# +# Text matching the regular expression is colored with the given color. The +# last match "wins" and overlapping matches are not detected. +# +# For example: "strelka|mongrel2/lightgreen" +# + +# +# Changelog: +# +# 0.1: Initial release. +# + +SCRIPT_NAME = 'colorizer' +SCRIPT_AUTHOR = 'Michael B. Hix' +SCRIPT_DESC = 'Colorize text in buffers based on rules.' +SCRIPT_VERSION = '0.1' +SCRIPT_LICENSE = 'BSD' + +# A default coloring rule. +# +DEFAULT_RULE = { + :value => '', + :description => 'A colorizing rule of the form: / Empty rules are ignored.', +}.freeze + +# Configuration defaults are supplied and set for the user if they're not already set. +# +DEFAULTS = { + 'rule.0' => DEFAULT_RULE, + 'rule.1' => DEFAULT_RULE, + 'rule.2' => DEFAULT_RULE, + 'rule.3' => DEFAULT_RULE, + 'rule.4' => DEFAULT_RULE, + 'rule.count' => { + :value => 10, + :description => 'The maximum number of rules to look for in your config.', + }, + 'buffer_regex' => { + :value => '', + :description => 'Only colorize text in buffers with names that match this regex. Leaving this empty matches all buffer names.', + }, +}.freeze + +######################################################################## +### I N I T +######################################################################## + +def weechat_init + Weechat.register SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, '', '' + + Weechat.hook_modifier( 'weechat_print', 'colorize_cb', '' ) + + DEFAULTS.each_pair do |option, opts| + value = opts[:value] + description = opts[:description] + + cur_value = Weechat.config_get_plugin( option ) + + if cur_value.nil? || cur_value.empty? + Weechat.config_set_plugin( option, value.to_s ) + end + + Weechat.config_set_desc_plugin( option, description ) + end + + parse_config + + Weechat.hook_config( "plugins.var.ruby.#{SCRIPT_NAME}.*", 'config_cb', '' ) + + return Weechat::WEECHAT_RC_OK +end + +################################################################################ +### U T I L I T I E S +################################################################################ + +# Provide a way to print legible stack traces. +# +def pp_error( e, message = '' ) + return unless e.is_a? Exception + unless message.nil? or message.empty? + Weechat.print( '', '%s%s' % [Weechat.prefix('error'), message] ) + end + Weechat.print( '', '%s%s: %s' % [Weechat.prefix( 'error' ), SCRIPT_NAME, e.to_s] ) + e.backtrace.each do |line| + Weechat.print( '', '%s%s' % [Weechat.prefix( 'error' ), line] ) + end +end + +# Re-build rules and any regular expressions when the config changes. +# +def parse_config + rules = {} + count = Weechat::config_get_plugin( 'rule.count' ).to_i || + DEFAULTS['rule.count'] + + count.times do |i| + key = "rule.#{i}" + next unless Weechat::config_is_set_plugin( key ) + + conf = Weechat::config_get_plugin( key ) + regex,color,_ = conf.split( /(? e + pp_error( e, 'There was a problem with rule %d:' % [i] ) + end + end + + @rules = rules + + begin + @buffer_regex = /#{Weechat::config_get_plugin( 'buffer_regex' )}/i + rescue Exception => e + pp_error( e, 'There was a problem with buffer_regex:' ) + end +end + +################################################################################ +### C A L L B A C K S +################################################################################ + +# Handle configuration changes. +# +def config_cb( data, option, value ) + parse_config + return Weechat::WEECHAT_RC_OK +end + +# Handle message printing. +# +def colorize_cb( data, modifier, modifier_data, message ) + _,buffer,_ = modifier_data.split( ';' ) + return message unless @buffer_regex =~ buffer + + reset = Weechat.color( 'reset' ) + @rules.each do |reg, color_str| + color = Weechat.color( color_str ) + message.gsub!( reg, '%s\1%s' % [color,reset] ) + end + + return message +end + +__END__ +__LICENSE__ + +Copyright (c) 2014 Michael B. Hix +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/weechat/sec.conf b/weechat/sec.conf index 230b2ce..1ff0785 100644 --- a/weechat/sec.conf +++ b/weechat/sec.conf @@ -10,5 +10,5 @@ salt = on [data] __passphrase__ = on -slack_se = "84E589F23F2A92ECC0B106866E51234769E82F6F27E093557A41CECF4C24B004645F52AED4F9F2B5E3BD37CE1C9C1F1EDEDE91A9347EA7CD6DB116F201122AD372F52A28D8CD63A88B5F1FC2340C563814206D02893B4F9445EE07FCAE211499834217525BD357F201A981DA03967F5EDA39" -slack_uh = "D58D59EC51F61E70E8C8D1600D9BD773A345B6EB01339C964888B636CA68949C8AE6D1C8ABD678C3B0A28D3FB2A3838D6FB3EFB85FBB0D1A2839AB3D2F8BC2ADEF13EC3A5CD4CCBDA89060B62D6460420B4553AFB3291C65CE4D702AC3F8BB6D6C53CEE13B1C513B68ABADD0E3EBB7311D" +slack_se = "D04F44D1B69D62C75D70B87C8FF3C940ED19027608EE2F24879036D7BDC7887A608F7D73A1C7FCAF4C9814A5ED21F9C291160C9FDC8B713BA5137B6A991930836FEBD5E53C7A7763661DBC5DE9B6534841E0033A4F59A32597B295B539E7310DDA4D92517A8905CFC286EC56FBE1390EB469" +slack_uh = "E2C26B52BC4164E150E9FD36933AE610082901AF835C9EF96C09C6946CB0F26A1B153589B9E306422CD2BF508D51BAB0EAD7AAF8C8CDDC642988B8768F7A5DA8FFCE65128F12964C4EA0080076F58297AA4DE4B4602914CF728D2ED088AD79D409D38BBAB07950146288BD81C003110496" diff --git a/xkb/UH-LPT044.xkb b/xkb/UH-LPT044.xkb new file mode 100644 index 0000000..406f349 --- /dev/null +++ b/xkb/UH-LPT044.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { include "evdev" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+inet(evdev)+dvorak+dvorak(kinesis)" }; + //xkb_symbols { include "pc+inet(evdev)+dvorak+dvorak(applealu_iso)" }; + xkb_geometry { include "pc(pc105)" }; +}; diff --git a/xprofile b/xprofile index 590f7e2..74bcde1 100644 --- a/xprofile +++ b/xprofile @@ -3,11 +3,14 @@ export URXVT_PERL_LIB="$HOME/src/dotfiles/urxvt/perls:$HOME/src/dotfiles/urxvt/autocomplete-ALL-the-things" urxvtd -q -o & start-pulseaudio-x11 + +xrandr --output DP-1 --primary --auto --output DP-2 --auto --right-of DP-1 --output eDP-1 --off + compton --config ~/.config/compton.conf & xautolock -detectsleep \ -notify 600 -notifier "xset dpms force off" \ - -time 20 -locker "i3lock -nc 000000" \ - -killtime 70 -killer "systemctl suspend" & + -time 20 -locker "i3lock -nc 000000" & + # -killtime 70 -killer "systemctl suspend" & unclutter --timeout 1 & [[ -f "$XDG_CONFIG_HOME/xbindkeys/$(hostname)" ]] && xbindkeys --file $XDG_CONFIG_HOME/xbindkeys/$(hostname) xkbcomp -I$HOME/.config/xkb $HOME/.config/xkb/$(hostname).xkb $DISPLAY diff --git a/zshenv b/zshenv index b3ce2e5..c4e0c84 100644 --- a/zshenv +++ b/zshenv @@ -44,8 +44,13 @@ export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer" # pass export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" +# HiDPI support for Qt applications +# export QT_AUTO_SCREEN_SCALE_FACTOR=1 + # SSH Agent export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" # weechat export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat" + +export MAKEFLAGS="-j$(nproc --all --ignore=2)" diff --git a/zshrc b/zshrc index cc53e35..8577db7 100644 --- a/zshrc +++ b/zshrc @@ -57,6 +57,7 @@ hash -d chroot_master=/buildsystem/master/buildroot hash -d chroot_lib32=/buildsystem/lib32/buildroot hash -d wineprefixes=/mnt/data/wineprefixes hash -d UniMaas=~/dropbox/Documents/UniMaas +[[ -d /mnt/common ]] && hash -d common=/mnt/common # set some env variables export _gamedir=/mnt/Skaro/Games/Linux/HumbleBundle -- 2.48.1