Dotfiles

Ovaj deo je namenjen diskusiji koja nije vezana ni za jednu prethodnu kategoriju, a tiče se Slackware linuxa

Moderator: Urednik

Post Reply

Administrator
Administrator
offline
User avatar

Posts: 4590
Joined: 04 Feb 2011, 20:32
Location: Beograd
Contact:

Post Napisano: 10 Nov 2012, 12:22


Podelite vaše konfiguracione datoteke sa ostatkom zajednice. :)

.bashrc

Code: Select all

# Bash startup file
# bocke, 2012, bocke <at> slackware-srbija <dot> org.

# If not running interactively (ie: script), exit immediately.
[ -z "$PS1" ] && return

# Source color definitions
[ -f ~/.bash_colors ] && source ~/.bash_colors

# Add custom paths to the PATH
PATH="$PATH:$HOME/.local/bin"
MANPATH="$MANPATH:$HOME/.local/man"

export GTK2_RC_FILES=$HOME/.gtkrc-2.0

# Are we on Slack? (not crack)
if [ -f /etc/slackware-version ]
then
	# I used to use this for Slack specific options when I dual 
	# booted with Arch. It doesn't hurt to leave it here.
	export SLACK=1
fi

# Fancy shell prompt
PS1="\n[\[${TXTGRN}\]\j\[${TXTRST}\]][$(tty)][\[$TXTGRN\]\u\[$TXTRST\]][\w] (\A)\n \[${TXTGRN}\]~>\[${TXTRST}\] "

# Set some usual suspects
EDITOR=ex
VISUAL=vim
PAGER=less
LESS="-R"
export LESS PAGER VISUAL EDITOR

# Bash options
shopt -s checkwinsize
shopt -s huponexit
shopt -s cdable_vars
shopt -s extglob
set -C
set -o vi
set -m

# Set terminal type depending on if X is started or not
if [ -z "$DISPLAY" ]; then
	export TERM='linux'
else
	export TERM='rxvt'
	PROMPT_COMMAND='echo -ne "\033]0;${PWD}\007"'
fi

# Set transparency for xterm/uxterm
[ -n "$XTERM_VERSION" ] && transset-df -a 0.8 >/dev/null

# Set the default browser depending on if X is started or not
if [ -n "$DISPLAY" ]; then
	export BROWSER=firefox
else
	export BROWSER=links
fi

# This is optional on Slack, so we better check.
COMPLETITION=$(type -t complete)
if [ $COMPLETITION == builtin ]
then
	complete -cf man
fi

# Aliases
alias ls="ls --color"
alias lsl="ls -lhS --group-directories-first"
alias lsd="ls -d */"
alias lsn="ls --color=never"
alias dir="dir --color"
alias dirn="dir --color=never"
alias d="dir"
alias du="du -h"
alias df="df -h"
alias free="free -m"
alias grep="grep --color"
alias grepn="grep --color=never"

unset SLACK
.bash_colors

Code: Select all

# Definicije boja
TXTBLK='\e[0;30m' # Black - Regular
TXTRED='\e[0;31m' # Red
TXTGRN='\e[0;32m' # Green
TXTYLW='\e[0;33m' # Yellow
TXTBLU='\e[0;34m' # Blue
TXTPUR='\e[0;35m' # Purple
TXTCYN='\e[0;36m' # Cyan
TXTWHT='\e[0;37m' # White
BLDBLK='\e[1;30m' # Black - Bold
BLDRED='\e[1;31m' # Red
BLDGRN='\e[1;32m' # Green
BLDYLW='\e[1;33m' # Yellow
BLDBLU='\e[1;34m' # Blue
BLDPUR='\e[1;35m' # Purple
BLDCYN='\e[1;36m' # Cyan
BLDWHT='\e[1;37m' # White
UNDBLK='\e[4;30m' # Black - Underline
UNDRED='\e[4;31m' # Red
UNDGRN='\e[4;32m' # Green
UNDYLW='\e[4;33m' # Yellow
UNDBLU='\e[4;34m' # Blue
UNDPUR='\e[4;35m' # Purple
UNDCYN='\e[4;36m' # Cyan
UNDWHT='\e[4;37m' # White
BAKBLK='\e[40m'   # Black - Background
BAKRED='\e[41m'   # Red
BAKGRN='\e[42m'   # Green
BAKYLW='\e[43m'   # Yellow
BAKBLU='\e[44m'   # Blue
BAKPUR='\e[45m'   # Purple
BAKCYN='\e[46m'   # Cyan
BAKWHT='\e[47m'   # White
TXTRST='\e[0m'    # Text Reset
.profile

Code: Select all

export LANG=en_US.utf8

