Tuesday, October 29, 2013

Goodies

to see if PuTTY is actually passing the ^R, by running "cat" and then pressing that button.



$ xev | grep -A2 --line-buffered '^KeyRelease'| \
     sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
 
 
$ for file in $(grep '_file.*' /etc/mpd.conf | sed 's/.* //' | xargs)
  do
    touch ${file}
    chown $(grep '^user.*' /etc/mpd.conf | sed 's/.* //') ${file}
  done
 

Basic Needs

wpa_supplicant
pm-suspend
dwm
X11
zsh
sudo
htop
atop
tmux
python

gvim
truecrypt
rsync
unrar
unzip


mplayer
mpd
ncmpcpp

Batch

Couldn't get it to work

1
2
3
4
5
for /f "tokens=*" %%a in ('dir /b *.ui') do (
    @set appname=%%~na
    @set "output_py=%appname%_win.py"
    @echo %output_py%
)

Monday, October 28, 2013

DMW Configuring

Build:
cd ~/.dwm/
vim ./.config.h
Once changes have been made, pipe the new md5sums into the PKGBUILD:

$ makepkg -g >> PKGBUILD

compile and reinstall:
$ makepkg -efi


Xresources

set

Key Mapping

pacs xorg-xev 
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'

123 XF86AudioRaiseVolume
122 XF86AudioLowerVolume
121 XF86AudioMute
133 Super_L # windows
64 Alt_L # Meta 
53 x
54 c
55 v

# List the assigned key code (mapping to keyboard)
xmodmap -pke | grep Alt_R
 
amixer set Master toggle
amixer set Master 5%- unmute
amixer set Master 5%+ unmute



 
 
 
NOTE: 
bashrun # an application launcher running a modified bash session in a small 
terminal window, providing all the well known bash features like 
tab-completion and history
 
 

Vim


To copy to the global cut buffer, use the + register. The " key allows you to specify which register to use when doing a yank or paste operation.

yank:"+yy 
paste: "+p
 

Mpd and ncmpcpp





~/.config/systemctl/mpd.service
[Unit]
Description=Music Player Daemon

[Service]
ExecStart=/usr/bin/mpd --no-daemon

[Install]
WantedBy=default.target
 

systemctl --user enable mpd.service
systemctl --user enable mpd

# List only uncommented lines
cat ~/.mpdconf|grep -E -v '^(#|])'

music_directory  "~/downloads/music"
playlist_directory  "~/.mpd/playlists"
db_file   "~/.mpd/database"
log_file   "~/.mpd/log"
pid_file   "~/.mpd/pid"
state_file   "~/.mpd/state"
sticker_file   "~/.mpd/sticker.sql"
user    "kinleyage"
group    "kinleyage"
bind_to_address    "127.0.0.1"
bind_to_address    "194.168.0.15"

port    "6600"
follow_outside_symlinks         "yes"
password                        "[PASSWORD]@read,add,control"
input {
        plugin "curl"
}
audio_output {
 type  "alsa"
 name  "kn_alsa_device"
 #device  "hw:0,1" # optional
 format  "44100:24:2" # optional
 mixer_type      "software" # optional
 #mixer_device "default" # optional
 #mixer_control "PCM"  # optional
 #mixer_index "0"  # optional
}
 
# For troubleshooting
mpd --no-daemon --stdout --verbos 

# Todo, pulse

Ranger

# Automatic
/usr/share/doc/ranger/examples contains the example plug-ins

# Tocolors, you have to do it manually or perhaps make a binder that reads them from ~/.dir_colors  which are stored here in $LS_COLORS
~/.config/ranger/colorscheme/solarized.py


binding:  # Don't know how yet
bind

# Batch renaming
export EDITOR = 'vim'
exec_command vidir

moreutils:
  • chronic: runs a command quietly unless it fails
  • combine: combine the lines in two files using boolean operations
  • ifdata: get network interface info without parsing ifconfig output
  • ifne: run a program if the standard input is not empty
  • isutf8: check if a file or standard input is utf-8
  • lckdo: execute a program with a lock held
  • mispipe: pipe two commands, returning the exit status of the first
  • parallel: run multiple jobs at once
  • pee: tee standard input to pipes
  • sponge: soak up standard input and write to a file
  • ts: timestamp standard input
  • vidir: edit a directory in your text editor
  • vipe: insert a text editor into a pipe
  • zrun: automatically uncompress arguments to command
# Font caching
fc-cache -f -v

find / -name fonts.alias
/usr/share/fonts/cyrillic/fonts.alias
/usr/share/fonts/75dpi/fonts.alias
/usr/share/fonts/100dpi/fonts.alias
/usr/share/fonts/misc/fonts.alias
/home/kinleyage/prev_home/.fonts/artwiz-fonts/fonts.alias
/home/kinleyage/.fonts/artwiz-fonts/fonts.alias
/home/kinleyage/backup/home/kinleyage/.fonts/artwiz-fonts/fonts.alias

All cached font aliases (make sure they're included in font path)


# Xresource merge to xdatabase
xrdb -merge ~/.Xresources; urxvt

urxvt, zsh and tmux


All prompts are located under
/usr/share/zsh/functions/Prompts/
and its stored in $fpath

# Lists all available prompts 
prompt -l

#Set prompt to be elite2 with orange and nude color
prompt elite2 178 179

# See zs setup
zstyle

# Fonts
# in gVim list all the fonts in ui
set guifont=*

# In Xresources add your
xset +fp ~/.fonts/artwiz-fonts/
xset fp rehash

# Set default prompt permanently
chsh -s /bin/zsh


Tmux


~$ which tmux
tmux: aliased to TERM=xterm-256color tmux
and in in my .tmux.conf:
set -g default-terminal "screen-256color"
Aliasing tmux to "tmux -2" should also do the trick.