From a0b18cc1c815753005196ce3ff85e609bfdcf59f Mon Sep 17 00:00:00 2001 From: natemaia Date: Sun, 4 Nov 2018 22:19:12 -0800 Subject: [PATCH] Update terminal colors, additions to the vimrc --- home/.Xresources | 4 +- home/.config/conky/ArchLabs.conkyrc | 8 +- home/.config/networkmanager-dmenu/config.ini | 2 +- home/.config/ranger/colorschemes/jinx.py | 149 +++++++++++++++++++ home/.config/termite/config | 2 +- home/.homepage/index.html | 11 +- home/.homepage/style.css | 1 + home/.vimrc | 61 +++++++- home/bin/check-network | 12 +- home/bin/polybar-trash | 1 - home/bin/rofi_run | 5 +- home/bin/updates.sh | 23 +-- 12 files changed, 235 insertions(+), 44 deletions(-) create mode 100755 home/.config/ranger/colorschemes/jinx.py diff --git a/home/.Xresources b/home/.Xresources index 3de97dab..3e0a25be 100644 --- a/home/.Xresources +++ b/home/.Xresources @@ -1,7 +1,7 @@ ! Base colors *.foreground: #E1E1E1 *.background: #1c2023 -*.cursorColor: #707880 +*.cursorColor: #778899 *.color0: #1c2023 *.color1: #bf616a @@ -11,7 +11,7 @@ *.color5: #b48ead *.color6: #96b5b4 *.color7: #E1E1E1 -*.color8: #1c2023 +*.color8: #919ba0 *.color9: #bf616a *.color10: #a3be8c *.color11: #ebcb8b diff --git a/home/.config/conky/ArchLabs.conkyrc b/home/.config/conky/ArchLabs.conkyrc index 53bb28e9..62878d36 100644 --- a/home/.config/conky/ArchLabs.conkyrc +++ b/home/.config/conky/ArchLabs.conkyrc @@ -32,8 +32,8 @@ default_gauge_height = 25, default_gauge_width =40, default_graph_height = 40, default_graph_width = 153, -default_shade_color = '#000000', -default_outline_color = '#000000', +default_shade_color = '#1c2023', +default_outline_color = '#1c2023', draw_borders = false, draw_graph_borders = true, draw_shades = false, @@ -59,7 +59,7 @@ own_window = true, own_window_argb_value = 250, own_window_argb_visual = true, own_window_class = 'Conky', -own_window_colour = '#000000', +own_window_colour = '#1c2023', own_window_hints = 'undecorated,below,above,sticky,skip_taskbar,skip_pager', own_window_transparent = true, own_window_title = 'system_conky', @@ -97,8 +97,8 @@ ${hr} [S] + t${alignr}Terminal [S] + e${alignr}Text Editor [S] + f${alignr}File Manager -[S] + m${alignr}Music Player [S] + w${alignr}Web Browser +[S] + m${alignr}Music Player [S] + v${alignr}Audio Control [S] + x${alignr}Logout ]]; diff --git a/home/.config/networkmanager-dmenu/config.ini b/home/.config/networkmanager-dmenu/config.ini index 3d0c4f5a..f298f27b 100644 --- a/home/.config/networkmanager-dmenu/config.ini +++ b/home/.config/networkmanager-dmenu/config.ini @@ -1,5 +1,5 @@ [dmenu] -dmenu_command = rofi -location 3 -yoffset 35 -xoffset -10 -width 37 -font "DejaVu Sans Mono 11" -padding 20 -line-padding 4 -hide-scrollbar -password +dmenu_command = rofi -location 3 -yoffset 35 -xoffset -10 -width 37 -font "DejaVu Sans Mono 11" -padding 20 -line-padding 4 -password [editor] terminal = termite diff --git a/home/.config/ranger/colorschemes/jinx.py b/home/.config/ranger/colorschemes/jinx.py new file mode 100755 index 00000000..d1e9c423 --- /dev/null +++ b/home/.config/ranger/colorschemes/jinx.py @@ -0,0 +1,149 @@ +""" +A ranger color scheme + +Made to be eye catchy while maintaining visibility, and base 0-7 colours. + +Inspired by themes like Tomorrow, Dracula, Atom, and Spacemacs, but with my own twists +""" + +from ranger.gui.colorscheme import ColorScheme +from ranger.gui.color import * + + +class jinx(ColorScheme): + """ + Defines colours used when colourscheme is enabled + """ + progress_bar_color = 96 + + def use(self, context): + """ + Main colour block with individual definitions + """ + fg, bg, attr = default_colors + + if context.reset: + return default_colors + elif context.in_browser: + if context.selected: + attr = reverse + else: + attr = normal + if context.empty or context.error: + fg = 131 + if context.border: + fg = 247 + if context.image: + fg = 179 + if context.video: + fg = 96 + if context.audio: + fg = 117 + if context.document: + fg = 38 + if context.container: + fg = 108 + if context.directory: + fg = 103 + elif context.executable and not \ + any((context.media, context.fifo, context.container, context.socket)): + fg = 67 + if context.socket: + fg = 179 + attr |= bold + if context.fifo or context.device: + fg = 214 + attr |= bold + if context.link: + fg = 38 if context.good else 131 + if context.tag_marker and not context.selected: + fg = 96 + attr |= bold + if not context.selected and (context.cut or context.copied): + fg = 247 + attr |= underline + if context.main_column: + if context.marked: + attr |= underline + fg = 131 + if context.selected: + attr |= normal + if context.badinfo: + if attr & reverse: + bg = 96 + else: + fg = 203 + elif context.in_titlebar: + attr |= bold + if context.hostname: + fg = 203 if context.bad else 67 + elif context.directory: + fg = 96 + elif context.tab: + if context.good: + bg = 96 + elif context.link: + fg = 117 + elif context.in_statusbar: + if context.permissions: + if context.good: + fg = 67 + elif context.bad: + fg = 203 + if context.marked: + attr |= bold | reverse + fg = 96 + if context.message: + if context.bad: + attr |= bold + fg = 96 + if context.loaded: + bg = self.progress_bar_color + if context.vcsinfo: + fg = 38 + attr &= ~bold + if context.vcscommit: + fg = 108 + attr &= ~bold + if context.text: + fg = 254 + if context.highlight: + attr |= reverse + if context.in_taskview: + if context.title: + fg = 67 + if context.selected: + attr |= reverse + if context.loaded: + if context.selected: + fg = self.progress_bar_color + else: + bg = self.progress_bar_color + if context.vcsfile and not context.selected: + attr &= ~bold + if context.vcsconflict: + fg = 203 + elif context.vcschanged: + fg = 174 + elif context.vcsunknown: + fg = 174 + elif context.vcsstaged: + fg = 108 + elif context.vcssync: + fg = 108 + elif context.vcsignored: + fg = default + elif context.vcsremote and not context.selected: + attr &= ~bold + if context.vcssync: + fg = 108 + elif context.vcsbehind: + fg = 174 + elif context.vcsahead: + fg = 67 + elif context.vcsdiverged: + fg = 203 + elif context.vcsunknown: + fg = 174 + + return fg, bg, attr diff --git a/home/.config/termite/config b/home/.config/termite/config index f3a4386e..2c15d1f8 100644 --- a/home/.config/termite/config +++ b/home/.config/termite/config @@ -32,7 +32,7 @@ color4 = #8fa1b3 color5 = #b48ead color6 = #96b5b4 color7 = #E1E1E1 -color8 = #1c2023 +color8 = #919ba0 color9 = #bf616a color10 = #a3be8c color11 = #ebcb8b diff --git a/home/.homepage/index.html b/home/.homepage/index.html index a140e178..ece6a653 100644 --- a/home/.homepage/index.html +++ b/home/.homepage/index.html @@ -20,14 +20,11 @@ Official Website - ArchLabs G+ + ArchLabs Forum ArchLabs Reddit - - ArchLabs Forum - ArchLabs Twitter @@ -70,14 +67,14 @@
- GetArchLabs + ArchLabs
diff --git a/home/.homepage/style.css b/home/.homepage/style.css index 3261ee58..57169050 100644 --- a/home/.homepage/style.css +++ b/home/.homepage/style.css @@ -127,6 +127,7 @@ input[type=text]:focus { top: 50%; transform: translateY(-50%); } + .stripe .content span { line-height: calc(25vh - 50px); display: none; diff --git a/home/.vimrc b/home/.vimrc index b4ede430..81c6f43a 100644 --- a/home/.vimrc +++ b/home/.vimrc @@ -22,8 +22,7 @@ let g:netrw_browse_split = 3 " ------ leader mapping ------ -let g:mapleader = ',' -map , +let g:mapleader = "\" " ------ enable additional features ------ @@ -173,6 +172,63 @@ endif " ------ adv maps ------ +" visual quote surround +vnoremap ;' :call QuickWrap("'") +vnoremap ;" :call QuickWrap('"') + +" quote 'surround' +nnoremap ;' ciW''P +nnoremap ;'' ciw''P +nnoremap ;" ciW""P +nnoremap ;"" ciw""P + +" Smart Quotes +inoremap ' strpart(getline('.'), col('.')-1, 1) == "\'" ? "\U\" : "''\U\" +inoremap '' ' +inoremap " strpart(getline('.'), col('.')-1, 1) == "\"" ? "\U\" : '""'."\U\" +inoremap "" " + +" Smart Parens +"inoremap strpart(getline('.'), col('.')-1, 1) == ")" | "}" ? "\" : "" +inoremap ) strpart(getline('.'), col('.')-1, 1) == ")" ? "\U\" : ")" +inoremap ( ()U +inoremap ( ()O +inoremap (( ( +inoremap () () + +" Smart Braces +inoremap } strpart(getline('.'), col('.')-1, 1) == "}" ? "\U\" : "}" +inoremap { {}U +inoremap { {}O +inoremap {{ { +inoremap {} {} + +" Smart Brackets +inoremap ] strpart(getline('.'), col('.')-1, 1) == "]" ? "\U\" : "]" +inoremap [ []U +inoremap [ []O +inoremap [[ [ +inoremap [] [] + +" Smart Brackets +inoremap > strpart(getline('.'), col('.')-1, 1) == ">" ? "\U\" : ">" +inoremap < <>U +inoremap U +inoremap << < +inoremap <> <> + +" Quote wrapper function +function! QuickWrap(wrapper) + let l:w = a:wrapper + let l:inside_or_around = (&selection ==? 'exclusive') ? ('i') : ('a') + normal `> + execute "normal " . inside_or_around . escape(w, '\') + normal `< + execute "normal i" . escape(w, '\') + normal `< +endfunction + + " toggle line numbers, nn (no number) nnoremap nn \ :if &number @@ -217,6 +273,7 @@ vnoremap cw "hy \ execute '%s/'.b:rep.'/'.b:sub.'/gc' \ unlet b:sub b:rep \ endif + nnoremap cw \ :let b:sub = input('interactive replacement: ') \ if b:sub !=? '' diff --git a/home/bin/check-network b/home/bin/check-network index a6c6ea49..ced4eca3 100755 --- a/home/bin/check-network +++ b/home/bin/check-network @@ -1,6 +1,5 @@ #!/usr/bin/env bash -count=0 disconnected="/" disconnected2="\\" wireless_connected="" @@ -9,14 +8,9 @@ ethernet_connected="" ID="$(ip link | awk '/state UP/ {print $2}')" while true; do - if (ping -c 1 archlabslinux.com || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then - if [[ $ID == e* ]]; then - echo "$ethernet_connected" ; sleep 25 - else - echo "$wireless_connected" ; sleep 25 - fi + if (ping -c 1 archlabslinux.com || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) >/dev/null 2>&1; then + [[ $ID == e* ]] && { echo "$ethernet_connected"; sleep 25; } || { echo "$wireless_connected"; sleep 25; } else - echo "$disconnected" ; sleep 0.6 - echo "$disconnected2" ; sleep 0.6 + echo "$disconnected"; sleep 0.6; echo "$disconnected2"; sleep 0.6 fi done diff --git a/home/bin/polybar-trash b/home/bin/polybar-trash index 3c7c0fd0..a7875994 100755 --- a/home/bin/polybar-trash +++ b/home/bin/polybar-trash @@ -1,6 +1,5 @@ #!/usr/bin/env bash - TRASH_DIRECTORY="$BLOCK_INSTANCE" if [[ $TRASH_DIRECTORY = "" ]]; then diff --git a/home/bin/rofi_run b/home/bin/rofi_run index 17064bc5..60735d6a 100755 --- a/home/bin/rofi_run +++ b/home/bin/rofi_run @@ -6,7 +6,7 @@ VER="0.4" usage() { cat <<- EOF - USAGE: $NAME [OPTIONS] + USAGE: $NAME [OPTIONS] OPTIONS: @@ -26,7 +26,8 @@ usage() { -l,--logout Session logout dialog - Without any options -r,--run will be opened. + + Without any options the run dialog will be opened. EOF } diff --git a/home/bin/updates.sh b/home/bin/updates.sh index 355e8cef..36c052c0 100755 --- a/home/bin/updates.sh +++ b/home/bin/updates.sh @@ -6,32 +6,26 @@ NOTIFY_ICON=/usr/share/icons/gnome/32x32/apps/system-software-update.png get_total_updates() { UPDATES=$(checkupdates 2>/dev/null | wc -l); } while true; do + # print the icon first to avoid gibberish in polybar + echo $BAR_ICON + get_total_updates # notify user of updates - if hash notify-send &>/dev/null; then + if hash notify-send >/dev/null 2>&1; then if (( UPDATES > 50 )); then - notify-send -u critical -i $NOTIFY_ICON \ - "You really need to update!!" "$UPDATES New packages" + notify-send -u critical -i $NOTIFY_ICON "Updates Available" "$UPDATES packages" elif (( UPDATES > 25 )); then - notify-send -u normal -i $NOTIFY_ICON \ - "You should update soon" "$UPDATES New packages" + notify-send -u normal -i $NOTIFY_ICON "Updates Available" "$UPDATES packages" elif (( UPDATES > 2 )); then - notify-send -u low -i $NOTIFY_ICON \ - "$UPDATES New packages" + notify-send -u low -i $NOTIFY_ICON "Updates Available" "$UPDATES packages" fi fi # when there are updates available # every 10 seconds another check for updates is done while (( UPDATES > 0 )); do - if (( UPDATES == 1 )); then - echo "$UPDATES Update" - elif (( UPDATES > 1 )); then - echo "$UPDATES Updates" - else - echo $BAR_ICON - fi + (( UPDATES == 1 )) && echo "$UPDATES Update" || { (( UPDATES > 1 )) && echo "$UPDATES Updates"; } sleep 10 get_total_updates done @@ -39,7 +33,6 @@ while true; do # when no updates are available, use a longer loop, this saves on CPU # and network uptime, only checking once every 30 min for new updates while (( UPDATES == 0 )); do - echo $BAR_ICON sleep 1800 get_total_updates done