export LC_COLLATE=sr_RS@latin
export LC_CTYPE=sr_RS@latin
export LC_MEASUREMENT=sr_RS@latin
export LC_MONETARY=sr_RS@latin
export LC_NUMERIC=sr_RS@latin
export LC_PAPER=sr_RS@latin
export LC_TELEPHONE=sr_RS@latin
export LC_TIME=sr_RS@latin 
.bash_profile

Code: Select all

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc
.vimrc

Code: Select all

" vimrc, bocke, bocke <at> slackware-srbija <dot> org, 2012

" Let vim options override vi-like behaviour where appropriate
set nocompatible

" Vim under Slack needed this before. Might not be needed anymore.
set encoding=utf-8

" Mouse support under all modes
set mouse=a

" Options with a value
set backspace=indent,eol,start 
set tabstop=4
set shiftwidth=4
set laststatus=2
set cmdheight=1
set foldlevel=3
set report=0
set numberwidth=2
set viminfo="1000,<1000,s1000,:1000,%1000,

" Options without a value
set showfulltag
set showcmd
set showmode
set number
set showmatch
set hlsearch
set incsearch
set ignorecase
set autoindent 
set cindent
set ruler
set foldenable
set linebreak

" Fancy status line
set statusline=%F%m%w\ %y\ ff:%{&ff}\ l:%02l,r:%02c\ t:%02L 

" Don't polute current path with *~. Create them in a specific dir
set backupdir=/home/bocke/.backup

" Enhance command completition with a nice textual menu
set wildmenu

" Give me the pretty colors!
syntax on

" Set the color scheme
if has("gui_running")
   " colorscheme desert
   colorscheme wombat

   set guifont=DejaVuSansMono
   set guioptions=emirv
   set showtabline=2
   set noguipty
   set mousemodel=popup
else
	let has_x = $DISPLAY
	if strlen(has_x) " Theme to use in XTerm 
		set t_Co=256
		colorscheme desert256
	else
		" Console colorscheme	
		colorscheme blue 
	endif
endif

" Vundle
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
Bundle 'gmarik/vundle'

" Bundles from github
Bundle 'gregsexton/MatchTag'
Bundle 'mattn/sonictemplate-vim'
Bundle 'spolu/dwm.vim'
Bundle 'mbbill/undotree'
Bundle 'mbbill/code_complete'
Bundle 'scrooloose/syntastic'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/vim-fugitive'
Bundle 'msanders/snipmate.vim'
Bundle 'tpope/vim-git'

" Bundles from vim scripts git repo
Bundle 'vim-dokuwiki'

" Themes
Bundle 'rainux/vim-desert-warm-256'
Bundle 'jelera/vim-gummybears-colorscheme'
Bundle 'nielsmadan/harlequin'
Bundle 'goatslacker/mango.vim'
Bundle 'mbbill/desertEx'
Bundle 'tpope/vim-vividchalk'
.Xresources

Code: Select all

!! Tell Athena widgets to use rectangle shapes where possible
*shapeStyle: Rectangle

!! Xfs settings
Xft.dpi: 96
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault
Xft.rgba: rgb
Xft.autohint: 0

!! XTerm Settings
XTerm*customization: -color
Xterm*geometry: 80x25
XTerm*faceName: DejaVuSansMono
XTerm*faceSize: 10
XTerm*fontWarning: 2
XTerm*ScrollBar: false
XTerm*rightScrollbar: true
XTerm*jumpScroll: true
XTerm*fastScroll: true
XTerm*scrollKey: true
XTerm*resizeGravity: SouthWest
!  Color settings
XTerm*dynamicColors: true
XTerm*foreground: #ffffff
XTerm*background: grey20
XTerm*cursorColor: lightblue
XTerm*ScrollBar*foreground: black
XTerm*ScrollBar*background: grey20
!  XTerm Color Scheme
XTerm*color0: black 
XTerm*color1: red3
XTerm*color2: green3
XTerm*color3: yellow3
XTerm*color4: darkblue
XTerm*color5: magenta3
XTerm*color6: cyan3
XTerm*color7: gray90
XTerm*color8: gray30
XTerm*color9: red
XTerm*color10: green
XTerm*color11: yellow
XTerm*color12: lightblue
XTerm*color13: magenta
XTerm*color14: cyan
XTerm*color15: #ffffff
!  binding overrides
XTerm*Text.Translations: #overrride\n\
	<Btn4Down>: scroll-one-line-down()\n\
	<Btn5Down>: scroll-one-line-up()\n

