Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
166 lines (137 sloc) 5.82 KB
# .ratpoisonrc
# Parts of this is inspired by
# Last Modified: 09/09/2017, 09:13:49 IST
# Stop managing {{{1
#unmanage tint2
#unbind all
# Customize: Windows, Bar {{{1
## Frames
#set fgcolor red
#set bgcolor black
#set fwcolor black
set bwcolor dim gray
## Set the border width for all windows.
set border 0
set padding 0 0 0 0
set font -*-dina-medium-r-normal-*-12-*-*-*-*-*-*-*
#set waitcursor 1
#set transgravity center
## Rat bar
set barborder 0
set bargravity c
#set barpadding 1 1
#set inputwidth 9999
## Windows position
set winname title
set winfmt %n %s %t
set wingravity c
set winliststyle row
## Setup initial workspaces
# This should set up rpws and groups, bind defaults
exec /usr/bin/rpws init 4 -k
## Ratpoison shortcuts
# Create a new keymap for all window management
newkmap win
definekey top Super_L readkey win
# Groups
definekey win 1 rpws1
definekey win 2 rpws2
definekey win 3 rpws3
definekey win 4 rpws4
definekey win M-1 gmove default
definekey win M-2 gmove wspl2
definekey win M-3 gmove wspl3
definekey win M-4 gmove wspl4
definekey win greater rpwsn
definekey win less rpwsp
# Frames
definekey win s hsplit 1/2
definekey win S vsplit 1/2
definekey win r remove
definekey win o only
definekey win u undo
definekey win d dedicate
definekey win h focusleft
definekey win j focusdown
definekey win k focusup
definekey win l focusright
definekey win Left focusleft
definekey win Down focusdown
definekey win Up focusup
definekey win Right focusright
definekey win M-h exchangeleft
definekey win M-j exchangedown
definekey win M-k exchangeup
definekey win M-l exchangeright
definekey win M-Left exchangeleft
definekey win M-Down exchangedown
definekey win M-Up exchangeup
definekey win M-Right exchangeright
definekey win M-C-h resize -10 0
definekey win M-C-j resize 0 -10
definekey win M-C-k resize 0 10
definekey win M-C-l resize 10 0
definekey win M-C-Left resize -10 0
definekey win M-C-Down resize 0 -10
definekey win M-C-Up resize 0 10
definekey win M-C-Right resize 10 0
definekey win M-Tab next
definekey win Tab next
definekey win M-S-Tab prev
definekey win S-Tab prev
#definekey win w switch window
#definekey win Mod4+space stack flip
definekey win question help win
## Ratpoison options
#escape Caps_Lock
warp on
startup_message off
exec xsetroot -cursor_name left_ptr
## Shortcuts {{{1
# Set a background, randomly picking from a certain directory.
#exec cd ~/pics/Wallpapers/clean && Esetroot ~/pics/Wallpapers/clean/flatgreen.jpg
bind I exec cd ~/pics/wallpapers && feh --bg-center `w=(*.jpg); n=${#w[@]}; echo "${w[RANDOM%n]}"` && cd ~/
alias term exec ~/bin/urxvt-client
bind c term
bind a time
bind grave other
## Dmenu magic
# Rat shell
unbind r
bind r exec $(dmenu_run -i -nb '#000000' -nf '#777777' -sb '#770000' -sf '#ffffff' -fn '-*-dina-medium-r-normal-*-12-*-*-*-*-*-*-*' -p '> ')
# Rat windows select
unbind w
bind w exec $(ratpoison -c "select `ratpoison -c "windows" | dmenu -i -nb '#000000' -nf '#777777' -sb '#770000' -sf '#ffffff' -fn '-*-dina-medium-r-normal-*-12-*-*-*-*-*-*-*' -p ':: ' | awk '{print $1}'`")
## Applications {{{1
bind e exec gvim
bind E exec ~/bin/urxvt-client -e /usr/bin/vim
bind o exec vivaldi-stable
bind O exec chromium
bind m exec smplayer
bind M exec vlc
bind v exec VirtualBox
bind x exec zathura
#bind C-g exec ratpoison -c 'hsplit 288' -c 'fselect 1' -c 'exec /usr/bin/gimp' && sleep 5 && ratpoison -c 'dedicate 1'
# Make prtscreen work, as long as in ratpoison mode. "import" is an Imagemagick command.
bind Print exec maim -st 9999999 ~/$(date +%s).png
## Keybindings {{{1
# volume
definekey top XF86AudioRaiseVolume exec ~/bin/voltun -c up -i 3% -m Master
definekey top XF86AudioMute exec ~/bin/voltun -c mute -i 3% -m Master
definekey top XF86AudioLowerVolume exec ~/bin/voltun -c down -i 3% -m Master
# multimedia keys
definekey top S-XF86AudioNext exec mpc seek +00:00:05 >/dev/null
definekey top S-XF86AudioPrev exec mpc seek -00:00:05 >/dev/null
definekey top XF86AudioNext exec mpc next >/dev/null && notify-send "$(mpc --format '[[%artist% - ]%title%]|[%file%] #| %time%' | head -n1)" -i notification-audio-next -t 1000
definekey top XF86AudioPrev exec mpc prev >/dev/null && notify-send "$(mpc --format '[[%artist% - ]%title%]|[%file%] #| %time%' | head -n1)" -i notification-audio-previous -t 1000
definekey top XF86AudioStop exec mpc stop >/dev/null && notify-send "$(mpc --format '[[%artist% - ]%title%]|[%file%] #| %time%' | head -n1)" -t 1000
definekey top S-XF86AudioStop exec notify-send "$(mpc --format '[[%artist% - ]%title%]|[%file%] #| %time%' | head -n1)" -i notification-audio-play -t 1000
definekey top XF86AudioPlay exec mpc toggle >/dev/null && notify-send "$(mpc --format '[[%artist% - ]%title%]|[%file%] #| %time%' | head -n1)" -i notification-audio-play -t 1000
definekey top XF86Calculator exec mpc next >/dev/null && notify-send "$(mpc --format '[[%artist% - ]%title%]|[%file%] #| %time%' | head -n1)" -i notification-audio-next -t 1000
## Aliasing long commands within ratpoison {{{1
#alias conkeror exec mozilla-firefox -chrome chrome://conkeror/content
#alias elinks exec aterm -e elinks
## Extras {{{1
# Cheat java programs
exec wmname LG3D
# vim: set tw=999: