moved from private repo
This commit is contained in:
commit
c44ffa7d21
21
_Xdefaults
Normal file
21
_Xdefaults
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
xterm*font: -xos4-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*
|
||||||
|
URxvt.font: -xos4-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*
|
||||||
|
URxvt*termName: xterm-color
|
||||||
|
URxvt*geometry: 80x20
|
||||||
|
URxvt*foreground: white
|
||||||
|
URxvt*background: black
|
||||||
|
URxvt*transparent: false
|
||||||
|
URxvt*tintColor: white
|
||||||
|
URxvt*highlightColor: #a00
|
||||||
|
URxvt*shading: 10
|
||||||
|
URxvt*fading: 10
|
||||||
|
URxvt*fadeColor: black
|
||||||
|
URxvt*fg: white
|
||||||
|
URxvt*loginShell: true
|
||||||
|
URxvt*scrollBar: false
|
||||||
|
URxvt.keysym.Control-Up: \033[1;5A
|
||||||
|
URxvt.keysym.Control-Down: \033[1;5B
|
||||||
|
URxvt.keysym.Control-Left: \033[1;5D
|
||||||
|
URxvt.keysym.Control-Right: \033[1;5C
|
||||||
|
URxvt*keysym.Home: \033[1~
|
||||||
|
URxvt*keysym.End: \033[4~
|
50
_Xdefaults__idefix.armorique.lan
Normal file
50
_Xdefaults__idefix.armorique.lan
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
URxvt*termName: xterm-256colorURxvt*background: #000000
|
||||||
|
URxvt*foreground: #ffffff
|
||||||
|
URxvt*scrollBar_right: false
|
||||||
|
URxvt*scrollBar: false
|
||||||
|
URxvt*inheritPixmap: true
|
||||||
|
URxvt*geometry: 84x24
|
||||||
|
URxvt*tint: white
|
||||||
|
URxvt*font: xft:DejaVu Sans Mono:style=Regular:pixelsize=12:antialias=true
|
||||||
|
URxvt*color0: #000000
|
||||||
|
URxvt*color1: #A80000
|
||||||
|
URxvt*color2: #00A800
|
||||||
|
URxvt*color3: #A85400
|
||||||
|
URxvt*color4: #5555AA
|
||||||
|
URxvt*color5: #A800A8
|
||||||
|
URxvt*color6: #00A8A8
|
||||||
|
URxvt*color7: #FFFFFF
|
||||||
|
URxvt*color8: #545054
|
||||||
|
URxvt*color9: #F85450
|
||||||
|
URxvt*color10: #50FC50
|
||||||
|
URxvt*color11: #F2FC50
|
||||||
|
URxvt*color12: #5054F8
|
||||||
|
URxvt*color13: #F854F8
|
||||||
|
URxvt*color14: #50FCF8
|
||||||
|
URxvt*color15: #F8FCF8
|
||||||
|
URxvt*urgentOnBell: true
|
||||||
|
URxvt*visualBell: true
|
||||||
|
URxvt*fading: 50
|
||||||
|
URxvt*fadeColor: black
|
||||||
|
URxvt*tintColor: white
|
||||||
|
URxvt*shading: 30
|
||||||
|
URxvt*blurRadius: 5
|
||||||
|
URxvt*urlLauncher:firefox
|
||||||
|
URxvt*jumpScroll: true
|
||||||
|
URxvt*scrollWithBuffer: true
|
||||||
|
URxvt*scrollTtyOutput: false
|
||||||
|
URxvt*scrollTtyKeypress: true
|
||||||
|
|
||||||
|
xterm*termName: xterm
|
||||||
|
xterm*background: #000000
|
||||||
|
xterm*foreground: #A8A8A8
|
||||||
|
XTerm*loginShell: true
|
||||||
|
XTerm*termName: xterm-color
|
||||||
|
XTerm*faceName: Terminus
|
||||||
|
XTerm*faceSize: 10
|
||||||
|
!XTerm*internalBorder: 10
|
||||||
|
XTerm*highlightSelection: true
|
||||||
|
XTerm*cursorBlink: false
|
||||||
|
XTerm*utf8: 1
|
||||||
|
XTerm*scrollBar: false
|
||||||
|
Xterm*scrollBarBorder: 0
|
53
_bash_aliases
Normal file
53
_bash_aliases
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
alias ll='ls -lhF'
|
||||||
|
alias la='ls -AF'
|
||||||
|
alias l='ls -CF'
|
||||||
|
alias lla='ls -alF'
|
||||||
|
alias scp='scp -C'
|
||||||
|
alias ssh='ssh -C'
|
||||||
|
alias cp='cp -i'
|
||||||
|
alias mv='mv -i'
|
||||||
|
alias rm='rm -i'
|
||||||
|
alias df='df -h'
|
||||||
|
case "$(uname -s)" in
|
||||||
|
FreeBSD)
|
||||||
|
alias ls='ls -GF'
|
||||||
|
alias t='todo -d ~/.todo.cfg'
|
||||||
|
alias grep='grep --color=auto'
|
||||||
|
;;
|
||||||
|
Linux)
|
||||||
|
alias ls='ls --color=auto -vF'
|
||||||
|
alias t='~/sources/todo.txt-cli/todo.sh -d ~/.todo.cfg'
|
||||||
|
alias grep='grep --color=auto'
|
||||||
|
;;
|
||||||
|
OpenBSD)
|
||||||
|
alias startx="/usr/X11R6/bin/startx & lock -np"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
alias less='less -X'
|
||||||
|
alias youtube='youtube-dl -o "$YDL_TARGET/%(title)s.%(ext)s" --restrict-filenames --prefer-free-formats '
|
||||||
|
alias sudo='sudo '
|
||||||
|
alias ga='git-annex '
|
||||||
|
alias gas='git-annex sync '
|
||||||
|
alias vi='vim '
|
||||||
|
alias tmr='~/bin/tmux_rattach.sh'
|
||||||
|
# envoit la playlist mpc et lit le meme morceau
|
||||||
|
function mpct() {
|
||||||
|
if [ $1 ] ; then
|
||||||
|
mpc -h $1 clear
|
||||||
|
mpc -f %file% playlist | mpc -h $1 -q add
|
||||||
|
mpc -h $1 play `mpc -f %position% -q current`
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# recoit la playlist mpc et lit le meme morceau
|
||||||
|
function mpcf() {
|
||||||
|
if [ $1 ] ; then
|
||||||
|
mpc clear
|
||||||
|
mpc -h $1 -f %file% playlist | mpc -q add
|
||||||
|
mpc play `mpc -h $1 -f %position% -q current`
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# genere un password aleatoire
|
||||||
|
randpw(){
|
||||||
|
LC_CTYPE=C < /dev/urandom tr -dc '[:graph:]' | head -c${1:-10}
|
||||||
|
echo
|
||||||
|
}
|
7
_bash_logout
Normal file
7
_bash_logout
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# ~/.bash_logout: executed by bash(1) when login shell exits.
|
||||||
|
|
||||||
|
# when leaving the console clear the screen to increase privacy
|
||||||
|
|
||||||
|
if [ "$SHLVL" = 1 ]; then
|
||||||
|
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
|
||||||
|
fi
|
100
_bashrc
Normal file
100
_bashrc
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
# ~/.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
|
||||||
|
[ -z "$PS1" ] && return
|
||||||
|
|
||||||
|
# don't put duplicate lines in the history. See bash(1) for more options
|
||||||
|
export HISTCONTROL=ignoredups
|
||||||
|
# ... and ignore same sucessive entries.
|
||||||
|
export HISTCONTROL=ignoreboth
|
||||||
|
|
||||||
|
# check the window size after each command and, if necessary,
|
||||||
|
# update the values of LINES and COLUMNS.
|
||||||
|
shopt -s checkwinsize
|
||||||
|
|
||||||
|
# make less more friendly for non-text input files, see lesspipe(1)
|
||||||
|
#[ -x /usr/bin/lesspipe ] && eval "$(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)
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Comment in the above and uncomment this below for a color prompt
|
||||||
|
#PS1='${debian_chroot:+($debian_chroot)}\[\033[0;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\n\$ '
|
||||||
|
PS1="\[\033[1;31m\]>> \[\033[01;37m\](\[\033[0;37m\]\u@\[\033[0;32m\]\h\[\033[01;37m\]) \[\033[01;34m\]\w\[\033[00m\]\n\[\033[1;31m\]>>\[\033[0;37m\] "
|
||||||
|
|
||||||
|
# If this is an xterm set the title to user@host:dir
|
||||||
|
case "$TERM" in
|
||||||
|
xterm*|rxvt*)
|
||||||
|
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# host specific
|
||||||
|
if [ -f ~/.bash_aliases_$(hostname -s) ]; then
|
||||||
|
. ~/.bash_aliases_$(hostname -s)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# enable color support of ls and also add handy aliases
|
||||||
|
if [ "$TERM" != "dumb" ]; then
|
||||||
|
[ -x /usr/bin/dircolors ] && eval "`dircolors -b`"
|
||||||
|
#alias dir='ls --color=auto --format=vertical'
|
||||||
|
#alias vdir='ls --color=auto --format=long'
|
||||||
|
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 [ -f /etc/bash_completion ]; then
|
||||||
|
. /etc/bash_completion
|
||||||
|
fi
|
||||||
|
|
||||||
|
# navigateur prefere
|
||||||
|
export BROWSER=firefox
|
||||||
|
|
||||||
|
# conserve l'historique lorsque l'on utilise plusieurs terminaux
|
||||||
|
shopt -s histappend
|
||||||
|
|
||||||
|
# editeur par defaut
|
||||||
|
export EDITOR=vim
|
||||||
|
export VISUAL=$EDITOR
|
||||||
|
|
||||||
|
# mutt background fix
|
||||||
|
COLORFGBG="default;default"
|
||||||
|
|
||||||
|
# pager man conserve affichage à l'écran
|
||||||
|
export MANPAGER="less -X"
|
||||||
|
|
||||||
|
# ls colors
|
||||||
|
export LSCOLORS="ExGxFxdxCxDxDxhbadExEx"
|
||||||
|
|
||||||
|
# youtube dl default dl dir
|
||||||
|
export YDL_TARGET=$HOME
|
||||||
|
|
||||||
|
# host specific
|
||||||
|
if [ -f ~/.bashrc_$(hostname -s) ]; then
|
||||||
|
. ~/.bashrc_$(hostname -s)
|
||||||
|
fi
|
493
_config/awesome__abraracourcix/rc.lua
Normal file
493
_config/awesome__abraracourcix/rc.lua
Normal file
@ -0,0 +1,493 @@
|
|||||||
|
-- Standard awesome library
|
||||||
|
require("awful")
|
||||||
|
require("awful.autofocus")
|
||||||
|
require("awful.rules")
|
||||||
|
-- Theme handling library
|
||||||
|
require("beautiful")
|
||||||
|
-- Notification library
|
||||||
|
require("naughty")
|
||||||
|
|
||||||
|
-- Load Debian menu entries
|
||||||
|
require("debian.menu")
|
||||||
|
|
||||||
|
-- Awesompd
|
||||||
|
require("awesompd/awesompd")
|
||||||
|
|
||||||
|
-- Sound Control
|
||||||
|
function pulseDevice()
|
||||||
|
local f = io.popen("pactl info | grep '^Default Sink'")
|
||||||
|
local d = f:read()
|
||||||
|
local pulse_device_name = string.gsub(d, ".*: (.*)", "%1")
|
||||||
|
f:close()
|
||||||
|
return pulse_device_name
|
||||||
|
end
|
||||||
|
function volumeUp()
|
||||||
|
pulse_device_name = pulseDevice()
|
||||||
|
local step = 655
|
||||||
|
local f = io.popen("pacmd dump |grep 'set-sink-volume "..pulse_device_name.."'")
|
||||||
|
local v = f:read()
|
||||||
|
local volume = tonumber(string.sub(v, string.find(v, 'x') - 1))
|
||||||
|
local newVolume = volume + step
|
||||||
|
if newVolume > 65536 then
|
||||||
|
newVolume = 65536
|
||||||
|
end
|
||||||
|
io.popen("pacmd set-sink-volume "..pulse_device_name.." "..newVolume)
|
||||||
|
volumeInfo()
|
||||||
|
f:close()
|
||||||
|
end
|
||||||
|
function volumeDown()
|
||||||
|
pulse_device_name = pulseDevice()
|
||||||
|
local step = 655
|
||||||
|
local f = io.popen("pacmd dump |grep 'set-sink-volume "..pulse_device_name.."'")
|
||||||
|
local v = f:read()
|
||||||
|
local volume = tonumber(string.sub(v, string.find(v, 'x') - 1))
|
||||||
|
local newVolume = volume - step
|
||||||
|
if newVolume < 0 then
|
||||||
|
newVolume = 0
|
||||||
|
end
|
||||||
|
io.popen("pacmd set-sink-volume "..pulse_device_name.." "..newVolume)
|
||||||
|
volumeInfo()
|
||||||
|
f:close()
|
||||||
|
end
|
||||||
|
function volumeMute()
|
||||||
|
pulse_device_name = pulseDevice()
|
||||||
|
local g = io.popen("pacmd dump |grep 'set-sink-mute "..pulse_device_name.."'")
|
||||||
|
local mute = g:read()
|
||||||
|
if string.find(mute, "no") then
|
||||||
|
io.popen("pacmd set-sink-mute "..pulse_device_name.." yes")
|
||||||
|
else
|
||||||
|
io.popen("pacmd set-sink-mute "..pulse_device_name.." no")
|
||||||
|
end
|
||||||
|
volumeInfo()
|
||||||
|
g:close()
|
||||||
|
end
|
||||||
|
function volumeInfo()
|
||||||
|
pulse_device_name = pulseDevice()
|
||||||
|
volmin = 0
|
||||||
|
volmax = 65536
|
||||||
|
local f = io.popen("pacmd dump |grep 'set-sink-volume "..pulse_device_name.."'")
|
||||||
|
local g = io.popen("pacmd dump |grep 'set-sink-mute "..pulse_device_name.."'")
|
||||||
|
local v = f:read()
|
||||||
|
local mute = g:read()
|
||||||
|
if string.find(mute, "no") then
|
||||||
|
volume = math.floor(tonumber(string.sub(v, string.find(v, 'x')-1)) * 100 / volmax).." %"
|
||||||
|
else
|
||||||
|
volume = "✕"
|
||||||
|
end
|
||||||
|
volumewidget.text = "𝅘𝅥𝅮 "..volume.."|"
|
||||||
|
f:close()
|
||||||
|
g:close()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- {{{ Variable definitions
|
||||||
|
-- Themes define colours, icons, and wallpapers
|
||||||
|
beautiful.init(".config/awesome/theme.lua")
|
||||||
|
|
||||||
|
-- This is used later as the default terminal and editor to run.
|
||||||
|
terminal = "x-terminal-emulator"
|
||||||
|
editor = os.getenv("EDITOR") or "editor"
|
||||||
|
editor_cmd = terminal .. " -e " .. editor
|
||||||
|
|
||||||
|
-- Default modkey.
|
||||||
|
-- Usually, Mod4 is the key with a logo between Control and Alt.
|
||||||
|
-- If you do not like this or do not have such a key,
|
||||||
|
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
|
||||||
|
-- However, you can use another modifier like Mod1, but it may interact with others.
|
||||||
|
modkey = "Mod4"
|
||||||
|
|
||||||
|
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||||
|
layouts =
|
||||||
|
{
|
||||||
|
awful.layout.suit.floating,
|
||||||
|
awful.layout.suit.tile,
|
||||||
|
awful.layout.suit.tile.left,
|
||||||
|
awful.layout.suit.tile.bottom,
|
||||||
|
awful.layout.suit.tile.top,
|
||||||
|
awful.layout.suit.fair,
|
||||||
|
awful.layout.suit.fair.horizontal,
|
||||||
|
awful.layout.suit.spiral,
|
||||||
|
awful.layout.suit.spiral.dwindle,
|
||||||
|
awful.layout.suit.max,
|
||||||
|
awful.layout.suit.max.fullscreen,
|
||||||
|
awful.layout.suit.magnifier
|
||||||
|
}
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Tags
|
||||||
|
-- Define a tag table which hold all screen tags.
|
||||||
|
tags = {
|
||||||
|
names = { "terms", "www", "video", "mail", 5, 6, 7, 8, 9 },
|
||||||
|
layout = { layouts[3], layouts[3], layouts[3], layouts[3], layouts[3],
|
||||||
|
layouts[3], layouts[3], layouts[3], layouts[3]
|
||||||
|
}}
|
||||||
|
for s = 1, screen.count() do
|
||||||
|
-- Each screen has its own tag table.
|
||||||
|
tags[s] = awful.tag(tags.names, s, tags.layout)
|
||||||
|
end
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Menu
|
||||||
|
-- Create a laucher widget and a main menu
|
||||||
|
myawesomemenu = {
|
||||||
|
{ "manual", terminal .. " -e man awesome" },
|
||||||
|
{ "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
|
||||||
|
{ "restart", awesome.restart },
|
||||||
|
{ "quit", awesome.quit }
|
||||||
|
}
|
||||||
|
|
||||||
|
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
|
||||||
|
{ "Debian", debian.menu.Debian_menu.Debian },
|
||||||
|
{ "open terminal", terminal },
|
||||||
|
{ "change background", "/home/meutel/bin/rotate_wallpapers.sh" }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
|
||||||
|
menu = mymainmenu })
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Awesompd
|
||||||
|
musicwidget = awesompd:create() -- Create awesompd widget
|
||||||
|
musicwidget.font = "Terminus" -- Set widget font
|
||||||
|
musicwidget.scrolling = true -- If true, the text in the widget will be scrolled
|
||||||
|
musicwidget.output_size = 60 -- Set the size of widget in symbols
|
||||||
|
musicwidget.update_interval = 10 -- Set the update interval in seconds
|
||||||
|
-- Set the folder where icons are located (change username to your login name)
|
||||||
|
musicwidget.path_to_icons = "/home/meutel/.config/awesome/awesompd/icons"
|
||||||
|
-- Set the default music format for Jamendo streams. You can change
|
||||||
|
-- this option on the fly in awesompd itself.
|
||||||
|
-- possible formats: awesompd.FORMAT_MP3, awesompd.FORMAT_OGG
|
||||||
|
-- musicwidget.jamendo_format = awesompd.FORMAT_MP3
|
||||||
|
-- If true, song notifications for Jamendo tracks and local tracks will also contain
|
||||||
|
-- album cover image.
|
||||||
|
musicwidget.show_album_cover = true
|
||||||
|
-- Specify how big in pixels should an album cover be. Maximum value
|
||||||
|
-- is 100.
|
||||||
|
musicwidget.album_cover_size = 50
|
||||||
|
-- This option is necessary if you want the album covers to be shown
|
||||||
|
-- for your local tracks.
|
||||||
|
-- musicwidget.mpd_config = "/home/username/.mpdconf"
|
||||||
|
-- Specify the browser you use so awesompd can open links from
|
||||||
|
-- Jamendo in it.
|
||||||
|
-- musicwidget.browser = "firefox"
|
||||||
|
-- Specify decorators on the left and the right side of the
|
||||||
|
-- widget. Or just leave empty strings if you decorate the widget
|
||||||
|
-- from outside.
|
||||||
|
musicwidget.ldecorator = " "
|
||||||
|
musicwidget.rdecorator = " |"
|
||||||
|
-- Set all the servers to work with (here can be any servers you use)
|
||||||
|
musicwidget.servers = {
|
||||||
|
{ server = "localhost",
|
||||||
|
port = 6600 },
|
||||||
|
}
|
||||||
|
-- Set the buttons of the widget
|
||||||
|
musicwidget:register_buttons({ { "", awesompd.MOUSE_LEFT, musicwidget:command_toggle() },
|
||||||
|
{ "Control", awesompd.MOUSE_SCROLL_UP, musicwidget:command_prev_track() },
|
||||||
|
{ "Control", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_next_track() },
|
||||||
|
{ "", awesompd.MOUSE_SCROLL_UP, musicwidget:command_volume_up() },
|
||||||
|
{ "", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_volume_down() },
|
||||||
|
{ "", awesompd.MOUSE_RIGHT, musicwidget:command_show_menu() } })
|
||||||
|
musicwidget:run() -- After all configuration is done, run the widget
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Volume widget
|
||||||
|
volumewidget = widget({type = "textbox", name = "volumewidget", align = "right"})
|
||||||
|
volumeInfo()
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Wibox
|
||||||
|
-- Create a textclock widget
|
||||||
|
mytextclock = awful.widget.textclock({ align = "right" })
|
||||||
|
|
||||||
|
-- Create a systray
|
||||||
|
mysystray = widget({ type = "systray" })
|
||||||
|
|
||||||
|
-- Create a wibox for each screen and add it
|
||||||
|
mywibox = {}
|
||||||
|
mypromptbox = {}
|
||||||
|
mylayoutbox = {}
|
||||||
|
mytaglist = {}
|
||||||
|
mytaglist.buttons = awful.util.table.join(
|
||||||
|
awful.button({ }, 1, awful.tag.viewonly),
|
||||||
|
awful.button({ modkey }, 1, awful.client.movetotag),
|
||||||
|
awful.button({ }, 3, awful.tag.viewtoggle),
|
||||||
|
awful.button({ modkey }, 3, awful.client.toggletag),
|
||||||
|
awful.button({ }, 4, awful.tag.viewnext),
|
||||||
|
awful.button({ }, 5, awful.tag.viewprev)
|
||||||
|
)
|
||||||
|
mytasklist = {}
|
||||||
|
mytasklist.buttons = awful.util.table.join(
|
||||||
|
awful.button({ }, 1, function (c)
|
||||||
|
if not c:isvisible() then
|
||||||
|
awful.tag.viewonly(c:tags()[1])
|
||||||
|
end
|
||||||
|
client.focus = c
|
||||||
|
c:raise()
|
||||||
|
end),
|
||||||
|
awful.button({ }, 3, function ()
|
||||||
|
if instance then
|
||||||
|
instance:hide()
|
||||||
|
instance = nil
|
||||||
|
else
|
||||||
|
instance = awful.menu.clients({ width=250 })
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
awful.button({ }, 4, function ()
|
||||||
|
awful.client.focus.byidx(1)
|
||||||
|
if client.focus then client.focus:raise() end
|
||||||
|
end),
|
||||||
|
awful.button({ }, 5, function ()
|
||||||
|
awful.client.focus.byidx(-1)
|
||||||
|
if client.focus then client.focus:raise() end
|
||||||
|
end))
|
||||||
|
|
||||||
|
for s = 1, screen.count() do
|
||||||
|
-- Create a promptbox for each screen
|
||||||
|
mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
|
||||||
|
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||||
|
-- We need one layoutbox per screen.
|
||||||
|
mylayoutbox[s] = awful.widget.layoutbox(s)
|
||||||
|
mylayoutbox[s]:buttons(awful.util.table.join(
|
||||||
|
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
|
||||||
|
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
|
||||||
|
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
||||||
|
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
|
||||||
|
-- Create a taglist widget
|
||||||
|
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
|
||||||
|
|
||||||
|
-- Create a tasklist widget
|
||||||
|
mytasklist[s] = awful.widget.tasklist(function(c)
|
||||||
|
return awful.widget.tasklist.label.currenttags(c, s)
|
||||||
|
end, mytasklist.buttons)
|
||||||
|
|
||||||
|
-- Create the wibox
|
||||||
|
mywibox[s] = awful.wibox({ position = "top", screen = s })
|
||||||
|
-- Add widgets to the wibox - order matters
|
||||||
|
mywibox[s].widgets = {
|
||||||
|
{
|
||||||
|
mylauncher,
|
||||||
|
mytaglist[s],
|
||||||
|
mypromptbox[s],
|
||||||
|
layout = awful.widget.layout.horizontal.leftright
|
||||||
|
},
|
||||||
|
mylayoutbox[s],
|
||||||
|
mytextclock,
|
||||||
|
volumewidget,
|
||||||
|
musicwidget.widget, -- Awesompd widget is added like this
|
||||||
|
s == 1 and mysystray or nil,
|
||||||
|
mytasklist[s],
|
||||||
|
layout = awful.widget.layout.horizontal.rightleft
|
||||||
|
}
|
||||||
|
end
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Mouse bindings
|
||||||
|
root.buttons(awful.util.table.join(
|
||||||
|
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
||||||
|
awful.button({ }, 4, awful.tag.viewnext),
|
||||||
|
awful.button({ }, 5, awful.tag.viewprev)
|
||||||
|
))
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Key bindings
|
||||||
|
globalkeys = awful.util.table.join(
|
||||||
|
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
|
||||||
|
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
|
||||||
|
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
|
||||||
|
|
||||||
|
awful.key({ modkey, }, "j",
|
||||||
|
function ()
|
||||||
|
awful.client.focus.byidx( 1)
|
||||||
|
if client.focus then client.focus:raise() end
|
||||||
|
end),
|
||||||
|
awful.key({ modkey, }, "k",
|
||||||
|
function ()
|
||||||
|
awful.client.focus.byidx(-1)
|
||||||
|
if client.focus then client.focus:raise() end
|
||||||
|
end),
|
||||||
|
awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) end),
|
||||||
|
|
||||||
|
-- Layout manipulation
|
||||||
|
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
|
||||||
|
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
|
||||||
|
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
|
||||||
|
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
|
||||||
|
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
|
||||||
|
awful.key({ modkey, }, "Tab",
|
||||||
|
function ()
|
||||||
|
awful.client.focus.history.previous()
|
||||||
|
if client.focus then
|
||||||
|
client.focus:raise()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
|
||||||
|
-- Standard program
|
||||||
|
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
|
||||||
|
awful.key({ modkey, "Control" }, "r", awesome.restart),
|
||||||
|
awful.key({ modkey, "Shift" }, "q", awesome.quit),
|
||||||
|
|
||||||
|
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
|
||||||
|
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
|
||||||
|
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
|
||||||
|
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
|
||||||
|
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
|
||||||
|
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
|
||||||
|
awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
|
||||||
|
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
|
||||||
|
|
||||||
|
-- Prompt
|
||||||
|
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
|
||||||
|
|
||||||
|
awful.key({ modkey }, "x",
|
||||||
|
function ()
|
||||||
|
awful.prompt.run({ prompt = "Run Lua code: " },
|
||||||
|
mypromptbox[mouse.screen].widget,
|
||||||
|
awful.util.eval, nil,
|
||||||
|
awful.util.getdir("cache") .. "/history_eval")
|
||||||
|
end),
|
||||||
|
|
||||||
|
-- Multimedia keys
|
||||||
|
-- XF86AudioMute XF86AudioLowerVolume XF86AudioRaiseVolume XF86AudioPlay XF86AudioPrev XF86AudioNext XF86Calculator XF86Mail XF86HomePage XF86Tools
|
||||||
|
awful.key({ }, "XF86AudioRaiseVolume", function() volumeUp() end ),
|
||||||
|
awful.key({ }, "XF86AudioLowerVolume", function() volumeDown() end ),
|
||||||
|
awful.key({ }, "XF86AudioMute", function() volumeMute() end ),
|
||||||
|
awful.key({ }, "XF86AudioPlay", function() awful.util.spawn("mpc toggle") end),
|
||||||
|
awful.key({ }, "XF86AudioPrev", function() awful.util.spawn("mpc prev") end),
|
||||||
|
awful.key({ }, "XF86AudioNext", function() awful.util.spawn("mpc next") end),
|
||||||
|
awful.key({ }, "XF86Calculator", function() awful.util.spawn("mpc stop") end)
|
||||||
|
)
|
||||||
|
|
||||||
|
clientkeys = awful.util.table.join(
|
||||||
|
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
|
||||||
|
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
|
||||||
|
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
|
||||||
|
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
|
||||||
|
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
|
||||||
|
awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
|
||||||
|
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
|
||||||
|
awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end),
|
||||||
|
awful.key({ modkey, }, "m",
|
||||||
|
function (c)
|
||||||
|
c.maximized_horizontal = not c.maximized_horizontal
|
||||||
|
c.maximized_vertical = not c.maximized_vertical
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Compute the maximum number of digit we need, limited to 9
|
||||||
|
keynumber = 0
|
||||||
|
for s = 1, screen.count() do
|
||||||
|
keynumber = math.min(9, math.max(#tags[s], keynumber));
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Bind all key numbers to tags.
|
||||||
|
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
||||||
|
-- This should map on the top row of your keyboard, usually 1 to 9.
|
||||||
|
for i = 1, keynumber do
|
||||||
|
globalkeys = awful.util.table.join(globalkeys,
|
||||||
|
awful.key({ modkey }, "#" .. i + 9,
|
||||||
|
function ()
|
||||||
|
local screen = mouse.screen
|
||||||
|
if tags[screen][i] then
|
||||||
|
awful.tag.viewonly(tags[screen][i])
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
awful.key({ modkey, "Control" }, "#" .. i + 9,
|
||||||
|
function ()
|
||||||
|
local screen = mouse.screen
|
||||||
|
if tags[screen][i] then
|
||||||
|
awful.tag.viewtoggle(tags[screen][i])
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
awful.key({ modkey, "Shift" }, "#" .. i + 9,
|
||||||
|
function ()
|
||||||
|
if client.focus and tags[client.focus.screen][i] then
|
||||||
|
awful.client.movetotag(tags[client.focus.screen][i])
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
|
||||||
|
function ()
|
||||||
|
if client.focus and tags[client.focus.screen][i] then
|
||||||
|
awful.client.toggletag(tags[client.focus.screen][i])
|
||||||
|
end
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
clientbuttons = awful.util.table.join(
|
||||||
|
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
||||||
|
awful.button({ modkey }, 1, awful.mouse.client.move),
|
||||||
|
awful.button({ modkey }, 3, awful.mouse.client.resize))
|
||||||
|
|
||||||
|
-- Set keys
|
||||||
|
root.keys(globalkeys)
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Rules
|
||||||
|
awful.rules.rules = {
|
||||||
|
-- All clients will match this rule.
|
||||||
|
{ rule = { },
|
||||||
|
properties = { border_width = beautiful.border_width,
|
||||||
|
border_color = beautiful.border_normal,
|
||||||
|
focus = true,
|
||||||
|
keys = clientkeys,
|
||||||
|
buttons = clientbuttons } },
|
||||||
|
{ rule = { class = "pinentry" },
|
||||||
|
properties = { floating = true } },
|
||||||
|
{ rule = { class = "Display", name = "ImageMagick.*" },
|
||||||
|
properties = { floating = true } },
|
||||||
|
{ rule = { class = "feh" },
|
||||||
|
properties = { floating = true } },
|
||||||
|
{ rule = { class = "gimp" },
|
||||||
|
properties = { floating = true } },
|
||||||
|
-- Set Sylpheed to always map on tags number 4 of screen 1.
|
||||||
|
{ rule = { class = "Icedove" },
|
||||||
|
properties = { tag = tags[1][4] } },
|
||||||
|
-- Set Sylpheed to always map on tags number 4 of screen 1.
|
||||||
|
{ rule = { class = "Sylpheed" },
|
||||||
|
properties = { tag = tags[1][4] } },
|
||||||
|
-- Set Firefox to always map on tags number 2 of screen 1.
|
||||||
|
{ rule = { class = "Iceweasel" },
|
||||||
|
properties = { tag = tags[1][2], floating = false } },
|
||||||
|
{ rule_any = { class = { "X-terminal-emulator", "MPlayer", "Totem" } },
|
||||||
|
callback = awful.client.setslave },
|
||||||
|
{ rule = { type = "dialog" },
|
||||||
|
callback = awful.client.setslave },
|
||||||
|
{ rule = { role = "browser"},
|
||||||
|
properties = { tag = tags[1][2] } },
|
||||||
|
}
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Signals
|
||||||
|
-- Signal function to execute when a new client appears.
|
||||||
|
client.add_signal("manage", function (c, startup)
|
||||||
|
-- Add a titlebar
|
||||||
|
-- awful.titlebar.add(c, { modkey = modkey })
|
||||||
|
|
||||||
|
-- Enable sloppy focus
|
||||||
|
c:add_signal("mouse::enter", function(c)
|
||||||
|
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
|
||||||
|
and awful.client.focus.filter(c) then
|
||||||
|
client.focus = c
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
if not startup then
|
||||||
|
-- Set the windows at the slave,
|
||||||
|
-- i.e. put it at the end of others instead of setting it master.
|
||||||
|
-- awful.client.setslave(c)
|
||||||
|
|
||||||
|
-- Put windows in a smart way, only if they does not set an initial position.
|
||||||
|
if not c.size_hints.user_position and not c.size_hints.program_position then
|
||||||
|
awful.placement.no_overlap(c)
|
||||||
|
awful.placement.no_offscreen(c)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||||
|
client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Autostart
|
||||||
|
-- set master window width ratio on second tag
|
||||||
|
awful.tag.setmwfact(0.65,tags[1][2])
|
||||||
|
-- }}}
|
96
_config/awesome__abraracourcix/theme.lua
Normal file
96
_config/awesome__abraracourcix/theme.lua
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
---------------------------
|
||||||
|
-- Default awesome theme --
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
theme = {}
|
||||||
|
|
||||||
|
theme.font = "sans 8"
|
||||||
|
|
||||||
|
theme.bg_normal = "#222222"
|
||||||
|
theme.bg_focus = "#535d6c"
|
||||||
|
theme.bg_urgent = "#ff0000"
|
||||||
|
theme.bg_minimize = "#444444"
|
||||||
|
|
||||||
|
theme.fg_normal = "#aaaaaa"
|
||||||
|
theme.fg_focus = "#ffffff"
|
||||||
|
theme.fg_urgent = "#ffffff"
|
||||||
|
theme.fg_minimize = "#ffffff"
|
||||||
|
|
||||||
|
theme.border_width = "2"
|
||||||
|
theme.border_normal = "#000000"
|
||||||
|
theme.border_focus = "#ffa500"
|
||||||
|
theme.border_marked = "#91231c"
|
||||||
|
|
||||||
|
-- There are other variable sets
|
||||||
|
-- overriding the default one when
|
||||||
|
-- defined, the sets are:
|
||||||
|
-- [taglist|tasklist]_[bg|fg]_[focus|urgent]
|
||||||
|
-- titlebar_[bg|fg]_[normal|focus]
|
||||||
|
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
|
||||||
|
-- mouse_finder_[color|timeout|animate_timeout|radius|factor]
|
||||||
|
-- Example:
|
||||||
|
--theme.taglist_bg_focus = "#ff0000"
|
||||||
|
|
||||||
|
-- Display the taglist squares
|
||||||
|
theme.taglist_squares_sel = "/usr/share/awesome/themes/default/taglist/squarefw.png"
|
||||||
|
theme.taglist_squares_unsel = "/usr/share/awesome/themes/default/taglist/squarew.png"
|
||||||
|
|
||||||
|
theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png"
|
||||||
|
|
||||||
|
-- Variables set for theming the menu:
|
||||||
|
-- menu_[bg|fg]_[normal|focus]
|
||||||
|
-- menu_[border_color|border_width]
|
||||||
|
theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png"
|
||||||
|
theme.menu_height = "15"
|
||||||
|
theme.menu_width = "100"
|
||||||
|
|
||||||
|
-- You can add as many variables as
|
||||||
|
-- you wish and access them by using
|
||||||
|
-- beautiful.variable in your rc.lua
|
||||||
|
--theme.bg_widget = "#cc0000"
|
||||||
|
|
||||||
|
-- Define the image to load
|
||||||
|
theme.titlebar_close_button_normal = "/usr/share/awesome/themes/default/titlebar/close_normal.png"
|
||||||
|
theme.titlebar_close_button_focus = "/usr/share/awesome/themes/default/titlebar/close_focus.png"
|
||||||
|
|
||||||
|
theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_normal_inactive.png"
|
||||||
|
theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_focus_inactive.png"
|
||||||
|
theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/default/titlebar/ontop_normal_active.png"
|
||||||
|
theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/default/titlebar/ontop_focus_active.png"
|
||||||
|
|
||||||
|
theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_normal_inactive.png"
|
||||||
|
theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_focus_inactive.png"
|
||||||
|
theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/default/titlebar/sticky_normal_active.png"
|
||||||
|
theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/default/titlebar/sticky_focus_active.png"
|
||||||
|
|
||||||
|
theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/floating_normal_inactive.png"
|
||||||
|
theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/floating_focus_inactive.png"
|
||||||
|
theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/default/titlebar/floating_normal_active.png"
|
||||||
|
theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/default/titlebar/floating_focus_active.png"
|
||||||
|
|
||||||
|
theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_normal_inactive.png"
|
||||||
|
theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_focus_inactive.png"
|
||||||
|
theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/default/titlebar/maximized_normal_active.png"
|
||||||
|
theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/default/titlebar/maximized_focus_active.png"
|
||||||
|
|
||||||
|
-- You can use your own command to set your wallpaper
|
||||||
|
theme.wallpaper_cmd = { "awsetbg -l" }
|
||||||
|
|
||||||
|
-- You can use your own layout icons like this:
|
||||||
|
theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png"
|
||||||
|
theme.layout_fairv = "/usr/share/awesome/themes/default/layouts/fairvw.png"
|
||||||
|
theme.layout_floating = "/usr/share/awesome/themes/default/layouts/floatingw.png"
|
||||||
|
theme.layout_magnifier = "/usr/share/awesome/themes/default/layouts/magnifierw.png"
|
||||||
|
theme.layout_max = "/usr/share/awesome/themes/default/layouts/maxw.png"
|
||||||
|
theme.layout_fullscreen = "/usr/share/awesome/themes/default/layouts/fullscreenw.png"
|
||||||
|
theme.layout_tilebottom = "/usr/share/awesome/themes/default/layouts/tilebottomw.png"
|
||||||
|
theme.layout_tileleft = "/usr/share/awesome/themes/default/layouts/tileleftw.png"
|
||||||
|
theme.layout_tile = "/usr/share/awesome/themes/default/layouts/tilew.png"
|
||||||
|
theme.layout_tiletop = "/usr/share/awesome/themes/default/layouts/tiletopw.png"
|
||||||
|
theme.layout_spiral = "/usr/share/awesome/themes/default/layouts/spiralw.png"
|
||||||
|
theme.layout_dwindle = "/usr/share/awesome/themes/default/layouts/dwindlew.png"
|
||||||
|
|
||||||
|
theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png"
|
||||||
|
|
||||||
|
return theme
|
||||||
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
445
_config/awesome__idefix.armorique.lan/rc.lua
Normal file
445
_config/awesome__idefix.armorique.lan/rc.lua
Normal file
@ -0,0 +1,445 @@
|
|||||||
|
-- Standard awesome library
|
||||||
|
local gears = require("gears")
|
||||||
|
local awful = require("awful")
|
||||||
|
awful.rules = require("awful.rules")
|
||||||
|
require("awful.autofocus")
|
||||||
|
-- Widget and layout library
|
||||||
|
local wibox = require("wibox")
|
||||||
|
-- Theme handling library
|
||||||
|
local beautiful = require("beautiful")
|
||||||
|
-- Notification library
|
||||||
|
local naughty = require("naughty")
|
||||||
|
local menubar = require("menubar")
|
||||||
|
|
||||||
|
-- {{{ Error handling
|
||||||
|
-- Check if awesome encountered an error during startup and fell back to
|
||||||
|
-- another config (This code will only ever execute for the fallback config)
|
||||||
|
if awesome.startup_errors then
|
||||||
|
naughty.notify({ preset = naughty.config.presets.critical,
|
||||||
|
title = "Oops, there were errors during startup!",
|
||||||
|
text = awesome.startup_errors })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Handle runtime errors after startup
|
||||||
|
do
|
||||||
|
local in_error = false
|
||||||
|
awesome.connect_signal("debug::error", function (err)
|
||||||
|
-- Make sure we don't go into an endless error loop
|
||||||
|
if in_error then return end
|
||||||
|
in_error = true
|
||||||
|
|
||||||
|
naughty.notify({ preset = naughty.config.presets.critical,
|
||||||
|
title = "Oops, an error happened!",
|
||||||
|
text = err })
|
||||||
|
in_error = false
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Variable definitions
|
||||||
|
-- Themes define colours, icons, font and wallpapers.
|
||||||
|
beautiful.init("/home/meutel/.config/awesome/theme.lua")
|
||||||
|
|
||||||
|
-- This is used later as the default terminal and editor to run.
|
||||||
|
terminal = "xterm"
|
||||||
|
editor = os.getenv("EDITOR") or "vi"
|
||||||
|
editor_cmd = terminal .. " -e " .. editor
|
||||||
|
|
||||||
|
-- Default modkey.
|
||||||
|
-- Usually, Mod4 is the key with a logo between Control and Alt.
|
||||||
|
-- If you do not like this or do not have such a key,
|
||||||
|
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
|
||||||
|
-- However, you can use another modifier like Mod1, but it may interact with others.
|
||||||
|
modkey = "Mod4"
|
||||||
|
|
||||||
|
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||||
|
local layouts =
|
||||||
|
{
|
||||||
|
awful.layout.suit.floating,
|
||||||
|
awful.layout.suit.tile,
|
||||||
|
awful.layout.suit.tile.left,
|
||||||
|
awful.layout.suit.tile.bottom,
|
||||||
|
awful.layout.suit.tile.top,
|
||||||
|
awful.layout.suit.fair,
|
||||||
|
awful.layout.suit.fair.horizontal,
|
||||||
|
awful.layout.suit.spiral,
|
||||||
|
awful.layout.suit.spiral.dwindle,
|
||||||
|
awful.layout.suit.max,
|
||||||
|
awful.layout.suit.max.fullscreen,
|
||||||
|
awful.layout.suit.magnifier
|
||||||
|
}
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Wallpaper
|
||||||
|
if beautiful.wallpaper then
|
||||||
|
for s = 1, screen.count() do
|
||||||
|
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Tags
|
||||||
|
-- Define a tag table which hold all screen tags.
|
||||||
|
tags = {}
|
||||||
|
for s = 1, screen.count() do
|
||||||
|
-- Each screen has its own tag table.
|
||||||
|
tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[2])
|
||||||
|
end
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Menu
|
||||||
|
-- Create a laucher widget and a main menu
|
||||||
|
myawesomemenu = {
|
||||||
|
{ "manual", terminal .. " -e man awesome" },
|
||||||
|
{ "edit config", editor_cmd .. " " .. awesome.conffile },
|
||||||
|
{ "restart", awesome.restart },
|
||||||
|
{ "quit", awesome.quit }
|
||||||
|
}
|
||||||
|
|
||||||
|
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
|
||||||
|
{ "open terminal", terminal }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
|
||||||
|
menu = mymainmenu })
|
||||||
|
|
||||||
|
-- Menubar configuration
|
||||||
|
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Wibox
|
||||||
|
-- Create a textclock widget
|
||||||
|
mytextclock = awful.widget.textclock()
|
||||||
|
|
||||||
|
-- Create a wibox for each screen and add it
|
||||||
|
mywibox = {}
|
||||||
|
mypromptbox = {}
|
||||||
|
mylayoutbox = {}
|
||||||
|
mytaglist = {}
|
||||||
|
mytaglist.buttons = awful.util.table.join(
|
||||||
|
awful.button({ }, 1, awful.tag.viewonly),
|
||||||
|
awful.button({ modkey }, 1, awful.client.movetotag),
|
||||||
|
awful.button({ }, 3, awful.tag.viewtoggle),
|
||||||
|
awful.button({ modkey }, 3, awful.client.toggletag),
|
||||||
|
awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
|
||||||
|
awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
|
||||||
|
)
|
||||||
|
mytasklist = {}
|
||||||
|
mytasklist.buttons = awful.util.table.join(
|
||||||
|
awful.button({ }, 1, function (c)
|
||||||
|
if c == client.focus then
|
||||||
|
c.minimized = true
|
||||||
|
else
|
||||||
|
-- Without this, the following
|
||||||
|
-- :isvisible() makes no sense
|
||||||
|
c.minimized = false
|
||||||
|
if not c:isvisible() then
|
||||||
|
awful.tag.viewonly(c:tags()[1])
|
||||||
|
end
|
||||||
|
-- This will also un-minimize
|
||||||
|
-- the client, if needed
|
||||||
|
client.focus = c
|
||||||
|
c:raise()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
awful.button({ }, 3, function ()
|
||||||
|
if instance then
|
||||||
|
instance:hide()
|
||||||
|
instance = nil
|
||||||
|
else
|
||||||
|
instance = awful.menu.clients({
|
||||||
|
theme = { width = 250 }
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
awful.button({ }, 4, function ()
|
||||||
|
awful.client.focus.byidx(1)
|
||||||
|
if client.focus then client.focus:raise() end
|
||||||
|
end),
|
||||||
|
awful.button({ }, 5, function ()
|
||||||
|
awful.client.focus.byidx(-1)
|
||||||
|
if client.focus then client.focus:raise() end
|
||||||
|
end))
|
||||||
|
|
||||||
|
for s = 1, screen.count() do
|
||||||
|
-- Create a promptbox for each screen
|
||||||
|
mypromptbox[s] = awful.widget.prompt()
|
||||||
|
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||||
|
-- We need one layoutbox per screen.
|
||||||
|
mylayoutbox[s] = awful.widget.layoutbox(s)
|
||||||
|
mylayoutbox[s]:buttons(awful.util.table.join(
|
||||||
|
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
|
||||||
|
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
|
||||||
|
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
||||||
|
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
|
||||||
|
-- Create a taglist widget
|
||||||
|
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
|
||||||
|
|
||||||
|
-- Create a tasklist widget
|
||||||
|
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
|
||||||
|
|
||||||
|
-- Create the wibox
|
||||||
|
mywibox[s] = awful.wibox({ position = "top", screen = s })
|
||||||
|
|
||||||
|
-- Widgets that are aligned to the left
|
||||||
|
local left_layout = wibox.layout.fixed.horizontal()
|
||||||
|
left_layout:add(mylauncher)
|
||||||
|
left_layout:add(mytaglist[s])
|
||||||
|
left_layout:add(mypromptbox[s])
|
||||||
|
|
||||||
|
-- Widgets that are aligned to the right
|
||||||
|
local right_layout = wibox.layout.fixed.horizontal()
|
||||||
|
if s == 1 then right_layout:add(wibox.widget.systray()) end
|
||||||
|
right_layout:add(mytextclock)
|
||||||
|
right_layout:add(mylayoutbox[s])
|
||||||
|
|
||||||
|
-- Now bring it all together (with the tasklist in the middle)
|
||||||
|
local layout = wibox.layout.align.horizontal()
|
||||||
|
layout:set_left(left_layout)
|
||||||
|
layout:set_middle(mytasklist[s])
|
||||||
|
layout:set_right(right_layout)
|
||||||
|
|
||||||
|
mywibox[s]:set_widget(layout)
|
||||||
|
end
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Mouse bindings
|
||||||
|
root.buttons(awful.util.table.join(
|
||||||
|
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
||||||
|
awful.button({ }, 4, awful.tag.viewnext),
|
||||||
|
awful.button({ }, 5, awful.tag.viewprev)
|
||||||
|
))
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Key bindings
|
||||||
|
globalkeys = awful.util.table.join(
|
||||||
|
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
|
||||||
|
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
|
||||||
|
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
|
||||||
|
|
||||||
|
awful.key({ modkey, }, "j",
|
||||||
|
function ()
|
||||||
|
awful.client.focus.byidx( 1)
|
||||||
|
if client.focus then client.focus:raise() end
|
||||||
|
end),
|
||||||
|
awful.key({ modkey, }, "k",
|
||||||
|
function ()
|
||||||
|
awful.client.focus.byidx(-1)
|
||||||
|
if client.focus then client.focus:raise() end
|
||||||
|
end),
|
||||||
|
awful.key({ modkey, }, "w", function () mymainmenu:show() end),
|
||||||
|
|
||||||
|
-- Layout manipulation
|
||||||
|
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
|
||||||
|
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
|
||||||
|
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
|
||||||
|
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
|
||||||
|
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
|
||||||
|
awful.key({ modkey, }, "Tab",
|
||||||
|
function ()
|
||||||
|
awful.client.focus.history.previous()
|
||||||
|
if client.focus then
|
||||||
|
client.focus:raise()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
|
||||||
|
-- Standard program
|
||||||
|
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
|
||||||
|
awful.key({ modkey, "Control" }, "r", awesome.restart),
|
||||||
|
awful.key({ modkey, "Shift" }, "q", awesome.quit),
|
||||||
|
|
||||||
|
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
|
||||||
|
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
|
||||||
|
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
|
||||||
|
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
|
||||||
|
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
|
||||||
|
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
|
||||||
|
awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
|
||||||
|
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
|
||||||
|
|
||||||
|
awful.key({ modkey, "Control" }, "n", awful.client.restore),
|
||||||
|
|
||||||
|
-- Prompt
|
||||||
|
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
|
||||||
|
|
||||||
|
awful.key({ modkey }, "x",
|
||||||
|
function ()
|
||||||
|
awful.prompt.run({ prompt = "Run Lua code: " },
|
||||||
|
mypromptbox[mouse.screen].widget,
|
||||||
|
awful.util.eval, nil,
|
||||||
|
awful.util.getdir("cache") .. "/history_eval")
|
||||||
|
end),
|
||||||
|
-- Menubar
|
||||||
|
awful.key({ modkey }, "p", function() menubar.show() end)
|
||||||
|
)
|
||||||
|
|
||||||
|
clientkeys = awful.util.table.join(
|
||||||
|
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
|
||||||
|
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
|
||||||
|
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
|
||||||
|
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
|
||||||
|
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
|
||||||
|
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
|
||||||
|
awful.key({ modkey, }, "n",
|
||||||
|
function (c)
|
||||||
|
-- The client currently has the input focus, so it cannot be
|
||||||
|
-- minimized, since minimized clients can't have the focus.
|
||||||
|
c.minimized = true
|
||||||
|
end),
|
||||||
|
awful.key({ modkey, }, "m",
|
||||||
|
function (c)
|
||||||
|
c.maximized_horizontal = not c.maximized_horizontal
|
||||||
|
c.maximized_vertical = not c.maximized_vertical
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Bind all key numbers to tags.
|
||||||
|
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
||||||
|
-- This should map on the top row of your keyboard, usually 1 to 9.
|
||||||
|
for i = 1, 9 do
|
||||||
|
globalkeys = awful.util.table.join(globalkeys,
|
||||||
|
-- View tag only.
|
||||||
|
awful.key({ modkey }, "#" .. i + 9,
|
||||||
|
function ()
|
||||||
|
local screen = mouse.screen
|
||||||
|
local tag = awful.tag.gettags(screen)[i]
|
||||||
|
if tag then
|
||||||
|
awful.tag.viewonly(tag)
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
-- Toggle tag.
|
||||||
|
awful.key({ modkey, "Control" }, "#" .. i + 9,
|
||||||
|
function ()
|
||||||
|
local screen = mouse.screen
|
||||||
|
local tag = awful.tag.gettags(screen)[i]
|
||||||
|
if tag then
|
||||||
|
awful.tag.viewtoggle(tag)
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
-- Move client to tag.
|
||||||
|
awful.key({ modkey, "Shift" }, "#" .. i + 9,
|
||||||
|
function ()
|
||||||
|
if client.focus then
|
||||||
|
local tag = awful.tag.gettags(client.focus.screen)[i]
|
||||||
|
if tag then
|
||||||
|
awful.client.movetotag(tag)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
-- Toggle tag.
|
||||||
|
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
|
||||||
|
function ()
|
||||||
|
if client.focus then
|
||||||
|
local tag = awful.tag.gettags(client.focus.screen)[i]
|
||||||
|
if tag then
|
||||||
|
awful.client.toggletag(tag)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
clientbuttons = awful.util.table.join(
|
||||||
|
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
||||||
|
awful.button({ modkey }, 1, awful.mouse.client.move),
|
||||||
|
awful.button({ modkey }, 3, awful.mouse.client.resize))
|
||||||
|
|
||||||
|
-- Set keys
|
||||||
|
root.keys(globalkeys)
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Rules
|
||||||
|
-- Rules to apply to new clients (through the "manage" signal).
|
||||||
|
awful.rules.rules = {
|
||||||
|
-- All clients will match this rule.
|
||||||
|
{ rule = { },
|
||||||
|
properties = { border_width = beautiful.border_width,
|
||||||
|
border_color = beautiful.border_normal,
|
||||||
|
focus = awful.client.focus.filter,
|
||||||
|
raise = true,
|
||||||
|
keys = clientkeys,
|
||||||
|
buttons = clientbuttons } },
|
||||||
|
{ rule = { class = "MPlayer" },
|
||||||
|
properties = { floating = true } },
|
||||||
|
{ rule = { class = "pinentry" },
|
||||||
|
properties = { floating = true } },
|
||||||
|
{ rule = { class = "gimp" },
|
||||||
|
properties = { floating = true } },
|
||||||
|
-- Set Firefox to always map on tags number 2 of screen 1.
|
||||||
|
-- { rule = { class = "Firefox" },
|
||||||
|
-- properties = { tag = tags[1][2] } },
|
||||||
|
}
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Signals
|
||||||
|
-- Signal function to execute when a new client appears.
|
||||||
|
client.connect_signal("manage", function (c, startup)
|
||||||
|
-- Enable sloppy focus
|
||||||
|
c:connect_signal("mouse::enter", function(c)
|
||||||
|
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
|
||||||
|
and awful.client.focus.filter(c) then
|
||||||
|
client.focus = c
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
if not startup then
|
||||||
|
-- Set the windows at the slave,
|
||||||
|
-- i.e. put it at the end of others instead of setting it master.
|
||||||
|
-- awful.client.setslave(c)
|
||||||
|
|
||||||
|
-- Put windows in a smart way, only if they does not set an initial position.
|
||||||
|
if not c.size_hints.user_position and not c.size_hints.program_position then
|
||||||
|
awful.placement.no_overlap(c)
|
||||||
|
awful.placement.no_offscreen(c)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local titlebars_enabled = false
|
||||||
|
if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
|
||||||
|
-- buttons for the titlebar
|
||||||
|
local buttons = awful.util.table.join(
|
||||||
|
awful.button({ }, 1, function()
|
||||||
|
client.focus = c
|
||||||
|
c:raise()
|
||||||
|
awful.mouse.client.move(c)
|
||||||
|
end),
|
||||||
|
awful.button({ }, 3, function()
|
||||||
|
client.focus = c
|
||||||
|
c:raise()
|
||||||
|
awful.mouse.client.resize(c)
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Widgets that are aligned to the left
|
||||||
|
local left_layout = wibox.layout.fixed.horizontal()
|
||||||
|
left_layout:add(awful.titlebar.widget.iconwidget(c))
|
||||||
|
left_layout:buttons(buttons)
|
||||||
|
|
||||||
|
-- Widgets that are aligned to the right
|
||||||
|
local right_layout = wibox.layout.fixed.horizontal()
|
||||||
|
right_layout:add(awful.titlebar.widget.floatingbutton(c))
|
||||||
|
right_layout:add(awful.titlebar.widget.maximizedbutton(c))
|
||||||
|
right_layout:add(awful.titlebar.widget.stickybutton(c))
|
||||||
|
right_layout:add(awful.titlebar.widget.ontopbutton(c))
|
||||||
|
right_layout:add(awful.titlebar.widget.closebutton(c))
|
||||||
|
|
||||||
|
-- The title goes in the middle
|
||||||
|
local middle_layout = wibox.layout.flex.horizontal()
|
||||||
|
local title = awful.titlebar.widget.titlewidget(c)
|
||||||
|
title:set_align("center")
|
||||||
|
middle_layout:add(title)
|
||||||
|
middle_layout:buttons(buttons)
|
||||||
|
|
||||||
|
-- Now bring it all together
|
||||||
|
local layout = wibox.layout.align.horizontal()
|
||||||
|
layout:set_left(left_layout)
|
||||||
|
layout:set_right(right_layout)
|
||||||
|
layout:set_middle(middle_layout)
|
||||||
|
|
||||||
|
awful.titlebar(c):set_widget(layout)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||||
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
|
-- }}}
|
99
_config/awesome__idefix.armorique.lan/theme.lua
Normal file
99
_config/awesome__idefix.armorique.lan/theme.lua
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
---------------------------
|
||||||
|
-- Default awesome theme --
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
theme = {}
|
||||||
|
|
||||||
|
theme.font = "sans 8"
|
||||||
|
|
||||||
|
theme.bg_normal = "#222222"
|
||||||
|
theme.bg_focus = "#535d6c"
|
||||||
|
theme.bg_urgent = "#ff0000"
|
||||||
|
theme.bg_minimize = "#444444"
|
||||||
|
theme.bg_systray = theme.bg_normal
|
||||||
|
|
||||||
|
theme.fg_normal = "#aaaaaa"
|
||||||
|
theme.fg_focus = "#ffffff"
|
||||||
|
theme.fg_urgent = "#ffffff"
|
||||||
|
theme.fg_minimize = "#ffffff"
|
||||||
|
|
||||||
|
theme.border_width = 1
|
||||||
|
theme.border_normal = "#000000"
|
||||||
|
theme.border_focus = "#535d6c"
|
||||||
|
theme.border_marked = "#91231c"
|
||||||
|
|
||||||
|
-- There are other variable sets
|
||||||
|
-- overriding the default one when
|
||||||
|
-- defined, the sets are:
|
||||||
|
-- taglist_[bg|fg]_[focus|urgent|occupied|empty]
|
||||||
|
-- tasklist_[bg|fg]_[focus|urgent]
|
||||||
|
-- titlebar_[bg|fg]_[normal|focus]
|
||||||
|
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
|
||||||
|
-- mouse_finder_[color|timeout|animate_timeout|radius|factor]
|
||||||
|
-- Example:
|
||||||
|
--theme.taglist_bg_focus = "#ff0000"
|
||||||
|
|
||||||
|
-- Display the taglist squares
|
||||||
|
theme.taglist_squares_sel = "/usr/local/share/awesome/themes/default/taglist/squarefw.png"
|
||||||
|
theme.taglist_squares_unsel = "/usr/local/share/awesome/themes/default/taglist/squarew.png"
|
||||||
|
|
||||||
|
-- Variables set for theming the menu:
|
||||||
|
-- menu_[bg|fg]_[normal|focus]
|
||||||
|
-- menu_[border_color|border_width]
|
||||||
|
theme.menu_submenu_icon = "/usr/local/share/awesome/themes/default/submenu.png"
|
||||||
|
theme.menu_height = 15
|
||||||
|
theme.menu_width = 100
|
||||||
|
|
||||||
|
-- You can add as many variables as
|
||||||
|
-- you wish and access them by using
|
||||||
|
-- beautiful.variable in your rc.lua
|
||||||
|
--theme.bg_widget = "#cc0000"
|
||||||
|
|
||||||
|
-- Define the image to load
|
||||||
|
theme.titlebar_close_button_normal = "/usr/local/share/awesome/themes/default/titlebar/close_normal.png"
|
||||||
|
theme.titlebar_close_button_focus = "/usr/local/share/awesome/themes/default/titlebar/close_focus.png"
|
||||||
|
|
||||||
|
theme.titlebar_ontop_button_normal_inactive = "/usr/local/share/awesome/themes/default/titlebar/ontop_normal_inactive.png"
|
||||||
|
theme.titlebar_ontop_button_focus_inactive = "/usr/local/share/awesome/themes/default/titlebar/ontop_focus_inactive.png"
|
||||||
|
theme.titlebar_ontop_button_normal_active = "/usr/local/share/awesome/themes/default/titlebar/ontop_normal_active.png"
|
||||||
|
theme.titlebar_ontop_button_focus_active = "/usr/local/share/awesome/themes/default/titlebar/ontop_focus_active.png"
|
||||||
|
|
||||||
|
theme.titlebar_sticky_button_normal_inactive = "/usr/local/share/awesome/themes/default/titlebar/sticky_normal_inactive.png"
|
||||||
|
theme.titlebar_sticky_button_focus_inactive = "/usr/local/share/awesome/themes/default/titlebar/sticky_focus_inactive.png"
|
||||||
|
theme.titlebar_sticky_button_normal_active = "/usr/local/share/awesome/themes/default/titlebar/sticky_normal_active.png"
|
||||||
|
theme.titlebar_sticky_button_focus_active = "/usr/local/share/awesome/themes/default/titlebar/sticky_focus_active.png"
|
||||||
|
|
||||||
|
theme.titlebar_floating_button_normal_inactive = "/usr/local/share/awesome/themes/default/titlebar/floating_normal_inactive.png"
|
||||||
|
theme.titlebar_floating_button_focus_inactive = "/usr/local/share/awesome/themes/default/titlebar/floating_focus_inactive.png"
|
||||||
|
theme.titlebar_floating_button_normal_active = "/usr/local/share/awesome/themes/default/titlebar/floating_normal_active.png"
|
||||||
|
theme.titlebar_floating_button_focus_active = "/usr/local/share/awesome/themes/default/titlebar/floating_focus_active.png"
|
||||||
|
|
||||||
|
theme.titlebar_maximized_button_normal_inactive = "/usr/local/share/awesome/themes/default/titlebar/maximized_normal_inactive.png"
|
||||||
|
theme.titlebar_maximized_button_focus_inactive = "/usr/local/share/awesome/themes/default/titlebar/maximized_focus_inactive.png"
|
||||||
|
theme.titlebar_maximized_button_normal_active = "/usr/local/share/awesome/themes/default/titlebar/maximized_normal_active.png"
|
||||||
|
theme.titlebar_maximized_button_focus_active = "/usr/local/share/awesome/themes/default/titlebar/maximized_focus_active.png"
|
||||||
|
|
||||||
|
theme.wallpaper = "/home/meutel/images/wallpapers/openbsd/thinksecurelyblackandwhite_1920x1200.png"
|
||||||
|
|
||||||
|
-- You can use your own layout icons like this:
|
||||||
|
theme.layout_fairh = "/usr/local/share/awesome/themes/default/layouts/fairhw.png"
|
||||||
|
theme.layout_fairv = "/usr/local/share/awesome/themes/default/layouts/fairvw.png"
|
||||||
|
theme.layout_floating = "/usr/local/share/awesome/themes/default/layouts/floatingw.png"
|
||||||
|
theme.layout_magnifier = "/usr/local/share/awesome/themes/default/layouts/magnifierw.png"
|
||||||
|
theme.layout_max = "/usr/local/share/awesome/themes/default/layouts/maxw.png"
|
||||||
|
theme.layout_fullscreen = "/usr/local/share/awesome/themes/default/layouts/fullscreenw.png"
|
||||||
|
theme.layout_tilebottom = "/usr/local/share/awesome/themes/default/layouts/tilebottomw.png"
|
||||||
|
theme.layout_tileleft = "/usr/local/share/awesome/themes/default/layouts/tileleftw.png"
|
||||||
|
theme.layout_tile = "/usr/local/share/awesome/themes/default/layouts/tilew.png"
|
||||||
|
theme.layout_tiletop = "/usr/local/share/awesome/themes/default/layouts/tiletopw.png"
|
||||||
|
theme.layout_spiral = "/usr/local/share/awesome/themes/default/layouts/spiralw.png"
|
||||||
|
theme.layout_dwindle = "/usr/local/share/awesome/themes/default/layouts/dwindlew.png"
|
||||||
|
|
||||||
|
theme.awesome_icon = "/usr/local/share/awesome/icons/awesome16.png"
|
||||||
|
|
||||||
|
-- Define the icon theme for application icons. If not set then the icons
|
||||||
|
-- from /usr/local/share/icons and /usr/local/share/icons/hicolor will be used.
|
||||||
|
theme.icon_theme = nil
|
||||||
|
|
||||||
|
return theme
|
||||||
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
25
_profile
Normal file
25
_profile
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# ~/.profile: executed by the command interpreter for login shells.
|
||||||
|
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
|
||||||
|
# exists.
|
||||||
|
# see /usr/share/doc/bash/examples/startup-files for examples.
|
||||||
|
# the files are located in the bash-doc package.
|
||||||
|
|
||||||
|
# the default umask is set in /etc/profile; for setting the umask
|
||||||
|
# for ssh logins, install and configure the libpam-umask package.
|
||||||
|
#umask 022
|
||||||
|
|
||||||
|
# if running bash
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
# include .bashrc if it exists
|
||||||
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
|
. "$HOME/.bashrc"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set PATH so it includes user's private bin if it exists
|
||||||
|
if [ -d "$HOME/bin" ] ; then
|
||||||
|
PATH="$HOME/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export LC_CTYPE=fr_FR.UTF-8
|
||||||
|
|
23
_profile__idefix.armorique.lan
Normal file
23
_profile__idefix.armorique.lan
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# $OpenBSD: dot.profile,v 1.4 2005/02/16 06:56:57 matthieu Exp $
|
||||||
|
#
|
||||||
|
# sh/ksh initialization
|
||||||
|
|
||||||
|
PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.
|
||||||
|
export PATH HOME TERM
|
||||||
|
|
||||||
|
export ENV=$HOME/.kshrc
|
||||||
|
|
||||||
|
# if running bash
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
# include .bashrc if it exists
|
||||||
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
|
. "$HOME/.bashrc"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set PATH so it includes user's private bin if it exists
|
||||||
|
if [ -d "$HOME/bin" ] ; then
|
||||||
|
PATH="$HOME/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export LC_CTYPE=fr_FR.UTF-8
|
6
_screenrc
Normal file
6
_screenrc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
hardstatus alwayslastline
|
||||||
|
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
|
||||||
|
shelltitle "$ |bash"
|
||||||
|
vbellwait 0.1
|
||||||
|
|
||||||
|
sorendition "ww"
|
40
_tmux.conf
Normal file
40
_tmux.conf
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
set -g prefix C-a
|
||||||
|
set -g default-terminal "screen-256color"
|
||||||
|
|
||||||
|
# Bindings for vertical + horizontal splits
|
||||||
|
unbind %
|
||||||
|
bind | split-window -h
|
||||||
|
bind - split-window -v
|
||||||
|
|
||||||
|
# show activity
|
||||||
|
set -g bell-action any
|
||||||
|
setw -g monitor-activity on
|
||||||
|
|
||||||
|
# start numbering windows at 1
|
||||||
|
set-option -g base-index 1
|
||||||
|
|
||||||
|
# to make ctrl-arrow, etc. work
|
||||||
|
set-window-option -g xterm-keys on
|
||||||
|
|
||||||
|
# lock commande
|
||||||
|
set-option -g lock-command vlock
|
||||||
|
|
||||||
|
### Instructs tmux to expect UTF-8 sequences to appear in this window.
|
||||||
|
setw -g utf8 on
|
||||||
|
|
||||||
|
### Instruct tmux to treat top-bit-set characters in the status-left and status-right strings as UTF-8;
|
||||||
|
set -g status-utf8 on
|
||||||
|
|
||||||
|
set-option -g history-limit 5000
|
||||||
|
|
||||||
|
set -g set-titles on
|
||||||
|
set -g set-titles-string '#(whoami) :: #h :: #W'
|
||||||
|
|
||||||
|
set -g status-bg black
|
||||||
|
set -g status-fg white
|
||||||
|
set -g status-interval 5
|
||||||
|
set -g status-left-length 90
|
||||||
|
set -g status-right-length 90
|
||||||
|
set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=blue]#h#[fg=white]#[fg=yellow]"
|
||||||
|
set -g status-justify left
|
||||||
|
set -g status-right '#[fg=Cyan]#S #[fg=green,bg=black]#(~/bin/tmux-mem-cpu-load --colors --interval 5) #[fg=white]%a %d %b %R'
|
81
_todo.cfg
Normal file
81
_todo.cfg
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
# === EDIT FILE LOCATIONS BELOW ===
|
||||||
|
|
||||||
|
# Your todo.txt directory
|
||||||
|
#export TODO_DIR="/Users/gina/Documents/todo"
|
||||||
|
export TODO_DIR=/home/meutel/sources/todo
|
||||||
|
|
||||||
|
# Your todo/done/report.txt locations
|
||||||
|
export TODO_FILE="$TODO_DIR/todo.txt"
|
||||||
|
export DONE_FILE="$TODO_DIR/done.txt"
|
||||||
|
export REPORT_FILE="$TODO_DIR/report.txt"
|
||||||
|
|
||||||
|
# You can customize your actions directory location
|
||||||
|
#export TODO_ACTIONS_DIR="$HOME/.todo.actions.d"
|
||||||
|
|
||||||
|
# == EDIT FILE LOCATIONS ABOVE ===
|
||||||
|
|
||||||
|
# === COLOR MAP ===
|
||||||
|
|
||||||
|
## Text coloring and formatting is done by inserting ANSI escape codes.
|
||||||
|
## If you have re-mapped your color codes, or use the todo.txt
|
||||||
|
## output in another output system (like Conky), you may need to
|
||||||
|
## over-ride by uncommenting and editing these defaults.
|
||||||
|
## If you change any of these here, you also need to uncomment
|
||||||
|
## the defaults in the COLORS section below. Otherwise, todo.txt
|
||||||
|
## will still use the defaults!
|
||||||
|
|
||||||
|
# export BLACK='\\033[0;30m'
|
||||||
|
# export RED='\\033[0;31m'
|
||||||
|
# export GREEN='\\033[0;32m'
|
||||||
|
# export BROWN='\\033[0;33m'
|
||||||
|
# export BLUE='\\033[0;34m'
|
||||||
|
# export PURPLE='\\033[0;35m'
|
||||||
|
# export CYAN='\\033[0;36m'
|
||||||
|
# export LIGHT_GREY='\\033[0;37m'
|
||||||
|
# export DARK_GREY='\\033[1;30m'
|
||||||
|
# export LIGHT_RED='\\033[1;31m'
|
||||||
|
# export LIGHT_GREEN='\\033[1;32m'
|
||||||
|
# export YELLOW='\\033[1;33m'
|
||||||
|
# export LIGHT_BLUE='\\033[1;34m'
|
||||||
|
# export LIGHT_PURPLE='\\033[1;35m'
|
||||||
|
# export LIGHT_CYAN='\\033[1;36m'
|
||||||
|
# export WHITE='\\033[1;37m'
|
||||||
|
# export DEFAULT='\\033[0m'
|
||||||
|
|
||||||
|
# === COLORS ===
|
||||||
|
|
||||||
|
## Uncomment and edit to override these defaults.
|
||||||
|
## Reference the constants from the color map above,
|
||||||
|
## or use $NONE to disable highlighting.
|
||||||
|
#
|
||||||
|
# Priorities can be any upper-case letter.
|
||||||
|
# A,B,C are highlighted; you can add coloring for more.
|
||||||
|
#
|
||||||
|
# export PRI_A=$YELLOW # color for A priority
|
||||||
|
# export PRI_B=$GREEN # color for B priority
|
||||||
|
# export PRI_C=$LIGHT_BLUE # color for C priority
|
||||||
|
# export PRI_D=... # define your own
|
||||||
|
# export PRI_X=$WHITE # color unless explicitly defined
|
||||||
|
|
||||||
|
# There is highlighting for tasks that have been done,
|
||||||
|
# but haven't been archived yet.
|
||||||
|
#
|
||||||
|
# export COLOR_DONE=$LIGHT_GREY
|
||||||
|
|
||||||
|
# === BEHAVIOR ===
|
||||||
|
|
||||||
|
## customize list output
|
||||||
|
#
|
||||||
|
# TODOTXT_SORT_COMMAND will filter after line numbers are
|
||||||
|
# inserted, but before colorization, and before hiding of
|
||||||
|
# priority, context, and project.
|
||||||
|
#
|
||||||
|
# export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -f -k2'
|
||||||
|
|
||||||
|
# TODOTXT_FINAL_FILTER will filter list output after colorization,
|
||||||
|
# priority hiding, context hiding, and project hiding. That is,
|
||||||
|
# just before the list output is displayed.
|
||||||
|
#
|
||||||
|
# export TODOTXT_FINAL_FILTER='cat'
|
||||||
|
export TODOTXT_DEFAULT_ACTION=lsp
|
||||||
|
export PAGER='less -X '
|
3
_vim/.netrwhist
Normal file
3
_vim/.netrwhist
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
let g:netrw_dirhistmax =10
|
||||||
|
let g:netrw_dirhist_cnt =1
|
||||||
|
let g:netrw_dirhist_1='/home/meutel/.config/auto_sync'
|
55
_vim/autoload/togglebg.vim
Normal file
55
_vim/autoload/togglebg.vim
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
" Toggle Background
|
||||||
|
" Modified: 2011 Apr 29
|
||||||
|
" Maintainer: Ethan Schoonover
|
||||||
|
" License: OSI approved MIT license
|
||||||
|
|
||||||
|
if exists("g:loaded_togglebg")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_togglebg = 1
|
||||||
|
|
||||||
|
" noremap is a bit misleading here if you are unused to vim mapping.
|
||||||
|
" in fact, there is remapping, but only of script locally defined remaps, in
|
||||||
|
" this case <SID>TogBG. The <script> argument modifies the noremap scope in
|
||||||
|
" this regard (and the noremenu below).
|
||||||
|
nnoremap <unique> <script> <Plug>ToggleBackground <SID>TogBG
|
||||||
|
inoremap <unique> <script> <Plug>ToggleBackground <ESC><SID>TogBG<ESC>a
|
||||||
|
vnoremap <unique> <script> <Plug>ToggleBackground <ESC><SID>TogBG<ESC>gv
|
||||||
|
nnoremenu <script> Window.Toggle\ Background <SID>TogBG
|
||||||
|
inoremenu <script> Window.Toggle\ Background <ESC><SID>TogBG<ESC>a
|
||||||
|
vnoremenu <script> Window.Toggle\ Background <ESC><SID>TogBG<ESC>gv
|
||||||
|
tmenu Window.Toggle\ Background Toggle light and dark background modes
|
||||||
|
nnoremenu <script> ToolBar.togglebg <SID>TogBG
|
||||||
|
inoremenu <script> ToolBar.togglebg <ESC><SID>TogBG<ESC>a
|
||||||
|
vnoremenu <script> ToolBar.togglebg <ESC><SID>TogBG<ESC>gv
|
||||||
|
tmenu ToolBar.togglebg Toggle light and dark background modes
|
||||||
|
noremap <SID>TogBG :call <SID>TogBG()<CR>
|
||||||
|
|
||||||
|
function! s:TogBG()
|
||||||
|
let &background = ( &background == "dark"? "light" : "dark" )
|
||||||
|
if exists("g:colors_name")
|
||||||
|
exe "colorscheme " . g:colors_name
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !exists(":ToggleBG")
|
||||||
|
command ToggleBG :call s:TogBG()
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! ToggleBackground()
|
||||||
|
echo "Please update your ToggleBackground mapping. ':help togglebg' for information."
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! togglebg#map(mapActivation)
|
||||||
|
try
|
||||||
|
exe "silent! nmap <unique> ".a:mapActivation." <Plug>ToggleBackground"
|
||||||
|
exe "silent! imap <unique> ".a:mapActivation." <Plug>ToggleBackground"
|
||||||
|
exe "silent! vmap <unique> ".a:mapActivation." <Plug>ToggleBackground"
|
||||||
|
finally
|
||||||
|
return 0
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !exists("no_plugin_maps") && !hasmapto('<Plug>ToggleBackground')
|
||||||
|
call togglebg#map("<F5>")
|
||||||
|
endif
|
BIN
_vim/bitmaps/togglebg.png
Normal file
BIN
_vim/bitmaps/togglebg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
1117
_vim/colors/solarized.vim
Normal file
1117
_vim/colors/solarized.vim
Normal file
File diff suppressed because it is too large
Load Diff
254
_vim/indent/html.vim
Normal file
254
_vim/indent/html.vim
Normal file
@ -0,0 +1,254 @@
|
|||||||
|
|
||||||
|
" Description: html indenter
|
||||||
|
" Author: Johannes Zellner <johannes@zellner.org>
|
||||||
|
" Last Change: Mo, 05 Jun 2006 22:32:41 CEST
|
||||||
|
" Restoring 'cpo' and 'ic' added by Bram 2006 May 5
|
||||||
|
" Globals: g:html_indent_tags -- indenting tags
|
||||||
|
" g:html_indent_strict -- inhibit 'O O' elements
|
||||||
|
" g:html_indent_strict_table -- inhibit 'O -' elements
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
"if exists("b:did_indent")
|
||||||
|
"finish
|
||||||
|
"endif
|
||||||
|
"let b:did_indent = 1
|
||||||
|
|
||||||
|
if exists("g:js_indent")
|
||||||
|
so g:js_indent
|
||||||
|
else
|
||||||
|
ru! indent/javascript.vim
|
||||||
|
endif
|
||||||
|
|
||||||
|
echo "Sourcing html indent"
|
||||||
|
|
||||||
|
|
||||||
|
" [-- local settings (must come before aborting the script) --]
|
||||||
|
setlocal indentexpr=HtmlIndentGetter(v:lnum)
|
||||||
|
setlocal indentkeys=o,O,*<Return>,<>>,{,}
|
||||||
|
|
||||||
|
|
||||||
|
if exists('g:html_indent_tags')
|
||||||
|
unlet g:html_indent_tags
|
||||||
|
endif
|
||||||
|
|
||||||
|
" [-- helper function to assemble tag list --]
|
||||||
|
fun! <SID>HtmlIndentPush(tag)
|
||||||
|
if exists('g:html_indent_tags')
|
||||||
|
let g:html_indent_tags = g:html_indent_tags.'\|'.a:tag
|
||||||
|
else
|
||||||
|
let g:html_indent_tags = a:tag
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
|
||||||
|
|
||||||
|
" [-- <ELEMENT ? - - ...> --]
|
||||||
|
call <SID>HtmlIndentPush('a')
|
||||||
|
call <SID>HtmlIndentPush('abbr')
|
||||||
|
call <SID>HtmlIndentPush('acronym')
|
||||||
|
call <SID>HtmlIndentPush('address')
|
||||||
|
call <SID>HtmlIndentPush('b')
|
||||||
|
call <SID>HtmlIndentPush('bdo')
|
||||||
|
call <SID>HtmlIndentPush('big')
|
||||||
|
call <SID>HtmlIndentPush('blockquote')
|
||||||
|
call <SID>HtmlIndentPush('button')
|
||||||
|
call <SID>HtmlIndentPush('caption')
|
||||||
|
call <SID>HtmlIndentPush('center')
|
||||||
|
call <SID>HtmlIndentPush('cite')
|
||||||
|
call <SID>HtmlIndentPush('code')
|
||||||
|
call <SID>HtmlIndentPush('colgroup')
|
||||||
|
call <SID>HtmlIndentPush('del')
|
||||||
|
call <SID>HtmlIndentPush('dfn')
|
||||||
|
call <SID>HtmlIndentPush('dir')
|
||||||
|
call <SID>HtmlIndentPush('div')
|
||||||
|
call <SID>HtmlIndentPush('dl')
|
||||||
|
call <SID>HtmlIndentPush('em')
|
||||||
|
call <SID>HtmlIndentPush('fieldset')
|
||||||
|
call <SID>HtmlIndentPush('font')
|
||||||
|
call <SID>HtmlIndentPush('form')
|
||||||
|
call <SID>HtmlIndentPush('frameset')
|
||||||
|
call <SID>HtmlIndentPush('h1')
|
||||||
|
call <SID>HtmlIndentPush('h2')
|
||||||
|
call <SID>HtmlIndentPush('h3')
|
||||||
|
call <SID>HtmlIndentPush('h4')
|
||||||
|
call <SID>HtmlIndentPush('h5')
|
||||||
|
call <SID>HtmlIndentPush('h6')
|
||||||
|
call <SID>HtmlIndentPush('i')
|
||||||
|
call <SID>HtmlIndentPush('iframe')
|
||||||
|
call <SID>HtmlIndentPush('ins')
|
||||||
|
call <SID>HtmlIndentPush('kbd')
|
||||||
|
call <SID>HtmlIndentPush('label')
|
||||||
|
call <SID>HtmlIndentPush('legend')
|
||||||
|
call <SID>HtmlIndentPush('map')
|
||||||
|
call <SID>HtmlIndentPush('menu')
|
||||||
|
call <SID>HtmlIndentPush('noframes')
|
||||||
|
call <SID>HtmlIndentPush('noscript')
|
||||||
|
call <SID>HtmlIndentPush('object')
|
||||||
|
call <SID>HtmlIndentPush('ol')
|
||||||
|
call <SID>HtmlIndentPush('optgroup')
|
||||||
|
" call <SID>HtmlIndentPush('pre')
|
||||||
|
call <SID>HtmlIndentPush('q')
|
||||||
|
call <SID>HtmlIndentPush('s')
|
||||||
|
call <SID>HtmlIndentPush('samp')
|
||||||
|
call <SID>HtmlIndentPush('script')
|
||||||
|
call <SID>HtmlIndentPush('select')
|
||||||
|
call <SID>HtmlIndentPush('small')
|
||||||
|
call <SID>HtmlIndentPush('span')
|
||||||
|
call <SID>HtmlIndentPush('strong')
|
||||||
|
call <SID>HtmlIndentPush('style')
|
||||||
|
call <SID>HtmlIndentPush('sub')
|
||||||
|
call <SID>HtmlIndentPush('sup')
|
||||||
|
call <SID>HtmlIndentPush('table')
|
||||||
|
call <SID>HtmlIndentPush('textarea')
|
||||||
|
call <SID>HtmlIndentPush('title')
|
||||||
|
call <SID>HtmlIndentPush('tt')
|
||||||
|
call <SID>HtmlIndentPush('u')
|
||||||
|
call <SID>HtmlIndentPush('ul')
|
||||||
|
call <SID>HtmlIndentPush('var')
|
||||||
|
|
||||||
|
|
||||||
|
" [-- <ELEMENT ? O O ...> --]
|
||||||
|
if !exists('g:html_indent_strict')
|
||||||
|
call <SID>HtmlIndentPush('body')
|
||||||
|
call <SID>HtmlIndentPush('head')
|
||||||
|
call <SID>HtmlIndentPush('html')
|
||||||
|
call <SID>HtmlIndentPush('tbody')
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" [-- <ELEMENT ? O - ...> --]
|
||||||
|
if !exists('g:html_indent_strict_table')
|
||||||
|
call <SID>HtmlIndentPush('th')
|
||||||
|
call <SID>HtmlIndentPush('td')
|
||||||
|
call <SID>HtmlIndentPush('tr')
|
||||||
|
call <SID>HtmlIndentPush('tfoot')
|
||||||
|
call <SID>HtmlIndentPush('thead')
|
||||||
|
endif
|
||||||
|
|
||||||
|
delfun <SID>HtmlIndentPush
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
|
" [-- count indent-increasing tags of line a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentOpen(lnum, pattern)
|
||||||
|
let s = substitute('x'.getline(a:lnum),
|
||||||
|
\ '.\{-}\(\(<\)\('.a:pattern.'\)\>\)', "\1", 'g')
|
||||||
|
let s = substitute(s, "[^\1].*$", '', '')
|
||||||
|
return strlen(s)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-decreasing tags of line a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentClose(lnum, pattern)
|
||||||
|
let s = substitute('x'.getline(a:lnum),
|
||||||
|
\ '.\{-}\(\(<\)/\('.a:pattern.'\)\>>\)', "\1", 'g')
|
||||||
|
let s = substitute(s, "[^\1].*$", '', '')
|
||||||
|
return strlen(s)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-increasing '{' of (java|css) line a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentOpenAlt(lnum)
|
||||||
|
return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g'))
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-decreasing '}' of (java|css) line a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentCloseAlt(lnum)
|
||||||
|
return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g'))
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- return the sum of indents respecting the syntax of a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentSum(lnum, style)
|
||||||
|
if a:style == match(getline(a:lnum), '^\s*</')
|
||||||
|
if a:style == match(getline(a:lnum), '^\s*</\<\('.g:html_indent_tags.'\)\>')
|
||||||
|
let open = <SID>HtmlIndentOpen(a:lnum, g:html_indent_tags)
|
||||||
|
let close = <SID>HtmlIndentClose(a:lnum, g:html_indent_tags)
|
||||||
|
if 0 != open || 0 != close
|
||||||
|
return open - close
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if '' != &syntax &&
|
||||||
|
\ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' &&
|
||||||
|
\ synIDattr(synID(a:lnum, strlen(getline(a:lnum)), 1), 'name')
|
||||||
|
\ =~ '\(css\|java\).*'
|
||||||
|
if a:style == match(getline(a:lnum), '^\s*}')
|
||||||
|
return <SID>HtmlIndentOpenAlt(a:lnum) - <SID>HtmlIndentCloseAlt(a:lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
return 0
|
||||||
|
endfun
|
||||||
|
|
||||||
|
fun! HtmlIndentGetter(lnum)
|
||||||
|
|
||||||
|
echo "Grabbing html indent for line: " . a:lnum
|
||||||
|
" Find a non-empty line above the current line.
|
||||||
|
let lnum = prevnonblank(a:lnum - 1)
|
||||||
|
|
||||||
|
" Hit the start of the file, use zero indent.
|
||||||
|
if lnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let restore_ic = &ic
|
||||||
|
setlocal ic " ignore case
|
||||||
|
|
||||||
|
" [-- special handling for <pre>: no indenting --]
|
||||||
|
if getline(a:lnum) =~ '\c</pre>'
|
||||||
|
\ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nWb')
|
||||||
|
\ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nW')
|
||||||
|
" we're in a line with </pre> or inside <pre> ... </pre>
|
||||||
|
if restore_ic == 0
|
||||||
|
setlocal noic
|
||||||
|
endif
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" [-- special handling for <javascript>: use cindent --]
|
||||||
|
let js = '<script.*type\s*=.*javascript'
|
||||||
|
|
||||||
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" by Tye Zdrojewski <zdro@yahoo.com>, 05 Jun 2006
|
||||||
|
" ZDR: This needs to be an AND (we are 'after the start of the pair' AND
|
||||||
|
" we are 'before the end of the pair'). Otherwise, indentation
|
||||||
|
" before the start of the script block will be affected; the end of
|
||||||
|
" the pair will still match if we are before the beginning of the
|
||||||
|
" pair.
|
||||||
|
"
|
||||||
|
if 0 < searchpair(js, '', '</script>', 'nWb')
|
||||||
|
\ && 0 < searchpair(js, '', '</script>', 'nW')
|
||||||
|
" we're inside javascript
|
||||||
|
|
||||||
|
if getline(lnum) !~ js && getline(a:lnum) !~ '</script>'
|
||||||
|
if restore_ic == 0
|
||||||
|
setlocal noic
|
||||||
|
endif
|
||||||
|
return GetJsIndent(a:lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if getline(lnum) =~ '\c</pre>'
|
||||||
|
" line before the current line a:lnum contains
|
||||||
|
" a closing </pre>. --> search for line before
|
||||||
|
" starting <pre> to restore the indent.
|
||||||
|
let preline = prevnonblank(search('\c<pre>', 'bW') - 1)
|
||||||
|
if preline > 0
|
||||||
|
if restore_ic == 0
|
||||||
|
setlocal noic
|
||||||
|
endif
|
||||||
|
return indent(preline)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
let ind = <SID>HtmlIndentSum(lnum, -1)
|
||||||
|
let ind = ind + <SID>HtmlIndentSum(a:lnum, 0)
|
||||||
|
|
||||||
|
if restore_ic == 0
|
||||||
|
setlocal noic
|
||||||
|
endif
|
||||||
|
|
||||||
|
return indent(lnum) + (&sw * ind)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
" [-- EOF <runtime>/indent/html.vim --]
|
407
_vim/indent/javascript.vim
Normal file
407
_vim/indent/javascript.vim
Normal file
@ -0,0 +1,407 @@
|
|||||||
|
" Vim indent file Language: JavaScript
|
||||||
|
" Author: Preston Koprivica (pkopriv2@gmail.com)
|
||||||
|
" URL:
|
||||||
|
" Last Change: April 30, 2010
|
||||||
|
|
||||||
|
" 0. Standard Stuff
|
||||||
|
" =================
|
||||||
|
|
||||||
|
" Only load one indent script per buffer
|
||||||
|
if exists('b:did_indent')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
" Set the global log variable 1 = logging enabled, 0 = logging disabled
|
||||||
|
if !exists("g:js_indent_log")
|
||||||
|
let g:js_indent_log = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal indentexpr=GetJsIndent(v:lnum)
|
||||||
|
setlocal indentkeys=
|
||||||
|
|
||||||
|
|
||||||
|
setlocal cindent
|
||||||
|
setlocal autoindent
|
||||||
|
|
||||||
|
|
||||||
|
" 1. Variables
|
||||||
|
" ============
|
||||||
|
|
||||||
|
" Inline comments (for anchoring other statements)
|
||||||
|
let s:js_mid_line_comment = '\s*\(\/\*.*\*\/\)*\s*'
|
||||||
|
let s:js_end_line_comment = s:js_mid_line_comment . '\s*\(//.*\)*'
|
||||||
|
let s:js_line_comment = s:js_end_line_comment
|
||||||
|
|
||||||
|
" Comment/String Syntax Key
|
||||||
|
let s:syn_comment = '\(Comment\|String\|Regexp\)'
|
||||||
|
|
||||||
|
|
||||||
|
" 2. Aux. Functions
|
||||||
|
" =================
|
||||||
|
|
||||||
|
" = Method: IsInComment
|
||||||
|
"
|
||||||
|
" Determines whether the specified position is contained in a comment. "Note:
|
||||||
|
" This depends on a
|
||||||
|
function! s:IsInComment(lnum, cnum)
|
||||||
|
return synIDattr(synID(a:lnum, a:cnum, 1), 'name') =~? s:syn_comment
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" = Method: IsComment
|
||||||
|
"
|
||||||
|
" Determines whether a line is a comment or not.
|
||||||
|
function! s:IsComment(lnum)
|
||||||
|
let line = getline(a:lnum)
|
||||||
|
|
||||||
|
return s:IsInComment(a:lnum, 1) && s:IsInComment(a:lnum, strlen(line)) "Doesn't absolutely work. Only Probably!
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" = Method: GetNonCommentLine
|
||||||
|
"
|
||||||
|
" Grabs the nearest non-commented line
|
||||||
|
function! s:GetNonCommentLine(lnum)
|
||||||
|
let lnum = prevnonblank(a:lnum)
|
||||||
|
|
||||||
|
while lnum > 0
|
||||||
|
if s:IsComment(lnum)
|
||||||
|
let lnum = prevnonblank(lnum - 1)
|
||||||
|
else
|
||||||
|
return lnum
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return lnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" = Method: SearchForPair
|
||||||
|
"
|
||||||
|
" Returns the beginning tag of a given pair starting from the given line.
|
||||||
|
function! s:SearchForPair(lnum, beg, end)
|
||||||
|
" Save the cursor position.
|
||||||
|
let curpos = getpos(".")
|
||||||
|
|
||||||
|
" Set the cursor position to the beginning of the line (default
|
||||||
|
" behavior when using ==)
|
||||||
|
call cursor(a:lnum, 0)
|
||||||
|
|
||||||
|
" Search for the opening tag
|
||||||
|
let mnum = searchpair(a:beg, '', a:end, 'bW',
|
||||||
|
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? s:syn_comment' )
|
||||||
|
|
||||||
|
"Restore the cursor position
|
||||||
|
call cursor(curpos)
|
||||||
|
|
||||||
|
" Finally, return the matched line number
|
||||||
|
return mnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Object Helpers
|
||||||
|
" ==============
|
||||||
|
let s:object_beg = '{[^}]*' . s:js_end_line_comment . '$'
|
||||||
|
let s:object_end = '^' . s:js_mid_line_comment . '}[;,]\='
|
||||||
|
|
||||||
|
|
||||||
|
function! s:IsObjectBeg(line)
|
||||||
|
return a:line =~ s:object_beg
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsObjectEnd(line)
|
||||||
|
return a:line =~ s:object_end
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:GetObjectBeg(lnum)
|
||||||
|
return s:SearchForPair(a:lnum, '{', '}')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Array Helpers
|
||||||
|
" ==============
|
||||||
|
let s:array_beg = '\[[^\]]*' . s:js_end_line_comment . '$'
|
||||||
|
let s:array_end = '^' . s:js_mid_line_comment . '[^\[]*\][;,]*' . s:js_end_line_comment . '$'
|
||||||
|
|
||||||
|
|
||||||
|
function! s:IsArrayBeg(line)
|
||||||
|
return a:line =~ s:array_beg
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsArrayEnd(line)
|
||||||
|
return a:line =~ s:array_end
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:GetArrayBeg(lnum)
|
||||||
|
return s:SearchForPair(a:lnum, '\[', '\]')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" MultiLine Declaration/Invocation Helpers
|
||||||
|
" ========================================
|
||||||
|
let s:paren_beg = '([^)]*' . s:js_end_line_comment . '$'
|
||||||
|
let s:paren_end = '^' . s:js_mid_line_comment . '[^(]*)[;,]*'
|
||||||
|
|
||||||
|
function! s:IsParenBeg(line)
|
||||||
|
return a:line =~ s:paren_beg
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsParenEnd(line)
|
||||||
|
return a:line =~ s:paren_end
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:GetParenBeg(lnum)
|
||||||
|
return s:SearchForPair(a:lnum, '(', ')')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" Continuation Helpers
|
||||||
|
" ====================
|
||||||
|
let s:continuation = '\(+\|\\\)\{1}' . s:js_line_comment . '$'
|
||||||
|
|
||||||
|
function! s:IsContinuationLine(line)
|
||||||
|
return a:line =~ s:continuation
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:GetContinuationBegin(lnum)
|
||||||
|
let cur = a:lnum
|
||||||
|
|
||||||
|
while s:IsContinuationLine(getline(cur))
|
||||||
|
let cur -= 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return cur + 1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Switch Helpers
|
||||||
|
" ==============
|
||||||
|
let s:switch_beg_next_line = 'switch\s*(.*)\s*' . s:js_mid_line_comment . s:js_end_line_comment . '$'
|
||||||
|
let s:switch_beg_same_line = 'switch\s*(.*)\s*' . s:js_mid_line_comment . '{\s*' . s:js_line_comment . '$'
|
||||||
|
let s:switch_mid = '^.*\(case.*\|default\)\s*:\s*'
|
||||||
|
|
||||||
|
function! s:IsSwitchBeginNextLine(line)
|
||||||
|
return a:line =~ s:switch_beg_next_line
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsSwitchBeginSameLine(line)
|
||||||
|
return a:line =~ s:switch_beg_same_line
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsSwitchMid(line)
|
||||||
|
return a:line =~ s:switch_mid
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Control Helpers
|
||||||
|
" ===============
|
||||||
|
let s:cntrl_beg_keys = '\(\(\(if\|for\|with\|while\)\s*(.*)\)\|\(try\|do\)\)\s*'
|
||||||
|
let s:cntrl_mid_keys = '\(\(\(else\s*if\|catch\)\s*(.*)\)\|\(finally\|else\)\)\s*'
|
||||||
|
|
||||||
|
let s:cntrl_beg = s:cntrl_beg_keys . s:js_end_line_comment . '$'
|
||||||
|
let s:cntrl_mid = s:cntrl_mid_keys . s:js_end_line_comment . '$'
|
||||||
|
|
||||||
|
let s:cntrl_end = '\(while\s*(.*)\)\s*;\=\s*' . s:js_end_line_comment . '$'
|
||||||
|
|
||||||
|
function! s:IsControlBeg(line)
|
||||||
|
return a:line =~ s:cntrl_beg
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsControlMid(line)
|
||||||
|
return a:line =~ s:cntrl_mid
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsControlMidStrict(line)
|
||||||
|
return a:line =~ s:cntrl_mid
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsControlEnd(line)
|
||||||
|
return a:line =~ s:cntrl_end
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" = Method: Log
|
||||||
|
"
|
||||||
|
" Logs a message to the stdout.
|
||||||
|
function! s:Log(msg)
|
||||||
|
if g:js_indent_log
|
||||||
|
echo "LOG: " . a:msg
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" 3. Indenter
|
||||||
|
" ===========
|
||||||
|
function! GetJsIndent(lnum)
|
||||||
|
" Grab the first non-comment line prior to this line
|
||||||
|
let pnum = s:GetNonCommentLine(a:lnum-1)
|
||||||
|
|
||||||
|
" First line, start at indent = 0
|
||||||
|
if pnum == 0
|
||||||
|
call s:Log("No, noncomment lines prior to the current line.")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Grab the second non-comment line prior to this line
|
||||||
|
let ppnum = s:GetNonCommentLine(pnum-1)
|
||||||
|
|
||||||
|
call s:Log("Line: " . a:lnum)
|
||||||
|
call s:Log("PLine: " . pnum)
|
||||||
|
call s:Log("PPLine: " . ppnum)
|
||||||
|
|
||||||
|
" Grab the lines themselves.
|
||||||
|
let line = getline(a:lnum)
|
||||||
|
let pline = getline(pnum)
|
||||||
|
let ppline = getline(ppnum)
|
||||||
|
|
||||||
|
" Determine the current level of indentation
|
||||||
|
let ind = indent(pnum)
|
||||||
|
|
||||||
|
|
||||||
|
" Handle: Object Closers (ie })
|
||||||
|
" =============================
|
||||||
|
if s:IsObjectEnd(line) && !s:IsComment(a:lnum)
|
||||||
|
call s:Log("Line matched object end")
|
||||||
|
|
||||||
|
let obeg = s:GetObjectBeg(a:lnum)
|
||||||
|
let oind = indent(obeg)
|
||||||
|
let oline = getline(obeg)
|
||||||
|
|
||||||
|
call s:Log("The object beg was found at: " . obeg)
|
||||||
|
return oind
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:IsObjectBeg(pline)
|
||||||
|
call s:Log("Pline matched object beg")
|
||||||
|
return ind + &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" Handle: Array Closer (ie ])
|
||||||
|
" ============================
|
||||||
|
if s:IsArrayEnd(line) && !s:IsComment(a:lnum)
|
||||||
|
call s:Log("Line matched array end")
|
||||||
|
|
||||||
|
let abeg = s:GetArrayBeg(a:lnum)
|
||||||
|
let aind = indent(abeg)
|
||||||
|
|
||||||
|
call s:Log("The array beg was found at: " . abeg)
|
||||||
|
return aind
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:IsArrayBeg(pline)
|
||||||
|
call s:Log("Pline matched array beg")
|
||||||
|
return ind + &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Handle: Parens
|
||||||
|
" ==============
|
||||||
|
if s:IsParenEnd(line) && !s:IsComment(a:lnum)
|
||||||
|
call s:Log("Line matched paren end")
|
||||||
|
|
||||||
|
let abeg = s:GetParenBeg(a:lnum)
|
||||||
|
let aind = indent(abeg)
|
||||||
|
|
||||||
|
call s:Log("The paren beg was found at: " . abeg)
|
||||||
|
return aind
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:IsParenBeg(pline)
|
||||||
|
call s:Log("Pline matched paren beg")
|
||||||
|
return ind + &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" Handle: Continuation Lines.
|
||||||
|
" ========================================================
|
||||||
|
if s:IsContinuationLine(pline)
|
||||||
|
call s:Log('Pline is a continuation line.')
|
||||||
|
|
||||||
|
let cbeg = s:GetContinuationBegin(pnum)
|
||||||
|
let cind = indent(cbeg)
|
||||||
|
|
||||||
|
call s:Log('The continuation block begin found at: ' . cbeg)
|
||||||
|
return cind + &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:IsContinuationLine(ppline)
|
||||||
|
call s:Log('PPline was a continuation line but pline wasnt.')
|
||||||
|
return ind - &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Handle: Switch Control Blocks
|
||||||
|
" =============================
|
||||||
|
if s:IsSwitchMid(pline)
|
||||||
|
call s:Log("PLine matched switch cntrl mid")
|
||||||
|
if s:IsSwitchMid(line) || s:IsObjectEnd(line)
|
||||||
|
call s:Log("Line matched a cntrl mid")
|
||||||
|
return ind
|
||||||
|
else
|
||||||
|
call s:Log("Line didnt match a cntrl mid")
|
||||||
|
return ind + &sw
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:IsSwitchMid(line)
|
||||||
|
call s:Log("Line matched switch cntrl mid")
|
||||||
|
return ind - &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" Handle: Single Line Control Blocks
|
||||||
|
" ==================================
|
||||||
|
if s:IsControlBeg(pline)
|
||||||
|
call s:Log("Pline matched control beginning")
|
||||||
|
|
||||||
|
if s:IsControlMid(line)
|
||||||
|
call s:Log("Line matched a control mid")
|
||||||
|
return ind
|
||||||
|
elseif line =~ '^\s*{\s*$'
|
||||||
|
call s:Log("Line matched an object beg")
|
||||||
|
return ind
|
||||||
|
else
|
||||||
|
return ind + &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:IsControlMid(pline)
|
||||||
|
call s:Log("Pline matched a control mid")
|
||||||
|
|
||||||
|
if s:IsControlMid(line)
|
||||||
|
call s:Log("Line matched a control mid")
|
||||||
|
return ind
|
||||||
|
elseif s:IsObjectBeg(line)
|
||||||
|
call s:Log("Line matched an object beg")
|
||||||
|
return ind
|
||||||
|
else
|
||||||
|
call s:Log("Line didn't match a control mid or object beg."
|
||||||
|
return ind + &sw
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:IsControlMid(line)
|
||||||
|
call s:Log("Line matched a control mid.")
|
||||||
|
|
||||||
|
if s:IsControlEnd(pline) || s:IsObjectEnd(pline)
|
||||||
|
call s:Log("PLine matched control end")
|
||||||
|
return ind
|
||||||
|
else
|
||||||
|
call s:Log("Pline didn't match object end")
|
||||||
|
return ind - &sw
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
if ( s:IsControlBeg(ppline) || s:IsControlMid(ppline) ) &&
|
||||||
|
\ !s:IsObjectBeg(pline) && !s:IsObjectEnd(pline)
|
||||||
|
call s:Log("PPLine matched single line control beg or mid")
|
||||||
|
return ind - &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Handle: No matches
|
||||||
|
" ==================
|
||||||
|
"call s:Log("Line didn't match anything. Retaining indent")
|
||||||
|
return ind
|
||||||
|
endfunction
|
BIN
_vim/spell/fr.latin1.spl
Normal file
BIN
_vim/spell/fr.latin1.spl
Normal file
Binary file not shown.
BIN
_vim/spell/fr.latin1.sug
Normal file
BIN
_vim/spell/fr.latin1.sug
Normal file
Binary file not shown.
BIN
_vim/spell/fr.utf-8.spl
Normal file
BIN
_vim/spell/fr.utf-8.spl
Normal file
Binary file not shown.
BIN
_vim/spell/fr.utf-8.sug
Normal file
BIN
_vim/spell/fr.utf-8.sug
Normal file
Binary file not shown.
34
_vimrc
Normal file
34
_vimrc
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
syntax enable
|
||||||
|
set nu
|
||||||
|
set cursorline
|
||||||
|
set ai
|
||||||
|
set smartindent
|
||||||
|
" nombre de colonnes pour représenter une tabulation, nombre d'espaces d'une
|
||||||
|
" tabulation, nombre d'espaces d'une indentation, ne pas remplacer les
|
||||||
|
" tabulations par des espaces
|
||||||
|
set ts=4 sts=4 sw=4 noexpandtab
|
||||||
|
" detection du type de fichier et indentation adequate (touche =)
|
||||||
|
filetype on
|
||||||
|
filetype plugin on
|
||||||
|
filetype indent on
|
||||||
|
" permet de quiter un buffer modifié sans alerte (avec :bn ou :bp)
|
||||||
|
" on a toujours l'alerte si on quitte vim
|
||||||
|
set hidden
|
||||||
|
" theme de couleur
|
||||||
|
set t_Co=256
|
||||||
|
set background=dark
|
||||||
|
let g:solarized_termtrans=1
|
||||||
|
let g:solarized_termcolors=256
|
||||||
|
colorscheme solarized
|
||||||
|
" recherche avec surbrillance
|
||||||
|
set incsearch
|
||||||
|
set showmatch
|
||||||
|
set hlsearch
|
||||||
|
|
||||||
|
" indent javascript
|
||||||
|
filetype plugin indent on
|
||||||
|
|
||||||
|
" remap <ESC>
|
||||||
|
inoremap jk <ESC>
|
||||||
|
" leader key
|
||||||
|
let mapleader = ","
|
1
_xinitrc__asterix
Normal file
1
_xinitrc__asterix
Normal file
@ -0,0 +1 @@
|
|||||||
|
exec ck-launch-session /usr/bin/xbmc-standalone
|
Loading…
Reference in New Issue
Block a user