!! XTerm Settings
UXTerm*customization: -color
UXTerm*geometry: 80x25
UXTerm*faceName: DejaVuSansMono
UXTerm*faceSize: 10
UXTerm*fontWarning: 2
UXTerm*ScrollBar: false
UXTerm*rightScrollbar: true
UXTerm*jumpScroll: true
UXTerm*fastScroll: true
UXTerm*scrollKey: true
UXTerm*resizeGravity: SouthWest
!  Color settings
UXTerm*dynamicColors: true
UXTerm*foreground: #ffffff
UXTerm*background: grey20
UXTerm*cursorColor: lightblue
UXTerm*ScrollBar*foreground: black
UXTerm*ScrollBar*background: grey20
!  UXTerm Color Scheme
UXTerm*color0: black 
UXTerm*color1: red3
UXTerm*color2: green3
UXTerm*color3: yellow3
UXTerm*color4: darkblue
UXTerm*color5: magenta3
UXTerm*color6: cyan3
UXTerm*color7: gray90
UXTerm*color8: gray30
UXTerm*color9: red
UXTerm*color10: green
UXTerm*color11: yellow
UXTerm*color12: lightblue
UXTerm*color13: magenta
UXTerm*color14: cyan
UXTerm*color15: #ffffff
!  binding overrides
UXTerm*Text.Translations: #overrride\n\
	<Btn4Down>: scroll-one-line-down()\n\
	<Btn5Down>: scroll-one-line-up()\n

!! Rxvt 
Rxvt*jumpScroll: True
Rxvt*scrollBar: True
Rxvt*scrollBar_right: True
Rxvt*scrollTtyOutput: True
Rxvt*scrollWithBuffer: True
Rxvt*smallfont_key: -
Rxvt*bigfont_key: +
Rxvt*saveLines: 512
Rxvt*internalBorder: 4
Rxvt*externalBorder: 4
Rxvt*geometry: 80x25
Rxvt*faceName: DejaVuSansMono
Rxvt*faceSize: 10
! Color scheme
Rxvt*color0: black 
Rxvt*color1: red3
Rxvt*color2: green3
Rxvt*color3: yellow3
Rxvt*color4: darkblue
Rxvt*color5: magenta3
Rxvt*color6: cyan3
Rxvt*color7: gray90
Rxvt*color8: gray30
Rxvt*color9: red
Rxvt*color10: green
Rxvt*color11: yellow
Rxvt*color12: lightblue
Rxvt*color13: magenta
Rxvt*color14: cyan
Rxvt*color15: #ffffff

!! XClock
XClock*customization: -color
XClock*width: 128 
XClock*height: 128
XClock*Clock*render: True
XClock*Clock*chime: True
XClock*Clock*padding: 10
XClock*Clock*analog: True
XClock*Clock*twentyfour: True

!! XCalc
XCalc*customization: -color

!! Xedit
Xedit*customization: -color
Xedit*grip.width: 12 
Xedit*grip.height: 5


