From 2f254e8c7f564f246190f48372b4c317651ce764 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sun, 26 Nov 2017 15:41:07 +0700 Subject: Update 2017-11-26 --- awesome/.config/awesome/rc.lua | 16 ++++----- dev/.gitconfig | 6 ++-- meta/.Xdefaults | 24 ------------- meta/.Xresources | 24 +++++++++++++ meta/.bashrc | 1 - meta/.mailcap | 69 ++++++++++++++++++++++++++++++++++++ meta/.xinitrc | 5 ++- vim/.vim/after/ftplugin/cpp.vim | 3 ++ vim/.vim/after/ftplugin/markdown.vim | 4 +++ vim/.vim/after/ftplugin/python.vim | 6 ++++ vim/.vim/ftplugin/cpp.vim | 3 -- vim/.vim/ftplugin/markdown.vim | 4 --- vim/.vim/ftplugin/python/python.vim | 6 ---- 13 files changed, 120 insertions(+), 51 deletions(-) delete mode 100644 meta/.Xdefaults create mode 100644 meta/.Xresources create mode 100644 meta/.mailcap create mode 100644 vim/.vim/after/ftplugin/cpp.vim create mode 100644 vim/.vim/after/ftplugin/markdown.vim create mode 100755 vim/.vim/after/ftplugin/python.vim delete mode 100644 vim/.vim/ftplugin/cpp.vim delete mode 100644 vim/.vim/ftplugin/markdown.vim delete mode 100755 vim/.vim/ftplugin/python/python.vim diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index 4c762a4..39f9428 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -46,15 +46,15 @@ end beautiful.init("~/.config/awesome/themes/gruvbox/theme.lua") -- This is used later as the default terminal and editor to run. -terminal = "x-terminal-emulator" +terminal = "x-terminal-emulator -e dvtm" editor = "gvim" -- And some additional applications -root_terminal = terminal .. " -e su -" -ranger = terminal .. " -e ranger" -python = terminal .. " -e python3" -guile = terminal .. " -e guile" -mutt = terminal .. " -e mutt" -cmus = terminal .. " -e cmus" +root_terminal = "x-terminal-emulator -e su --login --command dvtm" +ranger = "x-terminal-emulator -e ranger" +python = "x-terminal-emulator -e python3" +guile = "x-terminal-emulator -e guile" +mutt = "x-terminal-emulator -e mutt" +cmus = "x-terminal-emulator -e cmus" cmus_pause = "cmus-remote --pause" cmus_prev = "cmus-remote --prev" cmus_next = "cmus-remote --next" @@ -66,7 +66,6 @@ function volume_lower() awful.spawn("amixer sset Master 5%-", false) end function volume_raise() awful.spawn("amixer sset Master 5%+", false) end function volume_mute() awful.util.spawn("amixer sset Master toggle", false) end - -- Default modkey. -- Usually, Mod4 is the key with a logo between Control and Alt. -- If you do not like this or do not have such a key, @@ -152,7 +151,6 @@ vicious.register(mycpuusage, vicious.widgets.cpu, end, 2) -- Create memory usage widgets -vicious.cache(vicious.widgets.mem) mymemusage = wibox.widget.textbox() -- RAM vicious.register(mymemusage, vicious.widgets.mem, function(widget, args) diff --git a/dev/.gitconfig b/dev/.gitconfig index 8cf14e9..71f101b 100644 --- a/dev/.gitconfig +++ b/dev/.gitconfig @@ -1,9 +1,9 @@ [user] email = vn.mcsinyx@gmail.com - name = Raphael McSinyx + name = Nguyễn Gia Phong [diff] - tool = vimdif - guitool = gvimdif + tool = vimdiff + guitool = gvimdiff [github] user = McSinyx diff --git a/meta/.Xdefaults b/meta/.Xdefaults deleted file mode 100644 index 6efc901..0000000 --- a/meta/.Xdefaults +++ /dev/null @@ -1,24 +0,0 @@ -*background: #fbf1c7 -*foreground: #3c3836 -*color0: #fbf1c7 -*color1: #cc241d -*color2: #98971a -*color3: #d79921 -*color4: #458588 -*color5: #b16286 -*color6: #689d6a -*color7: #a89984 -*color8: #928374 -*color9: #9d0006 -*color10: #79740e -*color11: #b57614 -*color12: #076678 -*color13: #8f3f71 -*color14: #427b58 -*color15: #3c3836 -UXTerm*faceName: Space Mono:size=9.5 -UXTerm*loginShell: true -UXTerm*scrollBar: false -UXTerm*saveLines: 1024 -UXTerm*cursorBlink: false -UXTerm*jumpScroll: true diff --git a/meta/.Xresources b/meta/.Xresources new file mode 100644 index 0000000..6efc901 --- /dev/null +++ b/meta/.Xresources @@ -0,0 +1,24 @@ +*background: #fbf1c7 +*foreground: #3c3836 +*color0: #fbf1c7 +*color1: #cc241d +*color2: #98971a +*color3: #d79921 +*color4: #458588 +*color5: #b16286 +*color6: #689d6a +*color7: #a89984 +*color8: #928374 +*color9: #9d0006 +*color10: #79740e +*color11: #b57614 +*color12: #076678 +*color13: #8f3f71 +*color14: #427b58 +*color15: #3c3836 +UXTerm*faceName: Space Mono:size=9.5 +UXTerm*loginShell: true +UXTerm*scrollBar: false +UXTerm*saveLines: 1024 +UXTerm*cursorBlink: false +UXTerm*jumpScroll: true diff --git a/meta/.bashrc b/meta/.bashrc index 93593d4..fcb265e 100644 --- a/meta/.bashrc +++ b/meta/.bashrc @@ -102,7 +102,6 @@ alias fpc='fpc -O1 -XS -gl' alias mpa='mpv --no-video --loop=inf' alias mount='udevil mount' alias umount='udevil umount' -alias x='cd ~ && startx' alias flare='cd ~/.local/flare-game/ && ./flare && cd -' TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1)); history -r' if [ -f ~/.bash_aliases ]; then diff --git a/meta/.mailcap b/meta/.mailcap new file mode 100644 index 0000000..b54b674 --- /dev/null +++ b/meta/.mailcap @@ -0,0 +1,69 @@ +# Example mailcap file for Reddit Terminal Viewer +# https://github.com/michael-lazar/rtv/ +# +# Copy the contents of this file to {HOME}/.mailcap, or point to using $MAILCAPS +# Then launch RTV using the --enable-media flag. All shell commands defined in +# this file depend on external programs that must be installed on your system. +# +# HELP REQUESTED! If you come up with your own commands (especially for OS X) +# and would like to share, please post an issue on the GitHub tracker and we +# can get them added to this file as references. +# +# +# Mailcap 101 +# - The first entry with a matching MIME type will be executed, * is a wildcard +# - %s will be replaced with the image or video url +# - Add ``test=test -n "$DISPLAY"`` if your command opens a new window +# - Add ``needsterminal`` for commands that use the terminal +# - Add ``copiousoutput`` for commands that dump text to stdout + +############################################################################### +# Commands below this point will open media in a separate window without +# pausing execution of RTV. +############################################################################### + +# Feh is a simple and effective image viewer +# Note that rtv returns a list of urls for imgur albums, so we don't put quotes +# around the `%s` +image/x-imgur-album; feh %s; test=test -n "$DISPLAY" +image/gif; mpv '%s' --loop=inf; test=test -n "$DISPLAY" +#image/*; feh '%s'; test=test -n "$DISPLAY" + +# Youtube videos are assigned a custom mime-type, which can be streamed with +# vlc or youtube-dl. +video/x-youtube; mpv '%s'; test=test -n "$DISPLAY" + +# Mpv is a simple and effective video streamer +video/*; mpv '%s' --loop=inf; test=test -n "$DISPLAY" + +############################################################################### +# Commands below this point will attempt to display media directly in the +# terminal when X is not available. +############################################################################### + +# View images directly in your terminal with iTerm2 +# curl -L https://iterm2.com/misc/install_shell_integration_and_utilities.sh | bash +# image/*; curl -s %s | ~/.iterm2/imgcat && read -n 1; needsterminal + +# View true images in the terminal, supported by rxvt-unicode, xterm and st +# Requires the w3m-img package +image/*; w3m -o 'ext_image_viewer=off' '%s'; needsterminal + +# Don't have a solution for albums yet +image/x-imgur-album; echo + +# 256 color images using half-width unicode characters +# Much higher quality that img2txt, but must be built from source +# https://github.com/rossy/img2xterm +image/*; curl -s '%s' | convert -resize 80x80 - jpg:/tmp/rtv.jpg && img2xterm /tmp/rtv.jpg; needsterminal; copiousoutput + +# Display images in classic ascii using img2txt and lib-caca +image/*; curl -s '%s' | convert - jpg:/tmp/rtv.jpg && img2txt -f utf8 /tmp/rtv.jpg; needsterminal; copiousoutput + +# Full motion videos - requires a framebuffer to view +video/x-youtube; mpv -vo drm -quiet '%s'; needsterminal +video/*; mpv -vo drm -quiet '%s'; needsterminal + +# Ascii videos +# video/x-youtube; youtube-dl -q -o - '%s' | mplayer -cache 8192 -vo caca -quiet -; needsterminal +# video/*; wget '%s' -O - | mplayer -cache 8192 -vo caca -quiet -; needsterminal diff --git a/meta/.xinitrc b/meta/.xinitrc index 7aefafb..296c708 100644 --- a/meta/.xinitrc +++ b/meta/.xinitrc @@ -1,6 +1,8 @@ #!/bin/sh +cd $HOME +xrdb -merge ~/.Xresources setxkbmap -option caps:swapescape -xrandr --output VGA-0 --mode 1600x900 --primary +xrandr --output VGA-0 --mode 1600x900 --primary --right-of LVDS synclient TapButton1=1 VertEdgeScroll=1 HorizEdgeScroll=1 VertTwoFingerScroll=0 keynav & redshift-gtk & @@ -8,3 +10,4 @@ ibus-daemon -drx connman-ui-gtk & clipit & exec awesome +cd - diff --git a/vim/.vim/after/ftplugin/cpp.vim b/vim/.vim/after/ftplugin/cpp.vim new file mode 100644 index 0000000..2f6ffc8 --- /dev/null +++ b/vim/.vim/after/ftplugin/cpp.vim @@ -0,0 +1,3 @@ +" GNU Coding Standards +setlocal cindent +setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1 diff --git a/vim/.vim/after/ftplugin/markdown.vim b/vim/.vim/after/ftplugin/markdown.vim new file mode 100644 index 0000000..6cbbf03 --- /dev/null +++ b/vim/.vim/after/ftplugin/markdown.vim @@ -0,0 +1,4 @@ +setlocal shiftwidth=4 +inoremap ≤ +inoremap ≥ +inoremap ... … diff --git a/vim/.vim/after/ftplugin/python.vim b/vim/.vim/after/ftplugin/python.vim new file mode 100755 index 0000000..dc4ed52 --- /dev/null +++ b/vim/.vim/after/ftplugin/python.vim @@ -0,0 +1,6 @@ +let g:jedi#popup_on_dot = 0 +let g:jedi#popup_select_first = 0 +let g:jedi#show_call_signatures = 2 +let g:jedi#smart_auto_mappings = 0 +setlocal shiftwidth=4 +syntax keyword pythonBoolean False True None diff --git a/vim/.vim/ftplugin/cpp.vim b/vim/.vim/ftplugin/cpp.vim deleted file mode 100644 index 2f6ffc8..0000000 --- a/vim/.vim/ftplugin/cpp.vim +++ /dev/null @@ -1,3 +0,0 @@ -" GNU Coding Standards -setlocal cindent -setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1 diff --git a/vim/.vim/ftplugin/markdown.vim b/vim/.vim/ftplugin/markdown.vim deleted file mode 100644 index 6cbbf03..0000000 --- a/vim/.vim/ftplugin/markdown.vim +++ /dev/null @@ -1,4 +0,0 @@ -setlocal shiftwidth=4 -inoremap ≤ -inoremap ≥ -inoremap ... … diff --git a/vim/.vim/ftplugin/python/python.vim b/vim/.vim/ftplugin/python/python.vim deleted file mode 100755 index dc4ed52..0000000 --- a/vim/.vim/ftplugin/python/python.vim +++ /dev/null @@ -1,6 +0,0 @@ -let g:jedi#popup_on_dot = 0 -let g:jedi#popup_select_first = 0 -let g:jedi#show_call_signatures = 2 -let g:jedi#smart_auto_mappings = 0 -setlocal shiftwidth=4 -syntax keyword pythonBoolean False True None -- cgit 1.4.1