Push inicial
This commit is contained in:
commit
9bf95fb086
|
@ -0,0 +1,17 @@
|
|||
FILES = bash_aliases \
|
||||
bashrc \
|
||||
bash_profile \
|
||||
h2statusrc \
|
||||
i3 \
|
||||
i3status.conf \
|
||||
inputrc
|
||||
|
||||
.PHONNY: symlinks
|
||||
|
||||
symlinks: $(FILES)
|
||||
@echo Making news symlinks...
|
||||
$(foreach FILE, $(FILES), ln -fs -T $(PWD)/$(FILE) $(HOME)/.$(FILE);)
|
||||
|
||||
install: root_bashrc
|
||||
@echo Installing root files...
|
||||
ln -fs $(PWD)/root_bashrc /root/.bashrc
|
|
@ -0,0 +1,13 @@
|
|||
alias binario='torify ssh binario@elbinario.net -p 3222'
|
||||
alias comeflores='ssh comeflores@comeflores.net -p 3222'
|
||||
alias torre='ssh drymer@torre'
|
||||
alias bittorrent='ssh werler@bittorrent'
|
||||
|
||||
alias ipcurl='curl ifconfig.me && curl --silent http://geoiptool.com/|grep maker_country | cut -d" " -f5 | cut -d"<" -f1 | head -n1'
|
||||
alias profanity='torify profanity'
|
||||
alias cuoc='cd /home/drymer/Documentos/UOC/'
|
||||
alias radio_bronka='mplayer http://stream.nonfqdn.net:8000/rbronka.ogg'
|
||||
alias radio_ela='mplayer -playlist http://www.radioela.org/radioela.m3u'
|
||||
alias khal="khal -c ~/.khal/config"
|
||||
alias smediacrush="scrot -d 5 'mediacrush.png' && mediacrush mediacrush.png && rm mediacrush.png"
|
||||
#alias emacs="emacs -nw"
|
|
@ -0,0 +1 @@
|
|||
source $HOME/.bashrc
|
|
@ -0,0 +1,41 @@
|
|||
# Set the default system $PATH:
|
||||
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
|
||||
|
||||
# I had problems with the backspace key using 'eval tset' instead of 'TERM=',
|
||||
# but you might want to try it anyway instead of the section below it. I
|
||||
# think with the right /etc/termcap it would work.
|
||||
# eval `tset -sQ "$TERM"`
|
||||
|
||||
# Set TERM to linux for unknown type or unset variable:
|
||||
if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
|
||||
TERM=linux
|
||||
fi
|
||||
|
||||
|
||||
# Notify user of incoming mail. This can be overridden in the user's
|
||||
# local startup file (~/.bash.login or whatever, depending on the shell)
|
||||
if [ -x /usr/bin/biff ]; then
|
||||
biff y 2> /dev/null
|
||||
fi
|
||||
|
||||
# Append any additional sh scripts found in /etc/profile.d/:
|
||||
for profile_script in /etc/profile.d/*.sh ; do
|
||||
if [ -x $profile_script ]; then
|
||||
. $profile_script
|
||||
fi
|
||||
done
|
||||
unset profile_script
|
||||
|
||||
source ~/.bash_aliases
|
||||
|
||||
#Green Prompt
|
||||
#PS1='\[\e[0;32m\]\u\[\e[31m\] % \[\e[0;32m\]\h \[\e[1;33m\]\w\[\e[0;32m\]\$ '
|
||||
#Blue Prompt
|
||||
PS1='\[\e[1;94m\]\u\[\e[0m\] % \[\e[1;91m\]\h \[\e[1;93m\]\w\[\e[1;34m\] $ \e[0m'
|
||||
|
||||
export EDITOR=/usr/bin/emacs
|
||||
export MAKEFLAGS=-j9
|
||||
|
||||
ESC="\033"
|
||||
NORMAL="\[$ESC[m\]"
|
||||
RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]"
|
|
@ -0,0 +1,83 @@
|
|||
(add-to-list 'load-path "~/.emacs.d/")
|
||||
|
||||
(global-set-key (kbd "C-x C-b") 'ibuffer)
|
||||
(tool-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
(menu-bar-mode -1)
|
||||
(global-set-key [f12] 'eshell)
|
||||
(setq auto-save-default nil)
|
||||
(custom-set-variables
|
||||
'(inhibit-startup-screen t))
|
||||
(custom-set-faces)
|
||||
|
||||
;;; Transparency
|
||||
(set-frame-parameter (selected-frame) 'alpha '(5 50))
|
||||
(add-to-list 'default-frame-alist '(alpha 5 50))
|
||||
;; C-8 will increase opacity (== decrease transparency)
|
||||
;; C-9 will decrease opacity (== increase transparency
|
||||
;; C-0 will returns the state to normal
|
||||
(global-set-key (kbd "C-8") '(lambda()(interactive)(djcb-opacity-modify)))
|
||||
(global-set-key (kbd "C-9") '(lambda()(interactive)(djcb-opacity-modify t)))
|
||||
(global-set-key (kbd "C-0") '(lambda()(interactive)
|
||||
(modify-frame-parameters nil `((alpha . 100)))))
|
||||
;;;Lines Numeration
|
||||
(add-hook 'find-file-hook (lambda () (linum-mode 1)))
|
||||
(global-linum-mode 1)
|
||||
(setq linum-format "%4d \u2502 ")
|
||||
|
||||
;;;Auto-indent
|
||||
(global-set-key (kbd "RET") 'newline-and-indent)
|
||||
|
||||
;;;Compile comand
|
||||
(setq compile-command "gcc -U_FORTIFY_SOURCE -Wall -Wuninitialized -Werror -O1")
|
||||
|
||||
;;; Markdown mode
|
||||
(autoload 'markdown-mode "markdown-mode"
|
||||
"Major mode for editing Markdown files" t)
|
||||
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
|
||||
;; Preview
|
||||
(autoload 'markdown-preview "realtime-markdown-viewer"
|
||||
"Display markdown on a browser in realtime" t)
|
||||
|
||||
;;; Install From Melpa
|
||||
(when (>= emacs-major-version 24)
|
||||
(require 'package)
|
||||
(package-initialize)
|
||||
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
|
||||
)
|
||||
|
||||
;;; PHP Mode
|
||||
(defun my-setup-php ()
|
||||
;; enable web mode
|
||||
(web-mode)
|
||||
|
||||
; auto-complete mode
|
||||
(require 'auto-complete)
|
||||
(auto-complete-mode t)
|
||||
|
||||
;; make these variables local
|
||||
(make-local-variable 'web-mode-code-indent-offset)
|
||||
(make-local-variable 'web-mode-markup-indent-offset)
|
||||
(make-local-variable 'web-mode-css-indent-offset)
|
||||
|
||||
;; set indentation, can set different indentation level for different code type
|
||||
(setq web-mode-code-indent-offset 4)
|
||||
(setq web-mode-css-indent-offset 2)
|
||||
(setq web-mode-markup-indent-offset 2))
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.php$" . my-setup-php))
|
||||
|
||||
(setq web-mode-ac-sources-alist
|
||||
'(("css" . (ac-source-words-in-buffer ac-source-css-property))
|
||||
("html" . (ac-source-words-in-buffer ac-source-abbrev))
|
||||
("php" . (ac-source-words-in-buffer
|
||||
ac-source-words-in-same-mode-buffers
|
||||
ac-source-dictionary))))
|
||||
;Activar la función anterior
|
||||
(add-to-list 'auto-mode-alist '("\\.php$" . my-setup-php))
|
||||
|
||||
;; Gatete
|
||||
(nyan-mode)
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Use this as a template for your own configuration, to be placed in ~/.h2statusrc.
|
||||
# All three functions are optional as a default NOP implementation is provided.
|
||||
# Remember to configure output_format = "i3bar" in ~/.i3status.conf.
|
||||
|
||||
# theme
|
||||
black_dark="#2e3436"
|
||||
black_light="#6e706b"
|
||||
red_dark="#cc0000"
|
||||
red_light="#ef2929"
|
||||
green_dark="#4e9a06"
|
||||
green_light="#8ae234"
|
||||
yellow_dark="#edd400"
|
||||
yellow_light="#fce94f"
|
||||
blue_dark="#3465a4"
|
||||
blue_light="#729fcf"
|
||||
magenta_dark="#92659a"
|
||||
magenta_light="#c19fbe"
|
||||
cyan_dark="#07c7ca"
|
||||
cyan_light="#63e9e9"
|
||||
orange_dark="F57900"
|
||||
orange_light="#FCAF3E"
|
||||
grey_dark="#fdf6e3"
|
||||
|
||||
function status {
|
||||
local POMODORO="$(~/.i3/pomodoro status)"
|
||||
local SENSOR="$(sensors | grep "Physical id 0" | awk '{print $4}')"
|
||||
|
||||
case "${POMODORO}" in
|
||||
work)
|
||||
entry pomodoro " $(~/.i3/pomodoro)" "\"color\":\"${red_light}\""
|
||||
;;
|
||||
break)
|
||||
entry pomodoro " $(~/.i3/pomodoro)" "\"color\":\"${green_light}\""
|
||||
;;
|
||||
*)
|
||||
entry pomodoro ""
|
||||
;;
|
||||
esac
|
||||
if [[ "${POMODORO}" != "work" ]]; then
|
||||
entry mail "$(cached_status mail 60 '~/.i3/mail')" \
|
||||
"\"color\":\"${orange_light}\""
|
||||
fi
|
||||
entry weather "$(cached_status weather 300 '~/.i3/weather')"
|
||||
entry sensor " ${SENSOR#+}"
|
||||
}
|
||||
|
||||
function on_event {
|
||||
case $name in
|
||||
mail) [[ $button == 1 ]] && write_status mail "$(~/.i3/mail)" ;;
|
||||
weather) [[ $button == 1 ]] && write_status weather "$(~/.i3/weather)" ;;
|
||||
pomodoro) [[ $button == 1 ]] && ~/.i3/pomodoro switch
|
||||
;;
|
||||
volume) if [[ $button == 4 ]]; then
|
||||
amixer -D pulse set Master 1%+ && killall -SIGUSR1 i3status
|
||||
elif [[ $button == 5 ]]; then
|
||||
amixer -D pulse set Master 1%- && killall -SIGUSR1 i3status
|
||||
elif [[ $button == 1 ]]; then
|
||||
amixer -D pulse set Master toggle && killall -SIGUSR1 i3status
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function transform {
|
||||
AUDIO="$(amixer get Master | grep 'Front Left:')"
|
||||
AUDIO=${AUDIO#*[}
|
||||
AUDIO=${AUDIO%%\%*}
|
||||
[[ ${AUDIO} -lt 50 ]] && AICON="" || AICON=""
|
||||
|
||||
sed -r "s/♪://g
|
||||
s/VOLUME [^%]*/${AICON} ${AUDIO}/g;
|
||||
s/\"name\":\"mail\",\"full_text\":\"\",\"color\":\"${orange_light}\"/\"name\":\"mail\",\"full_text\":\"\",\"color\":\"${grey_dark}\"/g"
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
|
||||
case $1; in
|
||||
tornado
|
||||
tropical storm
|
||||
hurricane
|
||||
severe thunderstorms
|
||||
thunderstorms
|
||||
mixed rain and snow
|
||||
mixed rain and sleet
|
||||
mixed snow and sleet
|
||||
freezing drizzle
|
||||
drizzle
|
||||
freezing rain
|
||||
showers
|
||||
showers
|
||||
snow flurries
|
||||
light snow showers
|
||||
blowing snow
|
||||
snow
|
||||
hail
|
||||
sleet
|
||||
dust
|
||||
foggy
|
||||
haze
|
||||
smoky
|
||||
blustery
|
||||
windy
|
||||
cold
|
||||
cloudy
|
||||
mostly cloudy (night)
|
||||
mostly cloudy (day)
|
||||
partly cloudy (night)
|
||||
partly cloudy (day)
|
||||
clear (night)
|
||||
sunny
|
||||
fair (night)
|
||||
fair (day)
|
||||
mixed rain and hail
|
||||
hot
|
||||
isolated thunderstorms
|
||||
scattered thunderstorms
|
||||
scattered thunderstorms
|
||||
scattered showers
|
||||
heavy snow
|
||||
scattered snow showers
|
||||
heavy snow
|
||||
partly cloudy
|
||||
thundershowers
|
||||
snow showers
|
||||
isolated thundershowers
|
||||
not available
|
||||
done
|
Binary file not shown.
|
@ -0,0 +1,231 @@
|
|||
# This file has been auto-generated by i3-config-wizard(1).
|
||||
# It will not be overwritten, so edit it as you like.
|
||||
#
|
||||
# Should you change your keyboard layout somewhen, delete
|
||||
# this file and re-run i3-config-wizard(1).
|
||||
#
|
||||
|
||||
# i3 config file (v4)
|
||||
#
|
||||
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
|
||||
# Tango colors
|
||||
# $i3-status
|
||||
set color_bad = "#CC0000"
|
||||
set color_degraded = "#EDD400"
|
||||
set color_good = "#73D216"
|
||||
|
||||
# $i3-theme-window
|
||||
# tango dark
|
||||
set $darkblue #204A87
|
||||
set $darkbrown #8F5902
|
||||
set $darkgreen #4E9A06
|
||||
set $darkmagenta #5C3566
|
||||
set $darkred #A40000
|
||||
set $darkyellow #C4A000
|
||||
set $darkorange #CE5C00
|
||||
|
||||
# tango light
|
||||
set $lightblue #729FCF
|
||||
set $lightbrown #E9B96E
|
||||
set $lightgreen #8AE234
|
||||
set $lightmagenta #AD7FA8
|
||||
set $lightred #EF2929
|
||||
set $lightyellow #FCE94F
|
||||
set $lightorange #FCAF3E
|
||||
|
||||
# tango normal
|
||||
set $blue #3465A4
|
||||
set $brown #C17D11
|
||||
set $green #73D216
|
||||
set $magenta #75507B
|
||||
set $red #CC0000
|
||||
set $yellow #EDD400
|
||||
set $orange #F57900
|
||||
|
||||
# tango mono
|
||||
set $black #555753
|
||||
set $grey #BABDB6
|
||||
set $white #EEEEEC
|
||||
set $darkblack #2E3436
|
||||
set $darkgrey #888A85
|
||||
set $darkwhite #D3D7CF
|
||||
|
||||
set $mod Mod4
|
||||
|
||||
# font for window titles. ISO 10646 = Unicode
|
||||
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||
#font pango:DejaVu Sans Mono 10
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
#Display
|
||||
set $display LVDS1
|
||||
|
||||
#Multimedia
|
||||
bindsym XF86AudioLowerVolume exec amixer -c 0 set Master 2dB-
|
||||
bindsym XF86AudioRaiseVolume exec amixer -c 0 set Master 2dB+
|
||||
bindsym XF86AudioMute exec amixer -c 0 set Master toggle
|
||||
bindsym $mod+U exec amixer set Master unmute
|
||||
|
||||
|
||||
# start a terminal
|
||||
bindsym $mod+Return exec xfce4-terminal
|
||||
# kill focused window
|
||||
bindsym $mod+Shift+Q kill
|
||||
|
||||
# start dmenu (a program launcher)
|
||||
bindsym $mod+d exec dmenu_run
|
||||
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym $mod+Shift+r restart
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
# split in horizontal orientation
|
||||
bindsym $mod+h split h
|
||||
|
||||
# split in vertical orientation
|
||||
bindsym $mod+v split v
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# change container layout (stacked, tabbed, default)
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout default
|
||||
|
||||
# toggle tiling / floating
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# change focus between tiling / floating windows
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# focus the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# focus the child container
|
||||
#bindcode $mod+d focus child
|
||||
|
||||
# workspace names
|
||||
workspace "1:Mail" output $display
|
||||
workspace "2:WWW" output $display
|
||||
workspace "3:Chat" output $display
|
||||
workspace "4:Shell" output $display
|
||||
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace 1:Mail
|
||||
bindsym $mod+2 workspace 2:WWW
|
||||
bindsym $mod+3 workspace 3:Chat
|
||||
bindsym $mod+4 workspace 4:Shell
|
||||
bindsym $mod+5 workspace 5
|
||||
bindsym $mod+6 workspace 6
|
||||
bindsym $mod+7 workspace 7
|
||||
bindsym $mod+8 workspace 8
|
||||
bindsym $mod+9 workspace 9
|
||||
bindsym $mod+Shift+1 move container to workspace 1:Mail
|
||||
bindsym $mod+Shift+2 move container to workspace 2:WWW
|
||||
bindsym $mod+Shift+3 move container to workspace 3:Chat
|
||||
bindsym $mod+Shift+4 move container to workspace 4:Shell
|
||||
bindsym $mod+Shift+5 move container to workspace 5
|
||||
bindsym $mod+Shift+6 move container to workspace 6
|
||||
bindsym $mod+Shift+7 move container to workspace 7
|
||||
bindsym $mod+Shift+8 move container to workspace 8
|
||||
bindsym $mod+Shift+9 move container to workspace 9
|
||||
|
||||
|
||||
# resize window (you can also use the mouse for that)
|
||||
mode "resize" {
|
||||
# These bindings trigger as soon as you enter the resize mode
|
||||
|
||||
# Pressing left will shrink the window’s width.
|
||||
# Pressing right will grow the window’s width.
|
||||
# Pressing up will shrink the window’s height.
|
||||
# Pressing down will grow the window’s height.
|
||||
bindsym j resize shrink width 10 px or 10 ppt
|
||||
bindsym k resize grow height 10 px or 10 ppt
|
||||
bindsym l resize shrink height 10 px or 10 ppt
|
||||
bindsym ntilde resize grow width 10 px or 10 ppt
|
||||
|
||||
# same bindings, but for the arrow keys
|
||||
bindsym Left resize shrink width 10 px or 10 ppt
|
||||
bindsym Down resize grow height 10 px or 10 ppt
|
||||
bindsym Up resize shrink height 10 px or 10 ppt
|
||||
bindsym Right resize grow width 10 px or 10 ppt
|
||||
|
||||
# back to normal: Enter or Escape
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# Start i3bar to display a workspace bar (plus the system information i3status
|
||||
# finds out, if available)
|
||||
bar {
|
||||
font pango:Dyuthi3, Awesome, Icons 10
|
||||
status_command ~/.i3/h2status
|
||||
position top
|
||||
colors {
|
||||
background #222222
|
||||
separator #444444
|
||||
statusline $darkgrey
|
||||
###XXX: Details border backgr. text
|
||||
focused_workspace $lightblue $blue $white
|
||||
inactive_workspace $darkgrey $black $grey
|
||||
active_workspace $black $darkblack $grey
|
||||
urgent_workspace $lightred $red $white
|
||||
}
|
||||
}
|
||||
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
|
||||
|
||||
|
||||
#shutdown
|
||||
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
|
||||
mode "$mode_system" {
|
||||
bindsym l exec --no-startup-id ~/.i3/exit lock, mode "default"
|
||||
bindsym s exec --no-startup-id ~/.i3/exit pm-suspend, mode "default"
|
||||
bindsym r exec --no-startup-id ~/.i3/exit reboot, mode "default"
|
||||
bindsym e exec --no-startup-id ~/.i3/exit logout, mode "default"
|
||||
bindsym Shift+s exec --no-startup-id ~/.i3/exit shutdown, mode "default"
|
||||
|
||||
# back to normal: Enter or Escape
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+Escape mode "$mode_system"
|
||||
|
||||
#windows colors
|
||||
new_window pixel
|
||||
# class border backgr. text indicator
|
||||
client.focused $lightblue $blue $white $lightblue
|
||||
client.focused_inactive $darkgrey $black $grey $darkgrey
|
||||
client.unfocused $black $darkblack $grey $darkgrey
|
||||
client.urgent $lightred $red $white $lightred
|
||||
|
||||
#startup
|
||||
exec --no-startup-id feh /home/drymer/Imagenes/Fondos\ de\ pantalla/aYqTE6i.png --bg-scale
|
||||
|
||||
#Layout
|
||||
assign [class="(?i)thunderbird"] "1:Mail"
|
||||
assign [class="(?i)firefox"] "2:WWW"
|
||||
assign [title="(Acerca de Tor\ -\ Navegador\ Tor"] "2:WWW"
|
||||
assign [title="bittorrent"] "3:Chat"
|
||||
for_window [window_role="Preferences"] floating enable
|
||||
for_window [window_role="help-browser"] floating enable
|
||||
for_window [class="(?i)xcalc"] floating enable
|
||||
for_window [class="Lxappearance"] floating enable
|
||||
for_window [window_role="pop-up"] floating enable
|
||||
for_window [window_role="About"] floating enable
|
|
@ -0,0 +1 @@
|
|||
Subproject commit c18a59d802164175247a2fe74bed2fea7faad505
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh
|
||||
lock() {
|
||||
slock
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
lock)
|
||||
lock
|
||||
;;
|
||||
logout)
|
||||
i3-msg exit
|
||||
;;
|
||||
suspend)
|
||||
lock && pm-suspend
|
||||
;;
|
||||
hibernate)
|
||||
lock && dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
|
||||
;;
|
||||
reboot)
|
||||
sudo /sbin/shutdown -r now
|
||||
;;
|
||||
shutdown)
|
||||
sudo /sbin/shutdown -h now
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,58 @@
|
|||
#!/bin/bash
|
||||
|
||||
function status { :; }
|
||||
|
||||
function on_event { :; }
|
||||
|
||||
function transform { cat; }
|
||||
|
||||
function entry {
|
||||
echo -ne '{"name":"'$1'","full_text":"'$2'"'${3:+,$3}'},'
|
||||
}
|
||||
|
||||
function cached_status {
|
||||
local file=$tmp$1 interval=$2 command=$3
|
||||
read_status $1
|
||||
[[ -f $file ]] && (( $(date +%s) - $(stat -c %Y $file) < $interval )) && return
|
||||
touch $file
|
||||
{ write_status $1 "$(eval $command)"; } >/dev/null &
|
||||
}
|
||||
|
||||
function read_status {
|
||||
[[ -f $tmp$1 ]] && flock -s ${tmp}lock -c "cat $tmp$1"
|
||||
}
|
||||
|
||||
function write_status {
|
||||
flock ${tmp}lock -c "echo '$2' > $tmp$1"
|
||||
update
|
||||
}
|
||||
|
||||
function update {
|
||||
killall -USR1 i3status
|
||||
}
|
||||
|
||||
function event_loop {
|
||||
while read line
|
||||
do
|
||||
eval $(echo "$line" | sed -re 's/^,|\{|\}|"//g' -e 'y/,:/;=/')
|
||||
on_event > /dev/null
|
||||
done
|
||||
}
|
||||
|
||||
function status_loop {
|
||||
read; read; echo -e '{"version":1,"click_events":true}\n['
|
||||
while read line
|
||||
do
|
||||
echo "$line" | sed -r 's/^(,?\[)\{/\1'"$(status)"'{/' | transform
|
||||
done
|
||||
}
|
||||
|
||||
tmp=/tmp/h2status_
|
||||
[[ $1 == "update" && ! $2 ]] && { update; exit 0; }
|
||||
[[ $1 == "write" && $2 && $3 && ! $4 ]] && { write_status $2 "$3"; exit 0; }
|
||||
[[ $* ]] && { echo "Usage: h2status [update|write <module> <value>]"; exit 1; }
|
||||
. ~/.h2statusrc
|
||||
trap 'rm -f $tmp*; exit' EXIT INT TERM HUP
|
||||
rm -f $tmp*
|
||||
i3status | status_loop &
|
||||
event_loop
|
Binary file not shown.
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
TMP=/var/run/openvpn.pid
|
||||
|
||||
ps="$(ps aux|grep openvpn | grep 'openvpn --config' | grep -v grep | cut -d' ' -f1)"
|
||||
|
||||
if [ -z $ps ];
|
||||
then
|
||||
if [ -e $TMP ];
|
||||
then
|
||||
rm $TMP
|
||||
fi
|
||||
else
|
||||
echo $(pidof openvpn) > $TMP
|
||||
fi
|
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
TMP=/tmp/drymer-pomodoro.pid
|
||||
|
||||
pomodoro_time=1500
|
||||
break_time=300
|
||||
long_break=4
|
||||
|
||||
if [[ -f ${TMP} ]]; then
|
||||
read date1 state count < ${TMP}
|
||||
if [[ ${1} == switch ]]; then
|
||||
echo "stop!"
|
||||
rm ${TMP}
|
||||
exit
|
||||
elif [[ ${1} == status ]]; then
|
||||
echo ${state}
|
||||
exit
|
||||
fi
|
||||
date2=$(date +"%s")
|
||||
diff=$(($date2-$date1))
|
||||
if [[ ${state} == "work" ]]; then
|
||||
if [[ ${diff} -le ${pomodoro_time} ]]; then
|
||||
time=$(($pomodoro_time-$diff))
|
||||
min=$(($time/60))
|
||||
sec=$(($time%60))
|
||||
printf "%0*d:%0*d\n" 2 ${min} 2 ${sec}
|
||||
else
|
||||
mplayer ~/.i3/loud-bell.ogg 2> /dev/null &
|
||||
if [[ ${count} -lt ${long_break} ]]; then
|
||||
echo "00:00"
|
||||
notify-send "Pomodoro" "Take a break!"
|
||||
echo "$(date +"%s") break ${count}" > ${TMP}
|
||||
else
|
||||
echo "00:00"
|
||||
notify-send "Pomodoro" "Take a long break!" &
|
||||
rm ${TMP}
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [[ ${diff} -le ${break_time} ]]; then
|
||||
time=$(($break_time-$diff))
|
||||
min=$(($time/60))
|
||||
sec=$(($time%60))
|
||||
printf "%0*d:%0*d\n" 2 ${min} 2 ${sec}
|
||||
else
|
||||
echo "00:00"
|
||||
mplayer ~/.i3/bell.ogg 2> /dev/null &
|
||||
echo "$(date +"%s") work $((++count))" > ${TMP}
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [[ ${1} == switch ]]; then
|
||||
echo "start!"
|
||||
mplayer ~/.i3/bell.ogg 2> /dev/null &
|
||||
echo "$(date +"%s") work 1" > ${TMP}
|
||||
elif [[ ${1} == status ]]; then
|
||||
echo "stop"
|
||||
fi
|
||||
fi
|
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
|
||||
readonly TMP="$(mktemp /tmp/openweather.XXXXXX)"
|
||||
|
||||
CITY="Barcelona, ES"
|
||||
UNITS=metric
|
||||
URL="http://api.openweathermap.org/data/2.5/weather"
|
||||
|
||||
wget -q "${URL}?q=${CITY}&mode=xml&units=${UNITS}" -O ${TMP}
|
||||
|
||||
TEMPERATURE=$(xmllint --xpath "string(//temperature/@value)" ${TMP})
|
||||
WEATHER=$(xmllint --xpath "string(//weather/@icon)" ${TMP})
|
||||
if [[ $? -ne 0 ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
rm ${TMP}
|
||||
|
||||
case ${WEATHER} in
|
||||
01d|02d)
|
||||
ICON=""
|
||||
;;
|
||||
01n|02n)
|
||||
ICON=""
|
||||
;;
|
||||
03*|04*)
|
||||
ICON=""
|
||||
;;
|
||||
09*|10*)
|
||||
ICON=""
|
||||
;;
|
||||
11*)
|
||||
ICON=""
|
||||
;;
|
||||
13*)
|
||||
ICON=""
|
||||
;;
|
||||
50*)
|
||||
ICON=""
|
||||
;;
|
||||
esac
|
||||
|
||||
TEMPERATURE=${TEMPERATURE%%.*}
|
||||
echo "${ICON}" "${TEMPERATURE}Cº"
|
|
@ -0,0 +1,63 @@
|
|||
# i3status configuration file.
|
||||
# see "man i3status" for documentation.
|
||||
|
||||
# It is important that this file is edited as UTF-8.
|
||||
# The following line should contain a sharp s:
|
||||
# ß
|
||||
# If the above line is not correctly displayed, fix your editor first!
|
||||
|
||||
|
||||
general {
|
||||
output_format = "i3bar"
|
||||
#colors = true
|
||||
color_good = "#12A90D"
|
||||
color_bad = "#CC0000"
|
||||
color_degraded = "#EDD400"
|
||||
interval = 1
|
||||
}
|
||||
|
||||
#order += "run_watch VPN"
|
||||
order += "battery 0"
|
||||
order += "volume master"
|
||||
order += "ethernet eth0"
|
||||
order += "tztime local"
|
||||
|
||||
|
||||
wireless wlan0 {
|
||||
format_up = "Wifi: (%quality at %essid, %bitrate) %ip"
|
||||
format_up = "%ip"
|
||||
format_down = ""
|
||||
}
|
||||
|
||||
run_watch VPN {
|
||||
pidfile = "/var/run/openvpn.pid"
|
||||
# format_up = "VPN"
|
||||
# format_down = "ho"
|
||||
}
|
||||
|
||||
ethernet eth0 {
|
||||
# if you use %speed, i3status requires the cap_net_admin capability
|
||||
format_up = ""
|
||||
format_down = ""#""
|
||||
}
|
||||
|
||||
battery 0 {
|
||||
format = " %percentage"
|
||||
path = "/sys/class/power_supply/BAT%d/uevent"
|
||||
low_threshold = 10
|
||||
#format_up = "a"
|
||||
format_down = ""
|
||||
last_full_capacity = true
|
||||
}
|
||||
#meter vpn
|
||||
tztime local {
|
||||
format = " %a %b %d | %H:%M:%S"
|
||||
}
|
||||
|
||||
volume master {
|
||||
format = ": %volume"
|
||||
device = "default"
|
||||
mixer = "Master"
|
||||
mixer_idx = 0
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
# /etc/inputrc
|
||||
# This file configures keyboard input for programs using readline.
|
||||
# See "man 3 readline" for more examples.
|
||||
|
||||
# Configure the system bell. Options are none, visible, and audible.
|
||||
#set bell-style none
|
||||
|
||||
# Enable 8 bit input.
|
||||
set meta-flag On
|
||||
set input-meta On
|
||||
set convert-meta Off
|
||||
set output-meta On
|
||||
|
||||
# Set various nice escape sequences:
|
||||
"\eOd": backward-word
|
||||
"\eOc": forward-word
|
||||
|
||||
# for linux console
|
||||
"\e[1~": beginning-of-line
|
||||
"\e[4~": end-of-line
|
||||
"\e[5~": beginning-of-history
|
||||
"\e[6~": end-of-history
|
||||
"\e[3~": delete-char
|
||||
"\e[2~": quoted-insert
|
||||
|
||||
# for xterm
|
||||
"\eOH": beginning-of-line
|
||||
"\eOF": end-of-line
|
||||
|
||||
# for freebsd console
|
||||
"\e[H": beginning-of-line
|
||||
"\e[F": end-of-line
|
||||
|
||||
"\e[1~": beginning-of-line
|
||||
"\e[4~": end-of-line
|
||||
"\e[7~": beginning-of-line
|
||||
"\e[8~": end-of-line
|
||||
"\eOH": beginning-of-line
|
||||
"\eOF": end-of-line
|
||||
"\e[H": beginning-of-line
|
||||
"\e[F": end-of-line
|
|
@ -0,0 +1,125 @@
|
|||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||
# for examples
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
#shopt -s globstar
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color) color_prompt=yes;;
|
||||
esac
|
||||
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
#force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1='\[\e[1;34m\]\u\[\e[0m\] % \[\e[31m\]\h \[\e[93m\]\w\[\e[1;34m\] $ '
|
||||
else
|
||||
PS1='\[\e[1;34m\]\u\[\e[0m\] % \[\e[31m\]\h \[\e[93m\]\w\[\e[1;34m\] $ '
|
||||
fi
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PS1='\[\e[1;34m\]\u\[\e[0m\] % \[\e[31m\]\h \[\e[93m\]\w\[\e[1;34m\] $ '
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# some more ls aliases
|
||||
#alias ll='ls -l'
|
||||
#alias la='ls -A'
|
||||
#alias l='ls -CF'
|
||||
|
||||
# Alias definitions.
|
||||
# You may want to put all your additions into a separate file like
|
||||
# ~/.bash_aliases, instead of adding them here directly.
|
||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
#Blue Prompt
|
||||
PS1='\[\e[1;94m\]\u\[\e[0m\] % \[\e[1;91m\]\h \[\e[1;93m\]\w\[\e[1;34m\] # \e[0m'
|
||||
|
||||
export EDITOR="/usr/bin/emacs -nw"
|
||||
|
||||
alias busca='slackpkg file-search'
|
||||
alias instala='slackpkg install'
|
||||
alias quita='slackpkg remove'
|
||||
alias reinstala='slackpkg reinstall'
|
||||
alias actualiza="slackpkg update && slackpkg upgrade-all"
|
||||
|
||||
alias git="torify git"
|
||||
alias emacs="emacs -nw"
|
||||
|
||||
export MAKEFLAGS=-j9
|
Loading…
Reference in New Issue