!! Bitmap
! Bitmap Widget styling
Bitmap*bitmap.background: #ffffff
Bitmap*bitmap.foreground: black
! Bitmap widget options
Bitmap*bitmap.size: 32x32
Bitmap*bitmap.stippled: off 
Bitmap*bitmap.dashed: off
Bitmap*bitmap.grid: true
Bitmap*bitmap.gridTolerance: 2
Bitmap*bitmap.margin: 8
Bitmap*bitmap.cursor: left_ptr
! Bitmap widget square size
Bitmap*bitmap.squareWidth: 8
Bitmap*bitmap.squareHeight: 8
Bitmap*font: -*-lucida-medium-r-normal-*-120-*-*-*-*-* 
! Colors
Bitmap*background: #e1e1de 
Bitmap*borderColor: #aaaaa3
! Pane form CommandButton properties
Bitmap*pane.form.background: gray 
Bitmap*pane.form.Command.shapeStyle: Rectangle
! Pane options 
Bitmap*pane*internalBorderColor: #aaaaac
! Pane form ToggleButton properties
Bitmap*pane.form.Toggle.shapeStyle: Rectangle
! Menu Button properties
Bitmap*MenuButton.borderWidth: 0
Bitmap*MenuButton.width: 32
Bitmap*MenuButton.shapeStyle: Rectangle 
Bitmap*MenuButton.justify: left
!  Menu item Settings
Bitmap*SmeBSB.width: 32
Bitmap*SmeBSB.justify: left
!  Specific settings for File menu
Bitmap*fileButton.leftBitmap: None
Bitmap*fileMenu.SmeBSB.HorizontalMargins: 0
!  Specific settings for Edit menu
Bitmap*editButton.leftBitmap: None 
Bitmap*editMenu.SmeBSB.HorizontalMargins: 16 
Bitmap*status.borderColor: #aaaaac
Bitmap*status.borderWidth: 1
!  grip (separator) styling
Bitmap*Grip.width: 8
Bitmap*Grip.height: 3
Bitmap*Grip.foreground: #aaaaac
Bitmap*Grip.background: #ffffff
Bitmap*Grip.borderColor: gray
Bitmap*pane.Grip.width: 3
Bitmap*pane.Grip.height: 8
!  Dialog styling
Bitmap*Dialog.Command.shapeStyle: Rectangle
Bitmap*Dialog.Text.background: #ffffff
Bitmap*Dialog.Icon.foreground: black
Bitmap*Dialog.Icon.background: #ffffff
Bitmap*Dialog.Icon.borderWidth: 1
Bitmap*Dialog.Icon.borderColor: #aaaaac
!  FileMenu Strings
Bitmap*fileMenu.new.label:			New (Ctrl-N)...
Bitmap*fileMenu.load.label:			Load (Ctrl-F)...   
Bitmap*fileMenu.insert.label:			Insert (Ctrl-I)... 
Bitmap*fileMenu.save.label:			Save (Ctrl-S)
Bitmap*fileMenu.saveAs.label:			Save As (Ctrl-W)...
Bitmap*fileMenu.resize.label:			Resize (Ctrl-R)... 
Bitmap*fileMenu.rescale.label:		Rescale (Ctrl-X)...
Bitmap*fileMenu.filename.label:		Filename (Ctrl-E)...
Bitmap*fileMenu.basename.label:		Basename (Ctrl-B)...
Bitmap*fileMenu.quit.label:			Quit (Ctrl-C, Q)
!  EditMenu Strings
Bitmap*editMenu.image.label:			Image (Alt-I)
Bitmap*editMenu.grid.label:			Grid (Alt-G)
Bitmap*editMenu.dashed.label:			Dashed (Alt-D)
Bitmap*editMenu.axes.label:			Axes (Alt-A)
Bitmap*editMenu.stippled.label:		Stippled (Alt-S)
Bitmap*editMenu.proportional.label:		Proportional (Alt-P)
Bitmap*editMenu.zoom.label:			Zoom (Alt-Z)
Bitmap*editMenu.cut.label:			Cut (Alt-C)
Bitmap*editMenu.copy.label:			Copy (Alt-W)
Bitmap*editMenu.paste.label:			Paste (Alt-Y, Ctrl-mb)

!! XClipboard 
XClipboard*background: #e1e1de
XClipboard*Text.background: #ffffff
XClipboard*borderColor: #aaaaac
XClipboard*font: -*-lucida-medium-r-normal-*-120-*-*-*-*-* 

!! XFig 
Fig*customization: -color
Fig*background: #e1e1de
Fig*font: -*-lucida-medium-r-normal-*-120-*-*-*-*-* 

!! Seyon 
Seyon*customization: -color

!! XMore 
XMore*background: #e1e1de
XMore*borderColor: #aaaaac
XMore*Text.background: #ffffff
XMore*font: -*-lucida-medium-r-normal-*-120-*-*-*-*-* 
XMore*Text.Translations: #overrride\n\
	<Btn4Down>: scroll-one-line-down()\n\
	<Btn5Down>: scroll-one-line-up()\n

!! XFontSel 
XFontSel*background: #e1e1de
XFontSel*borderColor: #aaaaac
XFontSel*sampleText.background: #ffffff
! Pane styling 
XFontSel*Paned*internalBorderColor: #aaaaac
XFontSel*Paned*BorderColor: #aaaaac
! grip (separator) styling
XFontSel*Grip.width: 8
XFontSel*Grip.height: 3
XFontSel*Grip.foreground: #aaaaac
XFontSel*Grip.background: #ffffff
XFontSel*Grip.borderColor: gray
XFontSel*font: -*-lucida-medium-r-normal-*-120-*-*-*-*-* 

!! XLoad 
XLoad*width: 150 
XLoad*height: 60
XLoad*Label.font: -*-lucida-medium-r-normal-*-120-*-*-*-*-* 
XLoad*Label.background: black
XLoad*Label.foreground: #ffffff
XLoad*load.update: 1
XLoad*load.background: gray
XLoad*load.foreground: brown

!! Xditview 
Xditview*background: #e1e1de
Xditview*dvi.background: #ffffff
Xditview*Text.background: #ffffff
Xditview*Label.font: -*-lucida-medium-r-normal-*-120-*-*-*-*-* 
Xditview*MenuButton.leftBitmap: None
Xditview*MenuButton.borderWidth: 0

