From f7ac47a1102006842d074146237c756648478675 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Thu, 12 Feb 2015 19:45:58 +0100 Subject: bspwm update --- Xresources | 2 - bash_aliases | 10 ++-- config/uzbl/config | 83 ++++++++++++++++++---------- config/uzbl/scripts/download.sh | 69 ++++++++++++++++++++++++ config/uzbl/scripts/gonew.pl | 16 ++++++ config/uzbl/scripts/goto.pl | 16 ++++++ config/uzbl/scripts/gowiki.pl | 16 ++++++ config/uzbl/scripts/gowikio.pl | 16 ++++++ ratpoison/clipboard | 3 +- ratpoison/create_frame | Bin 0 -> 9832 bytes ratpoison/exec_to_workspace | 5 +- ratpoison/panel/cpu | 5 ++ ratpoison/panel/music | 11 ++++ ratpoison/panel/panel | 31 +++++++++++ ratpoison/panel/panel_bar | 116 ++++++++++++++++++++++++++++++++++++++++ ratpoison/panel/panel_colors | 33 ++++++++++++ ratpoison/panel/profile | 4 ++ ratpoison/pentfocus | 5 -- ratpoison/py/color_detect.py | 108 ------------------------------------- ratpoison/py/colorz.py | 71 ------------------------ ratpoison/py/colorz.pyc | Bin 2992 -> 0 bytes ratpoison/ratpoisonrc.conf | 9 ++-- ratpoison/spotlight | 2 +- ratpoison/tray | 13 ----- ratpoison/wp | 5 +- ratpoison/xtoolwait | Bin 0 -> 13112 bytes vimperatorrc | 78 +++++++++++++-------------- xinitrc | 21 ++++---- 28 files changed, 458 insertions(+), 290 deletions(-) create mode 100755 config/uzbl/scripts/download.sh create mode 100755 config/uzbl/scripts/gonew.pl create mode 100755 config/uzbl/scripts/goto.pl create mode 100755 config/uzbl/scripts/gowiki.pl create mode 100755 config/uzbl/scripts/gowikio.pl create mode 100755 ratpoison/create_frame create mode 100755 ratpoison/panel/cpu create mode 100755 ratpoison/panel/music create mode 100755 ratpoison/panel/panel create mode 100755 ratpoison/panel/panel_bar create mode 100644 ratpoison/panel/panel_colors create mode 100644 ratpoison/panel/profile delete mode 100755 ratpoison/pentfocus delete mode 100644 ratpoison/py/color_detect.py delete mode 100644 ratpoison/py/colorz.py delete mode 100644 ratpoison/py/colorz.pyc delete mode 100755 ratpoison/tray create mode 100755 ratpoison/xtoolwait diff --git a/Xresources b/Xresources index 7c23c76..3d9ea21 100644 --- a/Xresources +++ b/Xresources @@ -8,9 +8,7 @@ Xcursor.theme: XcursorHuman !*pointerColorBackground:S_base1 !*pointerColorForeground:S_base01 -!urxvt.font :xft:inconsolata-dz-powerline:size=14 urxvt.scrollBar :false -!xterm.font :xft:inconsolata-dz-powerline:size=14 xterm.scrollBar :false xterm*faceName: DejaVu Sans Mono Book diff --git a/bash_aliases b/bash_aliases index b217b8f..5f879a7 100644 --- a/bash_aliases +++ b/bash_aliases @@ -3,11 +3,11 @@ # pacat /dev/urandom > padsp # to enable disable services sudo update-rc.d apache2 disable # for volume over 150: pactl set-sink-volume 0 150% (or volume 150%) -alias volume='pactl set-sink-volume 0' #if you wanna change timezone just copy one of /usr/share/zoneinfo/place to /etc/localtime -# I am stupid sometimes -#alias sudo vim='sudo -e' +# Disable mouse +alias remouse='sudo modprobe -r bcm5974' +alias enmouse='sudo modprobe bcm5974' # Notes alias physics='vim ~/Dropbox/Notes/Physics/physics.txt' @@ -51,7 +51,7 @@ alias o='less' alias g='wget' alias x='tar -xvzf' alias a='tar -cvzf' -alias i='sudo pacman -S' +alias i='yaourt -S' alias p='sudo pacman -Rs' alias t='optirun' alias ts='optirun -b none nvidia-settings -c :8' @@ -89,6 +89,8 @@ alias vimrc='vi ~/.vimrc' alias aliases='vi ~/.bash_aliases' alias solarize='~/.solarized/solarize' alias rat='vim ~/.ratpoison/ratpoisonrc.conf' +alias sx='vim ~/.config/sxhkd/sxhkdrc' +alias bs='vim ~/.config/bspwm/bspwmrc' alias screenrc='vim ~/.ratpoison/screenrc' alias xkb='sudo vim /usr/share/X11/xkb/symbols/us' alias pdf='apvlv' diff --git a/config/uzbl/config b/config/uzbl/config index b66b5cc..c69255e 100644 --- a/config/uzbl/config +++ b/config/uzbl/config @@ -3,12 +3,33 @@ # === Core settings ========================================================== +# Polipo proxy for caching +set proxy_url = http://127.0.0.1:8123 + # common directory locations set prefix = @(echo $PREFIX)@ set data_home = @(echo $XDG_DATA_HOME)@ set cache_home = @(echo $XDG_CACHE_HOME)@ set config_home = @(echo $XDG_CONFIG_HOME)@ + +# colors +set color1 = @(source ~/.colors; echo $COLOR1)@ +set color2 = @(source ~/.colors; echo $COLOR2)@ +set color3 = @(source ~/.colors; echo $COLOR3)@ +set color4 = @(source ~/.colors; echo $COLOR4)@ +set color5 = @(source ~/.colors; echo $COLOR5)@ +set color6 = @(source ~/.colors; echo $COLOR6)@ +set color7 = @(source ~/.colors; echo $COLOR7)@ +set color8 = @(source ~/.colors; echo $COLOR8)@ +set color9 = @(source ~/.colors; echo $COLOR9)@ +set color10 = @(source ~/.colors; echo $COLOR10)@ +set color11 = @(source ~/.colors; echo $COLOR11)@ +set color12 = @(source ~/.colors; echo $COLOR12)@ +set color13 = @(source ~/.colors; echo $COLOR13)@ +set color14 = @(source ~/.colors; echo $COLOR14)@ +set color15 = @(source ~/.colors; echo $COLOR15)@ + # Interface paths. set fifo_dir = /tmp set socket_dir = /tmp @@ -35,7 +56,7 @@ set set_mode = set mode = set set_status = set status_message = # Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable" -set scripts_dir = @data_home/uzbl:@prefix/share/uzbl/examples/data:scripts +set scripts_dir = @data_home/uzbl/scripts:@prefix/share/uzbl/examples/data:scripts # === Hardcoded handlers ===================================================== @@ -44,7 +65,7 @@ set scripts_dir = @data_home/uzbl:@prefix/share/uzbl/examples/data:scripts set scheme_handler = sync_spawn @scripts_dir/scheme.py #set request_handler = sync_spawn @scripts_dir/request.py set authentication_handler = sync_spawn @scripts_dir/auth.py -set download_handler = sync_spawn @scripts_dir/download.sh +set download_handler = sync_spawn /home/vasko/.config/uzbl/scripts/download.sh # === Dynamic event handlers ================================================= @@ -67,7 +88,7 @@ set download_handler = sync_spawn @scripts_dir/download.sh @on_event LOAD_START @set_mode # Load commit handlers -@on_event LOAD_COMMIT @set_status recv +@on_event LOAD_COMMIT @set_status recv # add some javascript to the page for other 'js' and 'script' commands to access later. @on_event LOAD_COMMIT js uzbl = {}; @@ -101,21 +122,21 @@ set show_status = 0 set status_top = 0 set status_background = #1c1c1c -set modcmd_style = weight="bold" foreground="red" -set keycmd_style = weight="light" foreground="red" -set prompt_style = foreground="grey" +set modcmd_style = weight="bold" foreground="@color13" +set keycmd_style = weight="light" foreground="@color13" +set prompt_style = foreground="@color2" set cursor_style = underline="single" -set completion_style = foreground="green" +set completion_style = foreground="@color2" set hint_style = weight="bold" set mode_section = [\@[\@mode_indicator]\@] set keycmd_section = [\@[\@keycmd_prompt]\@\@modcmd\@keycmd\@completion_list] -set progress_section = \@[\@progress.output]\@ -set scroll_section = \@[\@scroll_message]\@ -set uri_section = \@[\@uri]\@ -set name_section = \@[\@NAME]\@ -set status_section = \@status_message -set selected_section = \@[\@SELECTED_URI]\@ +set progress_section = \@[\@progress.output]\@ +set scroll_section = \@[\@scroll_message]\@ +set uri_section = \@[\@uri]\@ +set name_section = \@[\@NAME]\@ +set status_section = \@status_message +set selected_section = \@[\@SELECTED_URI]\@ set download_section = \@downloads @@ -134,7 +155,8 @@ set progress.pending = # === Useragent setup ======================================================== -set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}) (@(+uname -sm)@ [@ARCH_UZBL]) +#set useragent = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}) (@(+uname -sm)@ [@ARCH_UZBL]) +set useragent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A # === Configure cookie blacklist ======================================================== # Accept 'session cookies' from uzbl.org (when you have a whitelist all other cookies are dropped) @@ -232,13 +254,15 @@ set ebind = @mode_bind global,-insert @cbind :_ = %s # open a new window or a new tab (see the on_event NEW_WINDOW settings above) -@cbind w = event REQ_NEW_WINDOW +#@cbind w = event REQ_NEW_WINDOW +@cbind w_ = spawn /home/vasko/.config/uzbl/scripts/gowiki.pl %s +@cbind W_ = spawn /home/vasko/.config/uzbl/scripts/gowikio.pl %s # Page movement binds @cbind j = scroll vertical 20 @cbind k = scroll vertical -20 -@cbind h = scroll horizontal -20 -@cbind l = scroll horizontal 20 +@cbind H = scroll horizontal -20 +@cbind L = scroll horizontal 20 @cbind = scroll vertical -100% @cbind = scroll vertical 100% @cbind f = scroll vertical 100% @@ -271,7 +295,8 @@ set ebind = @mode_bind global,-insert # Appearance binds #@cbind t = toggle show_status -@cbind t_ = spawn /usr/bin/uzbl-browser --uri %s +@cbind t_ = spawn /home/vasko/.config/uzbl/scripts/gonew.pl %s + # Page searching binds @cbind /* = search %s @@ -294,7 +319,7 @@ set ebind = @mode_bind global,-insert #@cbind s__ = set %1 = %2 # Exit binding @cbind ZZ = exit -@cbind x = exit +@cbind :wq = exit # Dump config to stdout @cbind !dump = sh 'echo dump_config > "$UZBL_FIFO"' # Reload all variables in the config @@ -306,7 +331,9 @@ set ebind = @mode_bind global,-insert #@cbind t = sh 'urxvt -e socat unix-connect:"$UZBL_SOCKET" -' # Uri opening prompts -@cbind o_ = uri %s +#@cbind o_ = uri %s +@cbind o_ = spawn /home/vasko/.config/uzbl/scripts/goto.pl %s +#@cbind o _ = spawn /home/vasko/.config/uzbl/scripts/goto.js '%s' # Or have it load the current uri into the keycmd for editing @cbind O_ = uri %s @@ -400,14 +427,14 @@ set formfiller = spawn @scripts_dir/formfiller.sh @cbind gO_ = event NEW_TAB_NEXT %s # Closing / resting -@cbind gC = exit +@cbind x = exit @cbind gQ = event CLEAN_TABS # Tab navigating @cbind g< = event FIRST_TAB @cbind g> = event LAST_TAB -@cbind gt = event NEXT_TAB -@cbind gT = event PREV_TAB +@cbind l = event NEXT_TAB +@cbind h = event PREV_TAB @cbind gi_ = event GOTO_TAB %s # Preset loading @@ -437,23 +464,23 @@ set insert = @mode_config insert set stack = @mode_config stack # Command mode config. -@command keycmd_style = foreground="red" -@command status_background = #202020 +@command keycmd_style = foreground="@color13" +@command status_background = #1c1c1c @command mode_indicator = Cmd @command keycmd_events = 1 @command forward_keys = 0 @command modcmd_updates = 1 # Insert mode config. -@insert status_background = #303030 +@insert status_background = #1c1c1c @insert mode_indicator = Ins @insert forward_keys = 1 @insert keycmd_events = 0 @insert modcmd_updates = 0 # Multi-stage-binding mode config. -@stack keycmd_style = foreground="red" -@stack status_background = #202020 +@stack keycmd_style = foreground="@color13" +@stack status_background = #1c1c1c @stack mode_indicator = Bnd @stack prompt_style = foreground="#888" weight="light" @stack keycmd_events = 1 diff --git a/config/uzbl/scripts/download.sh b/config/uzbl/scripts/download.sh new file mode 100755 index 0000000..398f271 --- /dev/null +++ b/config/uzbl/scripts/download.sh @@ -0,0 +1,69 @@ +#!/bin/sh +# uzbl's example configuration sets this script up as its download_handler. +# this script is run when uzbl encounters a URL that it can't display, and when +# a download is requested using the 'download' command. +# +# if the script prints a file path to stdout, uzbl will save the download to +# that path using it's internal downloader. +# +# if nothing is printed to stdout, the internal download will be cancelled. +# you could do your own download handling in your script that way. + +# if $5 is set, it is the path that was passed to uzbl's "download" command. +# we want to use that if it's available. +[ -n "$5" ] && echo "$5" && exit + +. "$UZBL_UTIL_DIR/uzbl-dir.sh" + +# the URL that is being downloaded +uri="$1" +shift + +safe_uri="$( echo "$uri" | sed -e 's/\W/-/g' )" + +# a filename suggested by the server or based on the URL +suggested_filename="${1:-$safe_uri}" +shift + +# the mimetype of the file being downloaded +content_type="$1" +shift + +# the size of the downloaded file in bytes. this is not always accurate, since +# the server might not have sent a size with its response headers. +total_size="$1" +shift + +case "$suggested_filename" in + # example: save torrents to a separate directory + *.torrent) + path="/home/vasko/Torrents/$suggested_filename" + ;; + # Default case + *) + path="/home/vasko/Downloads/$suggested_filename" + ;; +esac + +source ~/.colors; + +if ! /home/vasko/.ratpoison/ratmenu -style dreary -fg \"$COLOR11\" -bg \"$COLOR0\" -io 2 "Download \"$suggested_filename\"?" false Yes true No false;then +path=''; +fi + +# Do nothing if we don't want to save the file +[ -z "$path" ] && exit 0 + +# Check if the file exists +if [ ! -e "$path" ]; then + echo "$path" + exit 0 +fi + +# Try to make a unique filename +count=1 +while [ -e "$path.$count" ]; do + count=$(( $count + 1 )) +done + +echo "$path.$count" diff --git a/config/uzbl/scripts/gonew.pl b/config/uzbl/scripts/gonew.pl new file mode 100755 index 0000000..480dc4f --- /dev/null +++ b/config/uzbl/scripts/gonew.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +my @cmd = @ARGV; +my $fifo = $ENV{'UZBL_FIFO'}; + + +#If there are no dots in the first word or more than one word is suppllied expect a phrase for google. Else go to the uri specified. +if (index(@cmd[0], '.') == -1 || scalar @cmd > 1) +{ + # Replace this with your search engine + qx(echo "event new_tab http://www.google.com/search?q=@ARGV" > $fifo); +} +else +{ + qx(echo "event new_tab @cmd" > $fifo); +} diff --git a/config/uzbl/scripts/goto.pl b/config/uzbl/scripts/goto.pl new file mode 100755 index 0000000..ea7269e --- /dev/null +++ b/config/uzbl/scripts/goto.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +my @cmd = @ARGV; +my $fifo = $ENV{'UZBL_FIFO'}; + + +#If there are no dots in the first word or more than one word is suppllied expect a phrase for google. Else go to the uri specified. +if (index(@cmd[0], '.') == -1 || scalar @cmd > 1) +{ + # Replace this with your search engine + qx(echo "uri http://www.google.com/search?q=@ARGV" >> $fifo); +} +else +{ + qx(echo "uri @cmd" >> $fifo); +} diff --git a/config/uzbl/scripts/gowiki.pl b/config/uzbl/scripts/gowiki.pl new file mode 100755 index 0000000..61f636d --- /dev/null +++ b/config/uzbl/scripts/gowiki.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +my @cmd = @ARGV; +my $fifo = $ENV{'UZBL_FIFO'}; + + +#If there are no dots in the first word or more than one word is suppllied expect a phrase for google. Else go to the uri specified. +if (index(@cmd[0], '.') == -1 || scalar @cmd > 1) +{ + # Replace this with your search engine + qx(echo "uri http://127.0.0.1:8000/search?content=wikipedia_en_all_nopic_01_2014&pattern=@ARGV" >> $fifo); +} +else +{ + qx(echo "uri @cmd" >> $fifo); +} diff --git a/config/uzbl/scripts/gowikio.pl b/config/uzbl/scripts/gowikio.pl new file mode 100755 index 0000000..743c69c --- /dev/null +++ b/config/uzbl/scripts/gowikio.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +my @cmd = @ARGV; +my $fifo = $ENV{'UZBL_FIFO'}; + + +#If there are no dots in the first word or more than one word is suppllied expect a phrase for google. Else go to the uri specified. +if (index(@cmd[0], '.') == -1 || scalar @cmd > 1) +{ + # Replace this with your search engine + qx(echo "uri http://en.wikipedia.org/w/index.php?search=@ARGV" >> $fifo); +} +else +{ + qx(echo "uri @cmd" >> $fifo); +} diff --git a/ratpoison/clipboard b/ratpoison/clipboard index 8b5a776..514394f 100755 --- a/ratpoison/clipboard +++ b/ratpoison/clipboard @@ -74,7 +74,8 @@ elif [ $command = menu_paste -o $command = menu_set ]; then menu elif [ $command = paste ]; then xcb -p $option | xclip - ratpoison -c "meta S-Insert" + xdotool key shift+Insert + elif [ $command = set ]; then xclip -o | xcb -n 10 -s $option elif [ $command = push ]; then diff --git a/ratpoison/create_frame b/ratpoison/create_frame new file mode 100755 index 0000000..e39f7dc Binary files /dev/null and b/ratpoison/create_frame differ diff --git a/ratpoison/exec_to_workspace b/ratpoison/exec_to_workspace index 451bb07..d97efff 100755 --- a/ratpoison/exec_to_workspace +++ b/ratpoison/exec_to_workspace @@ -8,6 +8,5 @@ wg=$1; shift cmd="$@" -eval $cmd & -rpws $wg - +bspc desktop -f $wg & +eval $cmd diff --git a/ratpoison/panel/cpu b/ratpoison/panel/cpu new file mode 100755 index 0000000..908f207 --- /dev/null +++ b/ratpoison/panel/cpu @@ -0,0 +1,5 @@ +while true; do +echo -n 'C' +ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |sed -n '1h;$!H;$g;s/\n/ +/gp' | bc +sleep 2; +done diff --git a/ratpoison/panel/music b/ratpoison/panel/music new file mode 100755 index 0000000..6190dbc --- /dev/null +++ b/ratpoison/panel/music @@ -0,0 +1,11 @@ +while true;do +if mpc | grep -q playing; then +echo "p`mpc current`" | cut --bytes 1-40 +echo "K`mpc -h 127.0.0.1 volume | perl -pe 's/^volume://' | perl -pe 's/%$//' | perl -pe 's/^ //'`" +else +echo "P`mpc current`" | cut --bytes 1-40 +sleep 1; +echo "K`mpc -h 127.0.0.1 volume | perl -pe 's/^volume://' | perl -pe 's/%$//' | perl -pe 's/^ //'`" +fi +sleep 5; +done diff --git a/ratpoison/panel/panel b/ratpoison/panel/panel new file mode 100755 index 0000000..414fffc --- /dev/null +++ b/ratpoison/panel/panel @@ -0,0 +1,31 @@ +#! /bin/sh +cd ~/.ratpoison/panel +source ./profile +source ~/.colors +if [ $(pgrep -cx panel) -gt 1 ] ; then + printf "%s\n" "The panel is already running." >&2 + exit 1 +fi + +trap 'trap - TERM; kill 0' INT TERM QUIT EXIT + +[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO" +mkfifo "$PANEL_FIFO" + +bspc config top_padding $PANEL_HEIGHT +bspc control --subscribe > "$PANEL_FIFO" & +xtitle -sf 'T%s' > "$PANEL_FIFO" & +essid -sf 'E%s' -i 3 -w wlp2s0 > "$PANEL_FIFO" & +volume -i 10 -sf 'V%i' > "$PANEL_FIFO" & +battery -i 5 -sf 'B%i' > "$PANEL_FIFO" & +clock -sf 'S%a %H:%M' > "$PANEL_FIFO" & +./music > "$PANEL_FIFO" & +./cpu > "$PANEL_FIFO" & + + +source ./panel_colors + +cat "$PANEL_FIFO" | ./panel_bar | bar -g x$PANEL_HEIGHT -f "$PANEL_FONT_FAMILY" -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND" & + +stalonetray --geometry 4x1-1+1 --icon-gravity E --grow-gravity E -bg $COLOR0 -i 18 +wait diff --git a/ratpoison/panel/panel_bar b/ratpoison/panel/panel_bar new file mode 100755 index 0000000..5015464 --- /dev/null +++ b/ratpoison/panel/panel_bar @@ -0,0 +1,116 @@ +#! /bin/sh +# +# Example panel for LemonBoy's bar + + +num_mon=$(bspc query -M | wc -l) + +while read -r line ; do +source ./panel_colors + case $line in + C*) + # playing mpc + cpu="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} C:${line#?} %{B-}%{F-}" + ;; + + p*) + # playing mpc + paused='' + playing="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} p:${line#?} %{B-}%{F-}" + ;; + + P*) + # paused mpc + playing='' + paused="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} P:${line#?} %{B-}%{F-}" + ;; + K*) + # volume output + musicvol="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} M:${line#?} %{B-}%{F-}" + ;; + + + B*) + # volume output + battery="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} B:${line#?} %{B-}%{F-}" + ;; + + + V*) + # volume output + volume="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} V:${line#?} %{B-}%{F-}" + ;; + + E*) + # essid output + if [ -z ${line#?} ];then + essid="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} E:No WiFi %{B-}%{F-}" + else + essid="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} E:${line#?} %{B-}%{F-}" + fi + ;; + + S*) + # clock output + time_infos="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${line#?} %{B-}%{F-}" + ;; + T*) + # xtitle output + title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG} ${line#?} %{B-}%{F-}" + ;; + W*) + # bspwm internal state + wm_infos="" + IFS=':' + set -- ${line#?} + while [ $# -gt 0 ] ; do + item=$1 + name=${item#?} + case $item in + M*) + # active monitor + if [ $num_mon -gt 1 ] ; then + wm_infos="$wm_infos %{F$COLOR_FOCUSED_FG}%{B$COLOR_FOCUSED_BG} ${name} %{B-}%{F-} " + fi + ;; +# m*) +# # inactive monitor +# if [ $num_mon -gt 1 ] ; then +# wm_infos="$wm_infos %{F$COLOR_INACTIVE_MONITOR_FG}%{B$COLOR_INACTIVE_MONITOR_BG} ${name} %{B-}%{F-} " +# fi +# ;; + O*) + # focused occupied desktop + wm_infos="${wm_infos}%{F$COLOR_FOCUSED_FG}%{B$COLOR_FOCUSED_BG}%{U$COLOR_FOREGROUND} ${name} %{-u}%{B-}%{F-}" + ;; + F*) + # focused free desktop + wm_infos="${wm_infos}%{F$COLOR_FOCUSED_FG}%{B$COLOR_FOCUSED_BG}%{U$COLOR_FOREGROUND} ${name} %{-u}%{B-}%{F-}" + ;; + U*) + # focused urgent desktop + wm_infos="${wm_infos}%{F$COLOR_FOCUSED_FG}%{B$COLOR_FOCUSED_BG}%{U$COLOR_FOREGROUND} ${name} %{-u}%{B-}%{F-}" + ;; +# o*) +# # occupied desktop +# wm_infos="${wm_infos}%{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG} ${name} %{B-}%{F-}" +# ;; +# f*) +# # free desktop +# wm_infos="${wm_infos}%{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG} ${name} %{B-}%{F-}" +# ;; +# u*) +# # urgent desktop +# wm_infos="${wm_infos}%{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG} ${name} %{B-}%{F-}" +# ;; +# L*) +# # layout +# wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG} ${name} %{B-}%{F-}" +# ;; + esac + shift + done + ;; + esac + printf "%s\n" "%{l}${wm_infos}${title}%{r}${playing}${paused}${cpu}${essid}${volume}${musicvol}${battery}${time_infos} " +done diff --git a/ratpoison/panel/panel_colors b/ratpoison/panel/panel_colors new file mode 100644 index 0000000..f436113 --- /dev/null +++ b/ratpoison/panel/panel_colors @@ -0,0 +1,33 @@ +source ~/.colors + + +COLOR_FOREGROUND="#FF`echo $COLOR11 | cut -c 2-`" +COLOR_BACKGROUND="#FF`echo $COLOR0 | cut -c 2-`" +COLOR_ACTIVE_MONITOR_FG='#FF34322E' +COLOR_ACTIVE_MONITOR_BG='#FF58C5F1' +COLOR_INACTIVE_MONITOR_FG='#FF58C5F1' +COLOR_INACTIVE_MONITOR_BG='#FF34322E' +COLOR_FOCUSED_OCCUPIED_FG='#FFF6F9FF' +COLOR_FOCUSED_OCCUPIED_BG='#FF5C5955' +COLOR_FOCUSED_FREE_FG='#FFF6F9FF' +COLOR_FOCUSED_FREE_BG='#FF6D561C' +COLOR_FOCUSED_URGENT_FG='#FF34322E' +COLOR_FOCUSED_URGENT_BG='#FFF9A299' +COLOR_OCCUPIED_FG='#FFA3A6AB' +COLOR_OCCUPIED_BG='#FF34322E' +COLOR_FREE_FG='#FF6F7277' +COLOR_FREE_BG='#FF34322E' +COLOR_URGENT_FG='#FFF9A299' +COLOR_URGENT_BG='#FF34322E' +COLOR_LAYOUT_FG='#FFA3A6AB' +COLOR_LAYOUT_BG='#FF34322E' + + +COLOR_FOCUSED_FG="#FF`echo $COLOR10 | cut -c 2-`" +COLOR_FOCUSED_BG="#FF`echo $COLOR0 | cut -c 2-`" + +COLOR_TITLE_FG="#FF`echo $COLOR11 | cut -c 2-`" +COLOR_TITLE_BG="#FF`echo $COLOR0 | cut -c 2-`" + +COLOR_STATUS_FG="#FF`echo $COLOR12 | cut -c 2-`" +COLOR_STATUS_BG="#FF`echo $COLOR0 | cut -c 2-`" diff --git a/ratpoison/panel/profile b/ratpoison/panel/profile new file mode 100644 index 0000000..c7a3ba0 --- /dev/null +++ b/ratpoison/panel/profile @@ -0,0 +1,4 @@ +PANEL_FIFO=/tmp/panel-fifo +PANEL_HEIGHT=24 +PANEL_FONT_FAMILY="-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1" +export PANEL_FIFO PANEL_HEIGHT PANEL_FONT_FAMILY diff --git a/ratpoison/pentfocus b/ratpoison/pentfocus deleted file mode 100755 index e8be6f8..0000000 --- a/ratpoison/pentfocus +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -ratpoison -c 'ratwarp 1332 568' -sleep 0.01 -ratpoison -c 'ratclick 1' -ratpoison -c banish diff --git a/ratpoison/py/color_detect.py b/ratpoison/py/color_detect.py deleted file mode 100644 index 30661f8..0000000 --- a/ratpoison/py/color_detect.py +++ /dev/null @@ -1,108 +0,0 @@ -import sys -import colorsys -from colorz import colorz -from math import sqrt - -try: - import Image -except ImportError: - from PIL import Image - -if len(sys.argv) < 2: - print "Usage: {0} FILENAME [num_colors]".format(sys.argv[0]) - sys.exit() - - -print sys.argv[1] - -WALLPAPER = sys.argv[1] -filename = WALLPAPER.split('/').pop() -COLORS = ".{0}.colors".format(filename) -XRESOURCES = ".{0}.Xres".format(filename) -SAMPLE = ".{0}.sample.png".format(filename) - -cols = '' -xres = '' - -def torgb(hexv): - hexv = hexv[1:] - r, g, b = ( - int(hexv[0:2], 16) / 256.0, - int(hexv[2:4], 16) / 256.0, - int(hexv[4:6], 16) / 256.0, - ) - return r, g, b - -def normalize(hexv, minv=128, maxv=256): - r, g, b = torgb(hexv) - h, s, v = colorsys.rgb_to_hsv(r, g, b) - minv = minv / 256.0 - maxv = maxv / 256.0 - if v < minv: - v = minv - if v > maxv: - v = maxv - r, g, b = colorsys.hsv_to_rgb(h, s, v) - return '#{:02x}{:02x}{:02x}'.format(int(r * 256), int(g * 256), int(b * 256)) - -def darkness(hexv): - r, g, b = torgb(hexv) - darkness = sqrt((255 - r) ** 2 + (255 - g) ** 2 + (255 - b) ** 2) - return darkness - -def to_hsv(c): - r, g, b = torgb(c) - h, s, v = colorsys.rgb_to_hsv(r, g, b) - return h, s, v - -def hex_color_to_rgb(color): - color = color[1:] if color[0]=="#" else color - return ( - int(color[:2], 16), - int(color[2:4], 16), - int(color[4:], 16) - ) - -def create_sample(f, colors): - im = Image.new("RGB", (1000, 100), "white") - pix = im.load() - - width_sample = im.size[0]/len(colors) - - for i, c in enumerate(colors): - for j in range(width_sample*i, width_sample*i+width_sample): - for k in range(0, 100): - pix[j, k] = hex_color_to_rgb(c) - - im.save(f) - -if __name__ == '__main__': - if len(sys.argv) == 2: - n = 16 - else: - n = int(sys.argv[2]) - - - i = 0 - # sort by value, saturation, then hue - colors = colorz(WALLPAPER, n=n) - colors.sort(key=lambda x:darkness(x), reverse=True) - for c in colors: - if i == 0: - c = normalize(c, minv=0, maxv=32) - elif i == 8: - c = normalize(c, minv=128, maxv=192) - elif i < 8: - c = normalize(c, minv=160, maxv=224) - else: - c = normalize(c, minv=200, maxv=256) - c = normalize(c, minv=32, maxv=224) - xres += """*color{}: {}\n""".format(i, c) - cols += """export COLOR{}="{}"\n""".format(i, c) - i += 1 - - create_sample(SAMPLE, colors) - with open(XRESOURCES, 'w') as f: - f.write(xres) - with open(COLORS, 'w') as f: - f.write(cols) diff --git a/ratpoison/py/colorz.py b/ratpoison/py/colorz.py deleted file mode 100644 index 8c00f0c..0000000 --- a/ratpoison/py/colorz.py +++ /dev/null @@ -1,71 +0,0 @@ -from collections import namedtuple -from math import sqrt -import random -try: - import Image -except ImportError: - from PIL import Image - -Point = namedtuple('Point', ('coords', 'n', 'ct')) -Cluster = namedtuple('Cluster', ('points', 'center', 'n')) - -def get_points(img): - points = [] - w, h = img.size - for count, color in img.getcolors(w * h): - points.append(Point(color, 3, count)) - return points - -rtoh = lambda rgb: '#%s' % ''.join(('%02x' % p for p in rgb)) - -def colorz(filename, n=3): - img = Image.open(filename) - img.thumbnail((200, 200)) - w, h = img.size - - points = get_points(img) - clusters = kmeans(points, n, 1) - rgbs = [map(int, c.center.coords) for c in clusters] - return map(rtoh, rgbs) - -def euclidean(p1, p2): - return sqrt(sum([ - (p1.coords[i] - p2.coords[i]) ** 2 for i in range(p1.n) - ])) - -def calculate_center(points, n): - vals = [0.0 for i in range(n)] - plen = 0 - for p in points: - plen += p.ct - for i in range(n): - vals[i] += (p.coords[i] * p.ct) - return Point([(v / plen) for v in vals], n, 1) - -def kmeans(points, k, min_diff): - clusters = [Cluster([p], p, p.n) for p in random.sample(points, k)] - - while 1: - plists = [[] for i in range(k)] - - for p in points: - smallest_distance = float('Inf') - for i in range(k): - distance = euclidean(p, clusters[i].center) - if distance < smallest_distance: - smallest_distance = distance - idx = i - plists[idx].append(p) - - diff = 0 - for i in range(k): - old = clusters[i] - center = calculate_center(plists[i], old.n) - new = Cluster(plists[i], center, old.n) - clusters[i] = new - diff = max(diff, euclidean(old.center, new.center)) - - if diff < min_diff: - break - - return clusters diff --git a/ratpoison/py/colorz.pyc b/ratpoison/py/colorz.pyc deleted file mode 100644 index 9c842d7..0000000 Binary files a/ratpoison/py/colorz.pyc and /dev/null differ diff --git a/ratpoison/ratpoisonrc.conf b/ratpoison/ratpoisonrc.conf index e010ff5..d50d8cc 100644 --- a/ratpoison/ratpoisonrc.conf +++ b/ratpoison/ratpoisonrc.conf @@ -48,13 +48,14 @@ exec xsetroot -cursor_name left_ptr #exec nitrogen --restore #Border & Padding -alias showpadding set border 3 -alias hidepadding set border 0 +alias showpadding set padding 10 10 10 10 +alias hidepadding set padding 0 0 0 0 showpadding barinpadding 0 -alias showborder set barpadding 0 0 -alias hideborder set barpadding 0 0 +alias showborder set border 3 +alias hideborder set border 0 +showborder set fwcolor #657b83 set bwcolor #839496 diff --git a/ratpoison/spotlight b/ratpoison/spotlight index 2ec8bfb..0544825 100755 --- a/ratpoison/spotlight +++ b/ratpoison/spotlight @@ -1,4 +1,4 @@ #!/bin/sh source ~/.colors -find ~/ -not -path "~/Games/*" -not -path "~/.mozilla/*" -not -path "~/dotfiles/vim/undodir/*" | sed 's/ /\\ /g' | dmenu -i -l 20 -nb $COLOR11 -nf $COLOR0 | xargs urxvt -e rifle -p0 +find ~/ -not -path "~/Games/*" -not -path "~/.mozilla/*" -not -path "~/dotfiles/vim/undodir/*" | sed 's/ /\\ /g' | dmenu -i -l 20 -sb $COLOR0 -nb $COLOR0 -nf $COLOR11 -sf $COLOR3 | xargs urxvt -e rifle -p0 exit 0 diff --git a/ratpoison/tray b/ratpoison/tray deleted file mode 100755 index 16fbb56..0000000 --- a/ratpoison/tray +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source ~/.colors - -mon_num=${1:-0} -width=${2:-0} -height=${3:-0} -x=${4:-0} -y=${5:-0} - -let x_offset=$x+$width-16 -stalonetray -bg $COLOR0 --geometry 1x1+$x_offset+$y --grow-gravity NE \ - --icon-size 16 --icon-gravity W --kludges force_icons_size diff --git a/ratpoison/wp b/ratpoison/wp index 4069e77..483e3c2 100755 --- a/ratpoison/wp +++ b/ratpoison/wp @@ -249,4 +249,7 @@ Actions #:: End function declaration, begin executing main $* -~/.ratpoison/ratcolor +~/.config/bspwm/colors +pkill panel +pkill stalone +~/bin/panel & disown diff --git a/ratpoison/xtoolwait b/ratpoison/xtoolwait new file mode 100755 index 0000000..6d07668 Binary files /dev/null and b/ratpoison/xtoolwait differ diff --git a/vimperatorrc b/vimperatorrc index 2a18f4e..0299182 100644 --- a/vimperatorrc +++ b/vimperatorrc @@ -1,44 +1,44 @@ "3.8.3 (created: 2014/11/09 13:19:01) -highlight Bell border: none; background-color: #586E75; -highlight Boolean color: #DC322F; -highlight CmdLine background: #EEE8D5; color: #586E75; transition: all 0.25s; -highlight CompDesc width: 500px; max-width: 500px; color: #859900; overflow: hidden; -highlight CompItem[selected] background: #EEE8D5; box-shadow: 0px 0px 1px #B58900; -highlight CompTitle font-weight: bold; background-color: #EEE8D5; -highlight CompTitle>* color: #657B83; border-top: 1px solid #657B83; border-bottom: 1px solid #657B83; padding: 1px 0.5ex; text-shadow: 1px 1px 0px #FDF6E3; -highlight ContentSeparator border-top: 1px dotted #93A1A1; display: -moz-box; -highlight Disabled color: #DC322F; -highlight Enabled color: #859900; -highlight ErrorMsg color: #FDF6E3; background: #DC322F; font-weight: bold; -highlight Filter color: #CB4B16; font-weight: bold; -highlight FrameIndicator background-color: #DC322F; opacity: 0.5; z-index: 999; position: fixed; top: 0; bottom: 0; left: 0; right: 0; -highlight Function color: 268BD2; -highlight Hint font-family: monospace; font-size: medium; font-weight: bold; text-transform: uppercase; color: #FDF6E3; background-color: #DC322F; border-color: ButtonShadow; border-width: 0px; border-style: solid; padding: 1px; z-index: 9999; -highlight HintActive background-color: #859900; color: #002B36; -highlight HintElem background-color: #B58900; color: #002B36; -highlight HintImage opacity: 0.5; -highlight Indicator color: #268BD2; -highlight InfoMsg color: #D33682; background: #FDF6E3; -highlight Keyword color: #DC322F; -highlight LineNr color: #CB4B16; background: #FDF6E3; -highlight Mapping color: #D33682; -highlight ModeMsg color: #FDF6E3; background: #859900; border-radius: 1px; padding: 0px 5px; -highlight MoreMsg color: #859900; background: #FDF6E3; -highlight NonText color: #268BD2; min-height: 16px; padding-left: 2px; -highlight Normal color: #586E75; background: #FDF6E3; -highlight Null color: #268BD2; -highlight Number color: #268BD2; -highlight Object color: #B58900; -highlight Preview color: #93A1A1; -highlight PromptText color: #FDF6E3; background: #6C71C4; -highlight Question color: #859900; background: #FDF6E3; font-weight: bold; -highlight StatusLine color: #657B83; background: transparent; font-weight: normal; -highlight String color: #859900; -highlight Tag color: #268BD2; -highlight Title color: #D33682; background: #FDF6E3; font-weight: bold; font-size: 120%; -highlight URL text-decoration: none; color: #268BD2; -highlight WarningMsg color: #DC322F; background: #FDF6E3; +"highlight Bell border: none; background-color: #586E75; +"highlight Boolean color: #DC322F; +"highlight CmdLine background: #EEE8D5; color: #586E75; transition: all 0.25s; +"highlight CompDesc width: 500px; max-width: 500px; color: #859900; overflow: hidden; +"highlight CompItem[selected] background: #EEE8D5; box-shadow: 0px 0px 1px #B58900; +"highlight CompTitle font-weight: bold; background-color: #EEE8D5; +"highlight CompTitle>* color: #657B83; border-top: 1px solid #657B83; border-bottom: 1px solid #657B83; padding: 1px 0.5ex; text-shadow: 1px 1px 0px #FDF6E3; +"highlight ContentSeparator border-top: 1px dotted #93A1A1; display: -moz-box; +"highlight Disabled color: #DC322F; +"highlight Enabled color: #859900; +"highlight ErrorMsg color: #FDF6E3; background: #DC322F; font-weight: bold; +"highlight Filter color: #CB4B16; font-weight: bold; +"highlight FrameIndicator background-color: #DC322F; opacity: 0.5; z-index: 999; position: fixed; top: 0; bottom: 0; left: 0; right: 0; +"highlight Function color: 268BD2; +"highlight Hint font-family: monospace; font-size: medium; font-weight: bold; text-transform: uppercase; color: #FDF6E3; background-color: #DC322F; border-color: ButtonShadow; border-width: 0px; border-style: solid; padding: 1px; z-index: 9999; +"highlight HintActive background-color: #859900; color: #002B36; +"highlight HintElem background-color: #B58900; color: #002B36; +"highlight HintImage opacity: 0.5; +"highlight Indicator color: #268BD2; +"highlight InfoMsg color: #D33682; background: #FDF6E3; +"highlight Keyword color: #DC322F; +"highlight LineNr color: #CB4B16; background: #FDF6E3; +"highlight Mapping color: #D33682; +"highlight ModeMsg color: #FDF6E3; background: #859900; border-radius: 1px; padding: 0px 5px; +"highlight MoreMsg color: #859900; background: #FDF6E3; +"highlight NonText color: #268BD2; min-height: 16px; padding-left: 2px; +"highlight Normal color: #586E75; background: #FDF6E3; +"highlight Null color: #268BD2; +"highlight Number color: #268BD2; +"highlight Object color: #B58900; +"highlight Preview color: #93A1A1; +"highlight PromptText color: #FDF6E3; background: #6C71C4; +"highlight Question color: #859900; background: #FDF6E3; font-weight: bold; +"highlight StatusLine color: #657B83; background: transparent; font-weight: normal; +"highlight String color: #859900; +"highlight Tag color: #268BD2; +"highlight Title color: #D33682; background: #FDF6E3; font-weight: bold; font-size: 120%; +"highlight URL text-decoration: none; color: #268BD2; +"highlight WarningMsg color: #DC322F; background: #FDF6E3; nnoremap l gt nnoremap h gT nnoremap s diff --git a/xinitrc b/xinitrc index 5afb6c8..0ae08eb 100755 --- a/xinitrc +++ b/xinitrc @@ -167,14 +167,14 @@ if [ $run_everything = true -o $run_workspace = 7 ]; then sleep 6 fi -# -## workspace 8 : windows workspace (VMware session) -#if [ $run_everything = true -o $run_workspace = 8 ]; then -# $workspace 8 -# #$xtoolwait gnomesu -c /stor/vmware/bin/vmware -# #number_and_title 0 "windows xp" -#fi -# + +# workspace 8 : windows workspace (VMware session) +if [ $run_everything = true -o $run_workspace = 8 ]; then + $workspace 8 + $xtoolwait $term rtorrent + number_and_title 0 "torrents" +fi + # workspace 9 : email workspace # window 1: mutt @@ -206,9 +206,10 @@ fi if [ $run_everything = true -o $run_workspace = 2 ]; then $workspace 12 cd $HOME/Music - $xtoolwait $term cmus + $xtoolwait $term mopidy + $xtoolwait $term ncmpcpp $ratpoison -c "meta 2" - number_and_title 0 "music" + number_and_title 0 "spotify" fi # workspace 13 : volume workspace -- cgit v1.2.3-54-g00ecf