diff --git a/.i3/config b/.i3/config index e510f2a..c96b81e 100755 --- a/.i3/config +++ b/.i3/config @@ -55,6 +55,8 @@ bindsym Control+space exec rofi -show combi -modi combi -lines 7 -eh 2 -width 10 # Pulse Audio controls ## requires alsa-utils pulseaudio +#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5% pactl -- set-sink-volume 12 +5% #increase sound volume +## Get RUNNING sinks - pactl list sinks | grep RUNNING -B 1 -A 1 bindsym XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5% #increase sound volume bindsym XF86AudioLowerVolume exec --no-startup-id pactl -- set-sink-volume 0 -5% #decrease sound volume bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound @@ -71,7 +73,8 @@ bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness ## Keyboard Backlighting -#/sys/devices/platform/asus-nb-wmi/leds/asus\:\:kbd_backlight/brightness +bindsym XF86KbdBrightnessUp exec keybrightness up +bindsym XF86KbdBrightnessDown exec keybrightness down # change focus bindsym $mod+h focus left diff --git a/config/terminator/config b/config/terminator/config index 65b5757..fbc3a80 100755 --- a/config/terminator/config +++ b/config/terminator/config @@ -58,78 +58,10 @@ show_titlebar = False [profiles] [[default]] - background_color = "#1d1f21" + background_color = "#fcaf3e" cursor_color = "#c5c8c6" foreground_color = "#c5c8c6" - palette = "#282a2e:#a54242:#8c9440:#de935f:#5f819d:#85678f:#5e8d87:#707880:#373b41:#cc6666:#b5bd68:#f0c674:#81a2be:#b294bb:#8abeb7:#c5c8c6" - scrollback_infinite = True - scrollbar_position = hidden - show_titlebar = False - use_system_font = False - [[4bit-1461701505408]] - background_color = "#8d8dcf" - foreground_color = "#d9e6f2" - palette = "#000000:#b87a7a:#7ab87a:#b8b87a:#7a7ab8:#b87ab8:#7ab8b8:#d9d9d9:#262626:#dbbdbd:#bddbbd:#dbdbbd:#bdbddb:#dbbddb:#bddbdb:#ffffff" - [[AtelierSulphurpool]] - background_color = "#202746" - cursor_color = "#979db4" - foreground_color = "#979db4" - palette = "#202746:#c94922:#ac9739:#c08b30:#3d8fd1:#6679cc:#22a2c9:#979db4:#6b7394:#c76b29:#293256:#5e6687:#898ea4:#dfe2f1:#9c637a:#f5f7ff" - [[Bright Lights]] - background_color = "#191919" - cursor_color = "#f34b00" - foreground_color = "#b3c9d7" - palette = "#191919:#ff355b:#b7e876:#ffc251:#76d4ff:#ba76e7:#6cbfb5:#c2c8d7:#191919:#ff355b:#b7e876:#ffc251:#76d5ff:#ba76e7:#6cbfb5:#c2c8d7" - [[Broadcast]] - background_color = "#2b2b2b" - cursor_color = "#ffffff" - foreground_color = "#e6e1dc" - palette = "#000000:#da4939:#519f50:#ffd24a:#6d9cbe:#d0d0ff:#6e9cbe:#ffffff:#323232:#ff7b6b:#83d182:#ffff7c:#9fcef0:#ffffff:#a0cef0:#ffffff" - [[Brogrammer]] - background_color = "#131313" - cursor_color = "#b9b9b9" - foreground_color = "#d6dbe5" - palette = "#1f1f1f:#f81118:#2dc55e:#ecba0f:#2a84d2:#4e5ab7:#1081d6:#d6dbe5:#d6dbe5:#de352e:#1dd361:#f3bd09:#1081d6:#5350b9:#0f7ddb:#ffffff" - [[DotGov]] - background_color = "#262c35" - cursor_color = "#d9002f" - foreground_color = "#ebebeb" - palette = "#191919:#bf091d:#3d9751:#f6bb34:#17b2e0:#7830b0:#8bd2ed:#ffffff:#191919:#bf091d:#3d9751:#f6bb34:#17b2e0:#7830b0:#8bd2ed:#ffffff" - [[Dracula]] - background_color = "#1e1f29" - cursor_color = "#aaaaaa" - foreground_color = "#f8f8f2" - palette = "#44475a:#ff5555:#50fa7b:#f1fa8c:#8be9fd:#bd93f9:#ff79c6:#94a3a5:#000000:#ff5555:#50fa7b:#f1fa8c:#8be9fd:#bd93f9:#ff79c6:#ffffff" - [[Github]] - background_color = "#f4f4f4" - cursor_color = "#3f3f3f" - foreground_color = "#3e3e3e" - palette = "#3e3e3e:#970b16:#07962a:#f8eec7:#003e8a:#e94691:#89d1ec:#ffffff:#666666:#de0000:#87d5a2:#f1d007:#2e6cba:#ffa29f:#1cfafe:#ffffff" - [[Smyck]] - background_color = "#2d2d2d" - cursor_color = "#c75646" - foreground_color = "#f7f7f7" - palette = "#000000:#c75646:#8eb33b:#d0b03c:#72b3cc:#c8a0d1:#218693:#b0b0b0:#5d5d5d:#e09690:#cdee69:#ffe377:#9cd9f0:#fbb1f9:#77dfd8:#f7f7f7" - [[default_old]] - audible_bell = True - background_color = "#fdf6e3" - background_darkness = 0.87 - cursor_color = "#c75646" - font = Hack 10 - foreground_color = "#657b83" - palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3" - scrollback_infinite = True - scrollbar_position = hidden - show_titlebar = False - use_system_font = False - [[old]] - audible_bell = True - background_color = "#002b36" - cursor_color = "#fc531d" - font = Monospace 8 - foreground_color = "#839496" - icon_bell = False - palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3" + palette = "#f57900:#a54242:#8c9440:#de935f:#5f819d:#85678f:#5e8d87:#707880:#373b41:#cc6666:#b5bd68:#f0c674:#81a2be:#b294bb:#8abeb7:#c5c8c6" scrollback_infinite = True scrollbar_position = hidden show_titlebar = False diff --git a/config/terminator/plugins/terminator-themes.py b/config/terminator/plugins/terminator-themes.py new file mode 100644 index 0000000..ad6e4d3 --- /dev/null +++ b/config/terminator/plugins/terminator-themes.py @@ -0,0 +1,176 @@ +import requests +import terminatorlib.plugin as plugin +from gi.repository import Gtk +from terminatorlib.config import ConfigBase +from terminatorlib.translation import _ +from terminatorlib.util import get_config_dir, err, dbg, gerr + +AVAILABLE = ['TerminatorThemes'] + +class TerminatorThemes(plugin.Plugin): + + capabilities = ['terminal_menu'] + config_base = ConfigBase() + base_url = 'https://api.github.com/repos/EliverLara/terminator-themes/contents/schemes' + def callback(self, menuitems, menu, terminal): + """Add our item to the menu""" + self.terminal = terminal + item = Gtk.ImageMenuItem(Gtk.STOCK_FIND) + item.connect('activate',self.configure) + item.set_label("Themes") + item.set_sensitive(True) + menuitems.append(item) + + def configure(self, widget, data = None): + ui = {} + + dbox = Gtk.Dialog( + _("Terminator themes"), + None, + Gtk.DialogFlags.MODAL, + ( + + _("_Close"), Gtk.ResponseType.ACCEPT + ) + ) + + self.liststore = Gtk.ListStore(str, bool) + + profiles_from_repo = [] + response = requests.get(self.base_url) + + if response.status_code != 200: + gerr(_("Failed to get list of available themes")) + return + + for repo in response.json(): + profiles_from_repo.append(repo['name']) + + + profiles = self.terminal.config.list_profiles() + + # Set add/remove buttons availability + for profile in profiles_from_repo: + profile = profile.split(".") + if profile[0] in profiles: + self.liststore.append([profile[0], False]) + else: + self.liststore.append([profile[0], True]) + + + treeview = Gtk.TreeView(self.liststore) + + selection = treeview.get_selection() + + selection.set_mode(Gtk.SelectionMode.SINGLE) + selection.connect("changed", self.on_selection_changed, ui) + ui['treeview'] = treeview + + renderer_text = Gtk.CellRendererText() + column_text = Gtk.TreeViewColumn("Theme", renderer_text, text=0) + treeview.append_column(column_text) + + + scroll_window = Gtk.ScrolledWindow() + scroll_window.set_size_request(500, 250) + scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) + scroll_window.add_with_viewport(treeview) + + hbox = Gtk.HBox() + hbox.pack_start(scroll_window, True, True, 0) + dbox.vbox.pack_start(hbox, True, True, 0) + + button_box = Gtk.VBox() + + button = Gtk.Button(_("Install")) + button_box.pack_start(button, False, True, 0) + button.connect("clicked", self.on_install, ui) + button.set_sensitive(False) + ui['button_install'] = button + + button = Gtk.Button(_("Remove")) + button_box.pack_start(button, False, True, 0) + button.connect("clicked", self.on_uninstall, ui) + button.set_sensitive(False) + ui['button_uninstall'] = button + + hbox.pack_start(button_box, False, True, 0) + self.dbox = dbox + dbox.show_all() + res = dbox.run() + if res == Gtk.ResponseType.ACCEPT: + self.terminal.config.save() + del(self.dbox) + dbox.destroy() + return + + + def on_selection_changed(self, selection, data=None): + (model, iter) = selection.get_selected() + data['button_install'].set_sensitive(model[iter][1]) + data['button_uninstall'].set_sensitive(model[iter][1] is not True) + + def on_uninstall(self, button, data): + + treeview = data['treeview'] + selection = treeview.get_selection() + (store, iter) = selection.get_selected() + target = store[iter][0] + + # If selected theme is active, sets terminal profile to default before unistalling + if self.terminal.get_profile() == target: + widget = self.terminal.get_vte() + self.terminal.force_set_profile(widget, 'default') + + self.terminal.config.del_profile(target) + self.terminal.config.save() + + #'Add' button available again + self.liststore.set_value(iter, 1, True) + self.on_selection_changed(selection, data) + + def on_install(self, button, data): + treeview = data['treeview'] + selection = treeview.get_selection() + (store, iter) = selection.get_selected() + target = store[iter][0] + widget = self.terminal.get_vte() + treeview.set_enable_tree_lines(False) + + if not iter: + return + + + headers = { "Accept": "application/vnd.github.v3.raw" } + response = requests.get(self.base_url+ '/' + target + '.config', headers=headers) + + if response.status_code != 200: + gerr(_("Failed to download selected theme")) + return + + # Creates a new profile and overwrites the default colors for the new theme + self.terminal.config.add_profile(target) + target_data = self.make_dictionary(response.content) + for k, v in target_data.items(): + if k != 'background_image': + self.config_base.set_item(k, v[1:-1], target) + + self.terminal.force_set_profile(widget, target) + self.terminal.config.save() + + # "Remove" button available again + self.liststore.set_value(iter, 1, False) + self.on_selection_changed(selection, data) + treeview.set_enable_tree_lines(True) + + def make_dictionary(self, data): + arr = [] + out_dict = {} + for line in data.split("\n"): + arr.append(line.split("=")) + + for item in arr: + if len(item) > 1: + out_dict[item[0].strip()] = item[1].strip() + + return out_dict diff --git a/config/terminator/plugins/terminator-themes.pyc b/config/terminator/plugins/terminator-themes.pyc new file mode 100644 index 0000000..ef5fe73 Binary files /dev/null and b/config/terminator/plugins/terminator-themes.pyc differ diff --git a/install.sh b/install.sh index e48487e..a120ce0 100755 --- a/install.sh +++ b/install.sh @@ -15,6 +15,9 @@ mkdir -p ~/apps ### install packages sudo apt-get install -y -f python-pip python-dev powerline +## install kryptonite +curl https://krypt.co/kr | sh + #vim backup folders mkdir -p ~/.vim/{backup_files,swap_files,undo_files} #install vundle @@ -30,7 +33,8 @@ ln -sfv ~/.vim/bundle/vimspectr/shell ~/.vimspectr-shell ln -sfv "$DOTFILES_DIR/run/.profile" ~ ln -sfv "$DOTFILES_DIR/run/.xprofile" ~ ln -sfv "$DOTFILES_DIR/run/.bashrc" ~ -ln -sfv "$DOTFILES_DIR/system/.bruise" ~/apps/bruise +ln -sfv "$DOTFILES_DIR/system/.bruise" ~/bin/bruise +ln -sfv "$DOTFILES_DIR/system/.keybrightness" ~/bin/keybrightness ln -sfv "$DOTFILES_DIR/git/.gitconfig" ~ ln -sfv "$DOTFILES_DIR/system/.vimrc" ~ ln -sfv "$DOTFILES_DIR/system/.dir_colors" ~ diff --git a/run/.bashrc b/run/.bashrc index 56818b0..55d831b 100755 --- a/run/.bashrc +++ b/run/.bashrc @@ -176,7 +176,7 @@ run_on_prompt_command() log_bash_persistent_history } -PROMPT_COMMAND="run_on_prompt_command && _powerline_set_prompt" +#PROMPT_COMMAND="run_on_prompt_command && _powerline_set_prompt" ## Keyboard Mapping!!! setxkbmap dvorak @@ -190,4 +190,4 @@ export XDG_CURRENT_DESKTOP=GNOME alias nemo='nemo --no-desktop' eval `dircolors ~/.vimspectr-shell/dircolors` -[ -n "$PS1" ] && sh ~/.vimspectr-shell/vimspectr60flat-dark +[ -n "$PS1" ] && sh ~/.vimspectr-shell/vimspectr90wflat-dark diff --git a/run/.profile b/run/.profile index 8d8a806..ae52a30 100644 --- a/run/.profile +++ b/run/.profile @@ -33,4 +33,3 @@ export LESS_TERMCAP_us=$'\e'"[1;32m" ## Add Applications to Path export PATH="$HOME/bin:$HOME/.local/bin:/opt:$PATH" export XDG_CURRENT_DESKTOP=GNOME - diff --git a/system/.alias b/system/.alias index 658ec12..d385399 100755 --- a/system/.alias +++ b/system/.alias @@ -9,6 +9,9 @@ alias ....="cd ../../.." ### Logout! alias logout='sudo pkill -u $USER' +### SSH +alias ssh-keygen='ssh-keygen -t rsa -b 4096' + ### Vagrant alias vu='vagrant up --provision' alias vp='vagrant provision' diff --git a/system/.keybrightness b/system/.keybrightness new file mode 100755 index 0000000..a4ccdf7 --- /dev/null +++ b/system/.keybrightness @@ -0,0 +1,107 @@ +#!/bin/sh +# By Giorgos Keramidas +# From: https://unix.stackexchange.com/questions/260409/set-bindings-in-i3-to-control-keyboard-backlight + +# backlight_get +# Print current keyboard brightness from UPower to stdout. +backlight_get() +{ + dbus-send --type=method_call --print-reply=literal --system \ + --dest='org.freedesktop.UPower' \ + '/org/freedesktop/UPower/KbdBacklight' \ + 'org.freedesktop.UPower.KbdBacklight.GetBrightness' \ + | awk '{print $2}' +} + +# backlight_get_max +# Print the maximum keyboard brightness from UPower to stdout. +backlight_get_max() +{ + dbus-send --type=method_call --print-reply=literal --system \ + --dest='org.freedesktop.UPower' \ + '/org/freedesktop/UPower/KbdBacklight' \ + 'org.freedesktop.UPower.KbdBacklight.GetMaxBrightness' \ + | awk '{print $2}' +} + +# backlight_set NUMBER +# Set the current backlight brighness to NUMBER, through UPower +backlight_set() +{ + value="$1" + if test -z "${value}" ; then + echo "Invalid backlight value ${value}" + fi + + dbus-send --type=method_call --print-reply=literal --system \ + --dest='org.freedesktop.UPower' \ + '/org/freedesktop/UPower/KbdBacklight' \ + 'org.freedesktop.UPower.KbdBacklight.SetBrightness' \ + "int32:${value}}" +} + +# backlight_change [ UP | DOWN | NUMBER ] +# Change the current backlight value upwards or downwards, or +# set it to a specific numeric value. +backlight_change() +{ + change="$1" + if test -z "${change}" ; then + echo "Invalid backlight change ${change}." \ + "Should be 'up' or 'down'." >&2 + return 1 + fi + + case ${change} in + [1234567890]|[[1234567890][[1234567890]) + current=$( backlight_get ) + max=$( backlight_get_max ) + value=$( expr ${change} + 0 ) + if test ${value} -lt 0 || test ${value} -gt ${max} ; then + echo "Invalid backlight value ${value}." \ + "Should be a number between 0 .. ${max}" >&2 + return 1 + else + backlight_set "${value}" + notify-send -t 800 "Keyboard brightness set to ${value}" + fi + ;; + + [uU][pP]) + current=$( backlight_get ) + max=$( backlight_get_max ) + if test "${current}" -lt "${max}" ; then + value=$(( ${current} + 1 )) + backlight_set "${value}" + notify-send -t 800 "Keyboard brightness set to ${value}" + fi + ;; + + [dD][oO][wW][nN]) + current=$( backlight_get ) + if test "${current}" -gt 0 ; then + value=$(( ${current} - 1 )) + backlight_set "${value}" + notify-send -t 800 "Keyboard brightness set to ${value}" + fi + ;; + + *) + echo "Invalid backlight change ${change}." >&2 + echo "Should be 'up' or 'down' or a number between" \ + "1 .. $( backlight_get_max )" >&2 + return 1 + ;; + esac +} + +if test $# -eq 0 ; then + current_brightness=$( backlight_get ) + notify-send -t 800 "Keyboard brightness is ${current_brightness}" +else + # Handle multiple backlight changes, e.g.: + # backlight.sh up up down down up + for change in "$@" ; do + backlight_change "${change}" + done +fi diff --git a/system/.vimrc b/system/.vimrc index d764c3a..f38774f 100755 --- a/system/.vimrc +++ b/system/.vimrc @@ -17,8 +17,8 @@ Plugin 'nightsense/vimspectr' call vundle#end() " Themes from https://github.com/nightsense/vimspectr -colorscheme vimspectr60flat-dark -let g:vimspectr60flat_dark_StatusLine = 'orange' +colorscheme vimspectr90wflat-dark +"let g:vimspectr60flat_dark_StatusLine = 'orange' "execute pathogen#infect('bundle/{}') filetype plugin indent on " filetype detection[ON] plugin[ON] indent[ON] diff --git a/vim/bundle/Vundle.vim b/vim/bundle/Vundle.vim index 5d9b059..6437ad6 160000 --- a/vim/bundle/Vundle.vim +++ b/vim/bundle/Vundle.vim @@ -1 +1 @@ -Subproject commit 5d9b05970140aa975bfb7d4350abf349c1451802 +Subproject commit 6437ad6df4a3e6a87c5fb8bd2b8aadb277ec9c87 diff --git a/vim/bundle/ansible-vim b/vim/bundle/ansible-vim index 8540ad7..5f3eb14 160000 --- a/vim/bundle/ansible-vim +++ b/vim/bundle/ansible-vim @@ -1 +1 @@ -Subproject commit 8540ad7ff0f8da2b31b5c55e6ae52ad87221e918 +Subproject commit 5f3eb14ba74bb9bc7c1356b45ab2a981825ca3ca