!! Xman 
Xman*background: #e1e1de
Xman*Command.borderColor: #aaaaac
!Xman*font: -*-lucida-medium-r-normal-*-120-*-*-*-*-* 
Xman*faceName: DejaVuSansMono
Xman*manualFontNormal: DejaVuSansMono
Xman*faceSize: 10
Xman*manualPage.background: #ffffff
Xman*manualPage.useRight: True
Xman*directory.background: #ffffff
Xman*Paned.borderColor: #aaaaac
Xman*Paned.internalBorderColor: #aaaaac
Xman*Dialog.Command.background: #e1e1de
Xman*Dialog.Command.borderColor: #aaaaac
Xman*Text.background: #ffffff
! grip (separator) styling
Xman*Grip.width: 8
Xman*Grip.height: 3
Xman*Grip.foreground: #aaaaac
Xman*Grip.background: #ffffff
Xman*Grip.borderColor: grey
! Xman options
Xman*bothShown: true
Xman*topBox: false
Xman*verticalList: true
! Key and mouse Bindings
Xman*manualPage*translations: #override \n\
	<Btn4Down>: Page(Line,-1) \n\
	<Btn5Down>: Page(Line,1) \n

!! XMessage
Xmessage*customization: -color

!! Xvideotune 
Xvidtune*background: #e1e1de 
Xvidtune*borderColor: #aaaaac
Xvidtune*Scrollbar.background: #ffffff
Xvidtune*Text.background: #ffffff
!Xvidtune*Label.foreground: darkred
Xvidtune*WarnLabel.borderColor: red
Xvidtune*WarnLabel.foreground: red
Xvidtune*WarnLabel.background: black
Xvidtune*WarnOK.borderColor: red
Xvidtune*WarnOK.foreground: red
Xvidtune*WarnOK.borderWidth: 3
Xvidtune*WarnCancel.borderColor: green
Xvidtune*WarnCancel.foreground: green
Xvidtune*WarnCancel.borderWidth: 3
Xvidtune*Command.foreground: #ffffff
Xvidtune*Command.background: black
Xvidtune*Command.internalWidth: 5
Xvidtune*Command.internalHeight: 5
Xvidtune*Toggle.foreground: #ffffff
Xvidtune*Toggle.background: black
Xvidtune*Toggle.internalWidth: 5
Xvidtune*Toggle.internalHeight: 5
Xvidtune*Buttons-form.Command.foreground: red
Xvidtune*Buttons-form.Command.borderColor: red
Xvidtune*Buttons-form.Toggle.foreground: red
Xvidtune*Buttons-form.Toggle.borderColor: red
Xvidtune*Buttons-form.Quit-button.foreground: green
Xvidtune*Buttons-form.Quit-button.borderColor: green
Xvidtune*font: -*-lucida-bold-r-normal-*-120-*-*-*-*-* 

!! XbmBrowser 
XbmBrowser*customization: -color
! Options
XbmBrowser*label_all: True
XbmBrowser*label_icons: True
XbmBrowser*label_syms: True
XbmBrowser*show_xpmbad: True
XbmBrowser*show_other: False
XbmBrowser*show_hidden: False

!XMinesweep
Xminesweep*background: #e1e1de



Administrator
Administrator
offline
User avatar

Posts: 4590
Joined: 04 Feb 2011, 20:32
Location: Beograd
Contact:

Post Napisano: 16 Mar 2015, 15:52


Nova revizija. :)

Ovo nije sređeno za "pokazivanje". Prilično sirovo. Ali rekoh da podsetim ljude da ova tema postoji.

.profile

Code: Select all

# bocke, 2012, 2013, 2014, 2015 bocke <at> slackware-srbija <dot> org.
. /etc/profile

export PATH="$PATH:~/.local/bin"
export MANPATH="$PATH:~/.local/man"

# Postavi neke uobičajene varijable
export EDITOR=vim
export VISUAL=vim
export PAGER="less"
export HTMLPAGER="links -dump"
export LESS="-R -I"
export LESSCHARSET="utf-8"

# Fensi boje za less/man
export LESS_TERMCAP_mb=$'\E[01;31m'		# treptanje			| crvena
export LESS_TERMCAP_md=$'\E[01;34m'		# podebljano		| zelena
export LESS_TERMCAP_me=$'\E[0m'			# kraj rezima		| reset
export LESS_TERMCAP_se=$'\E[0m'			# kraj izdvojenog	| reset
export LESS_TERMCAP_so=$'\E[01;44;37m'	# pocetak izdvojeno	| bela/plava
export LESS_TERMCAP_ue=$'\E[0m'			# kraj podvuceno	| reset
export LESS_TERMCAP_us=$'\E[01;35m' 	# pocetak podvuceno | ljubicasta
.bashrc

Code: Select all

# Bash konfiguraciona datoteka .bashrc
# bocke, 2012, 2013, 2014, 2015 bocke <at> slackware-srbija <dot> org.

# Ako je bash pokrenut neinteraktivno (napr: skript), izađi.
[ -z "$PS1" ] && return

# uvezi .profile
if [ -f ~/.profile ]; then
	. ~/.profile
fi

# Bash odzivnik
PS1="[\u@\h \W]$ "
PS2=" -> "

# Bash opcije
shopt -s checkwinsize
shopt -s huponexit
shopt -s cdable_vars
shopt -s extglob
set -C
set -m

# Osnovni alijasi
alias lsl="ls -lhS --group-directories-first"
alias lsd="ls -d */"
alias d="dir"
alias du="du -h"
alias df="df -h"
alias free="free -m"

# Ostali alijasi
alias pathstr="echo $PATH | tr -s ':' ' '"
alias pathnl="echo $PATH | tr -s ':' '\n'"

# Pokreni pod srpskom lokalizacijom
function srb() {
	LANG=sr_RS $@
}
# Pokreni pod engleskom lokalizacijom
function eng() {
	LANG=en_US $@
}

# (De)Lokalizovani alijasi 
alias man="srb man"

# Dodatne putanje
export PATH=$PATH:$HOME/.local/bin
export MANPATH=$MANPATH:$HOME/.local/man

# Postavi neke opcije u odnosu da li je pokrenut X ili ne
if [ -z "$DISPLAY" ]; then
	export TERM='linux'
	export BROWSER='links'
else
	export TERM='xterm-256color'
	export BROWSER='midori'

	alias elvis="TERM=xterm-color elvis"
	alias vi="TERM=xterm-color vi"

	# Postavi naslov (u)xterm-a
	PROMPT_COMMAND='echo -ne "\033]0;${PWD}\007"'

	# Postavi transparentnost za (u)xterm
	[ -x /usr/bin/transset ] && [ -n "$XTERM_VERSION" ] \
		&& transset -a 0.8 >/dev/null
fi

function extract()
{
	if [ -f $1 ] ; then
		case $1 in
			*.tar.xz | *.tar.bz2 | *.tar.gz | *.tar.Z)
				tar xvj $1 ;;
			*.tgz | *.TGZ | *.taz | *.TAZ | *.tbz | *.TBZ | *.txz) 
				tar xvfj $1 ;;
			*.gz | *.GZ )
				gunzip $1 ;;
			*.bz2 | *.BZ2)
				bunzip2 $1 ;;
			*.Z )
				uncompress $1 ;;
			*.zip | *.ZIP)
				unzip $1 ;;
			*.rar | *.RAR)
				unrar $1 ;;
			*.arj | *.ARJ)
				unarj x $1 ;;
			*.7z | *.7Z)
				7za x $1 ;;
			*.arc | *.ark)
				nomarch $1 ;;
			*.lbr | *.LBR | *.sqz | *.SQZ | *.lqz | *.LQZ)
				lbrate $1 ;;
			*.lha | *.LHA | *.lzh | *.LZH)
				lha x $1 ;;
			*.cab | *.CAB)
				cabextract $1 ;;
			*)
				echo "'$1' nije podrzana arhiva." ;;
		esac
	else
		echo "'$1' nije validna arhiva."
	fi
}

getext(){
	ekstenzija="$(echo $1 | rev | cut -f 1 -d '.' | rev)"
	tacka=$(expr index "$1" '.')
	[ $tacka -gt 0 ] && echo $ekstenzija
}

arc2xz(){
	for PKG in "$@"; do
		du -b "$PKG"
		case "$PKG" in 
			*.z)
				gzip -vd "$PKG"  && xz "${PKG%.z}"
				du -b "${PKG%.z}.xz"
				;;
			*.Z)
				gzip -vd "$PKG" && xz "${PKG%.Z}"
				du -b "${PKG%.Z}.xz"
				;;
			*.gz)
				gzip -vd "$PKG" && xz "${PKG%.gz}"
				du -b "${PKG%.gz}.xz"
				;;
			*.bz2)
				bzip2 -vd "$PKG" && xz "${PKG%.bz2}"
				du -b "${PKG%.bz2}.xz"
				;;
			*.tar)
				xz "$PKG"
				du -b "${PKG}.xz"
				;;
			*.tgz)
				gzip -vd "$PKG" && xz "${PKG%.tgz}.tar"
				du -b "${PKG%.tgz}.tar.xz"
				;;
			*.tbz)
				bzip2 -vd "$PKG" && xz "${PKG%.tbz}.tar"
				du -b "${PKG%tbz}.tar.xz"
				;;
			*)
				;;
		esac
	done
}

arc2gz(){
	for PKG in "$@"; do
		du -b "$PKG"
		case "$PKG" in 
			*.xz)
				xz -vd "$PKG" && gzip "${PKG%.xz}"
				du -b "${PKG%.xz}.gz"
				;;
			*.bz2)
				bzip2 -vd "$PKG" && gzip "${PKG%.bz2}"
				du -b "${PKG%.bz2}.gz"
				;;
			*.tar)
				gzip "$PKG"
				du -b "${PKG}.gz"
				;;
			*)
				;;
		esac
	done
}
.vimrc

Code: Select all

" vimrc, bocke <bocke@slackware-srbija.org>, 2014, 2015
" Last change: 2015-03-13

	set nocompatible
	set encoding=utf-8

	set mouse=a

	set incsearch
	set ignorecase
	set showmatch
	set hlsearch
	set autoindent
	set ruler
	set nobackup
	set nomousehide
	set showfulltag
	set showcmd
	set showmode
	set number
	set linebreak
	set wildmenu

	set tabstop=4
	set shiftwidth=4
	set laststatus=2
	set cmdheight=1
	set report=0
	set numberwidth=2

	set statusline=%y\ ff:%{&ff}\ l:%02l,r:%02c\ t:%02L

	if has('gui_running')
		colorscheme molokai
		set guifont=Terminus
	else
		let has_x = $DISPLAY
		if strlen(has_x)
			set t_Co=256
			colorscheme mrkn256 
		else
			colorscheme blue
		endif
	endif

	au BufRead *.html :menu &Run.Launch\ in\ &PaleMoon  :!palemoon %<cr>
	au BufRead *.html :menu &Run.Launch\ in\ &Firefox	:!firefox %<cr> 
	au BufRead *.html :menu &Run.Launch\ in\ &Chromium :!chromium %<cr> 
	au BufRead *.html :menu &Run.Launch\ in\ &Midori :!midori %<cr>

	" Vundle and the plugins
	set rtp+=~/.vim/bundle/Vundle.vim
	call vundle#begin()

	Plugin 'gmarik/Vundle.vim'

	Plugin 'honza/vim-snippets'
	Plugin 'tomtom/tlib_vim'
	Plugin 'MarcWeber/vim-addon-mw-utils'
	Plugin 'garbas/vim-snipmate'
	Plugin 'ap/vim-buftabline'
	Plugin 'vim-scripts/NSIS-syntax-highlighting'

set list lcs=tab:\.\ 

call vundle#end()

filetype plugin indent on
.vim/filetype.vim

Code: Select all

"bocke, 2012, 2013, 2014, 2015 bocke <at> slackware-srbija <dot> org.
au BufNewFile,BufRead *.ASM setf asm
au BufNewFile,BufRead *.bac,BAC setf bacon
au BufNewFile,BufRead *.BAS setf basic
au BufNewFile,BufRead *.BAT setf dosbatch
au BufNewFile,BufRead *.BTM setf btm
au BufNewFile,BufRead *.C setf cpp
au BufNewFile,BufRead *.COM setf dcl
au BufNewFile,BufRead *.CPP setf cpp
au BufNewFile,BufRead *.fb,*.bi,*.FB,*.BI setf freebasic 
au BufNewFile,BufRead *.nsis setf nsis
au BufNewFile,BufRead *.PAS setf pascal
au BufNewFile,BufRead *.md setf markdown
au BufNewFile,BufRead *.vala setf vala
au BufNewFile,BufRead *.bds setf c
au BufNewFile,BufRead *.rat setf fortran



Administrator
Administrator
offline
User avatar

Posts: 4590
Joined: 04 Feb 2011, 20:32
Location: Beograd
Contact:

Post Napisano: 16 Mar 2015, 16:34


.config/Thunar/uca.xml

Code: Select all

<?xml encoding="UTF-8" version="1.0"?>
<actions>
<action>
	<icon>utilities-terminal</icon>
	<name>Open Terminal Here</name>
	<unique-id>1400536935248332-2</unique-id>
	<command>exo-open --working-directory %f --launch TerminalEmulator</command>
	<description>Open Terminal Here</description>
	<patterns>*</patterns>
	<startup-notify/>
	<directories/>
</action>
<action>
	<icon>vim</icon>
	<name>Edit with Vim</name>
	<unique-id>1400536926778945-1</unique-id>
	<command>gvim %f</command>
	<description>Edit with Vim</description>
	<patterns>*</patterns>
	<other-files/>
	<text-files/>
</action>
<action>
	<icon>wine</icon>
	<name>Open with CMD</name>
	<unique-id>1425793305574677-24</unique-id>
	<command>$HOME/.local/bin/startcmd %n</command>
	<description>Open with CMD</description>
	<patterns>*.exe;*.EXE</patterns>
	<other-files/>
</action>
<action>
	<icon>wine</icon>
	<name>Start with CMD</name>
	<unique-id>1425793219860003-22</unique-id>
	<command>wineconsole cmd /k %f </command>
	<description>Start with CMD</description>
	<patterns>*.bat;*.BAT;*.cmd;*.CMD</patterns>
	<text-files/>
</action>
<action>
	<icon>dosbox-x</icon>
	<name>Start with DosBox-x</name>
	<unique-id>1400850323259286-3</unique-id>
	<command>dosbox-x %f</command>
	<description>Start with DosBox-x</description>
	<patterns>*.exe;*.EXE;*.com;*.COM</patterns>
	<other-files/>
</action>
<action>
	<icon>dosbox-x</icon>
	<name>Start with DosBox-x</name>
	<unique-id>1400905796736199-15</unique-id>
	<command>dosbox-x %f</command>
	<description>Start with DosBox-x</description>
	<patterns>*.bat;*.BAT;*.cmd;*.CMD</patterns>
	<text-files/>
</action>
<action>
	<icon>utilities-terminal</icon>
	<name>Start with DosBox</name>
	<unique-id>1400560514805954-3</unique-id>
	<command>dosbox %f</command>
	<description>Start with DosBox</description>
	<patterns>*.exe;*.EXE;*.com;*.COM</patterns>
	<other-files/>
</action>
<action>
	<icon>utilities-terminal</icon>
	<name>Start with DosBox</name>
	<unique-id>1425793136358687-19</unique-id>
	<command>dosbox %f</command>
	<description>Start with DosBox</description>
	<patterns>*.bat;*.BAT</patterns>
	<text-files/>
</action>
<action>
	<icon>text-x-makefile</icon>
	<name>Build</name>
	<unique-id>1426517524249992-1</unique-id>
	<command>make -f %f</command>
	<description>Build</description>
	<patterns>Makefile;makefile</patterns>
	<text-files/>
</action>
<action>
	<icon>edit-copy</icon>
	<name>Copy name</name>
	<unique-id>1426518130685011-16</unique-id>
	<command>echo $(basename %f) | xclip -selection "clipboard"</command>
	<description>Copy name to clipboard</description>
	<patterns>*</patterns>
	<directories/>
	<audio-files/>
	<image-files/>
	<other-files/>
	<text-files/>
	<video-files/>
</action>
<action>
	<icon>edit-copy</icon>
	<name>Copy path</name>
	<unique-id>1426518159618812-19</unique-id>
	<command>echo $(dirname "%f") | xclip -selection "clipboard"</command>
	<description>Copy path to clipboard</description>
	<patterns>*</patterns>
	<directories/>
	<audio-files/>
	<image-files/>
	<other-files/>
	<text-files/>
	<video-files/>
</action>
<action>
	<icon>edit-copy</icon>
	<name>Copy full name and path</name>
	<unique-id>1426518143973324-18</unique-id>
	<command>echo %f | xclip -selection "clipboard"</command>
	<description>Copy full name and path to clipboard</description>
	<patterns>*</patterns>
	<directories/>
	<audio-files/>
	<image-files/>
	<other-files/>
	<text-files/>
	<video-files/>
</action>
</actions>
~/.local/bin/startcmd

Code: Select all

#!/bin/sh
wineconsole cmd /c "$@ | more && pause" 
Inače:



Administrator
Administrator
offline
User avatar

Posts: 4590
Joined: 04 Feb 2011, 20:32
Location: Beograd
Contact:

Post Napisano: 16 Mar 2015, 17:12


Alternativna varijanta funkcije extract koja podržava bash 1.x i starije verzije tar komande (testirano na Slackwareu 3.5 i 4.0):

Code: Select all

# Extract an archive
# bocke, 2014, 2015 bocke <at> slackware-srbija <dot> org.
xtra(){

	if [ 1 -lt $# ] || [ 0 -eq $# ] ;then
		echo "Usage: xtra <archive>"
	else

		if [ -f "$1"  ];then

			case "$1" in

				*.tar )
					tar xvf "$1" ;;
				
				*.tar.Z | *.tar.z | *.taz |\
				*.tar.gz | *.tgz )
					gzip -dc "$1" | tar xvf - ;;

				*.tar.bz2 | *.tbz )
					bzip2 -dc "$1" | tar xvf - ;;

				*.tar.lzma | *.tlz |\
				*.tar.xz | *.txz )
					xz -dc "$1" | tar xvf - ;;

				*.gz | *.GZ )
					gunzip $1 ;;
		
				*.bz2 | *.BZ2 )
					bunzip2 $1 ;;

				*.z | *.Z )
					uncompress $1 ;;

				*.zip | *.ZIP )
					unzip $1 ;;

				*.arj | *.ARJ )
					unarj x $1 ;;
				
				*.lzh | *.LZH |\
				*.lha | *.LHA )
					lha x $1 ;;

				*.zoo | *.ZOO )
					zoo x $1 ;;

				*) 
					echo "'$1' is not a supported archive type"
					;;
			esac
		else
			echo "'$1' is not a valid archive"
		fi
	fi
}


Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests