<commit_before>#+TITLE: My window manager configuration

#+ATTR_HTML: :alt ratpoison.png image :title ratpoison :align left :width 480px :hight 280px
[[file:images/ratpoison.png]]

** Disable "Welcome" message.

I disabled the default welcome message on start up RP.

#+begin_src sh :tangle ~/.ratpoisonrc
startup_message off
#+end_src

** Unmanaged windows.

List of unmanaged windows.

#+begin_src sh :tangle ~/.ratpoisonrc
unmanage xmessage
#+end_src

** Appearance.

#+begin_src sh :tangle ~/.ratpoisonrc
set font "Anonymous Pro-13"
set bgcolor LightGray
set bargravity ne
set barpadding 5 0
set winliststyle row
set winfmt [%n] %s %t
set winname class
set wingravity c
set maxsizegravity c
#+end_src

*** RP "The best wm for smaller screens!"

I use Ratpoison on tiny 10 inch screen. So I disabled borders/panels etc..

#+begin_src sh :tangle ~/.ratpoisonrc
set padding 0 0 0 0
set barborder 0
set border 0
#+end_src

** Other commands.

Don't change the cursor into a square when waiting for a key.

#+begin_src sh :tangle ~/.ratpoisonrc :padline no
set waitcursor 0
#+end_src

I like 3 seconds for messages.

#+begin_src sh :tangle ~/.ratpoisonrc :padline no
msgwait 3
#+end_src

** Rudeness.

#+begin_src sh :tangle ~/.ratpoisonrc
# Rudeness is a bitwise or of the following values:
# 1 Transient windows may raise.
# 2 Normal windows may raise.
# 4 New transient windows end up in the foreground.
# 8 New normal windows end up in the foreground.
rudeness 12
#+end_src

** Hooks.

1. Warp the rat to corner of the screen every time you press a top level bound key.
2. Display information about the current window when you switch to a different window.
3. Display information about the current window when you switch to a different frame.

#+begin_src sh :tangle ~/.ratpoisonrc
addhook key banish
addhook switchwin info [%n] %t
addhook switchframe info [%n] %t
#+end_src

** Key bindings.

*** Groups/Windows/Frames

#+begin_src sh :tangle ~/.ratpoisonrc
bind z windows
bind o only
bind u undo
bind d dedicate
bind g groups
#+end_src

*** Using Other Window Manager

#+BEGIN_QUOTE
Use at your own risk ☠!!!
#+END_QUOTE

Temporarily gives control over to [[https://github.com/ivoarch/calavera-wm][Calavera]] window manager and regains control once it has terminated.
I use this when I have to play with floating windows.

#+BEGIN_SRC sh :tangle ~/.ratpoisonrc
bind W tmpwm calavera-wm
#+END_SRC

*** Run-or-raise

Emulate stumpwm run-or-raise with ratpoison.

Get the run-or-raise script form [[https://raw.github.com/ivoarch/bin/master/ratpoison/rp-run-or-raise.sh][here]].

1. =C-t c= run-or-raise to the Urxvt inside Screen session *(Ugly Hack? - Please fix me!)*. Set window 0 for default shell in your =~/.screenrc= config.
2. =C-t E= run-or-raise Emacs GUI
3. =C-t e= run-or-raise to the Emacs inside Screen session *(Ugly Hack? - Please fix me!)*. Set window 1 for emacs in your =~/.screenrc= config.
4. =C-t w= run-or-raise Conkeror

#+begin_src sh :tangle ~/.ratpoisonrc
bind c exec screen -Q select 0; exec ~/bin/ratpoison/rp-run-or-raise.sh URxvt 'urxvt'
alias emacs exec ~/bin/ratpoison/rp-run-or-raise.sh Emacs 'emacsclient -ca emacs'
bind E emacs
alias escreen exec screen -Q select 1; exec ~/bin/ratpoison/rp-run-or-raise.sh URxvt 'urxvt'
bind e escreen
alias conkeror exec ~/bin/ratpoison/rp-run-or-raise.sh Conkeror 'conkeror'
bind w conkeror
#+end_src

*** Function

Open *man* pages from RP.<commit_msg>Use -X instant<commit_after>#+TITLE: My window manager configuration

#+ATTR_HTML: :alt ratpoison.png image :title ratpoison :align left :width 480px :hight 280px
[[file:images/ratpoison.png]]

** Disable "Welcome" message.

I disabled the default welcome message on start up RP.

#+begin_src sh :tangle ~/.ratpoisonrc
startup_message off
#+end_src

** Unmanaged windows.

List of unmanaged windows.

#+begin_src sh :tangle ~/.ratpoisonrc
unmanage xmessage
#+end_src

** Appearance.

#+begin_src sh :tangle ~/.ratpoisonrc
set font "Anonymous Pro-13"
set bgcolor LightGray
set bargravity ne
set barpadding 5 0
set winliststyle row
set winfmt [%n] %s %t
set winname class
set wingravity c
set maxsizegravity c
#+end_src

*** RP "The best wm for smaller screens!"

I use Ratpoison on tiny 10 inch screen. So I disabled borders/panels etc..

#+begin_src sh :tangle ~/.ratpoisonrc
set padding 0 0 0 0
set barborder 0
set border 0
#+end_src

** Other commands.

Don't change the cursor into a square when waiting for a key.

#+begin_src sh :tangle ~/.ratpoisonrc :padline no
set waitcursor 0
#+end_src

I like 3 seconds for messages.

#+begin_src sh :tangle ~/.ratpoisonrc :padline no
msgwait 3
#+end_src

** Rudeness.

#+begin_src sh :tangle ~/.ratpoisonrc
# Rudeness is a bitwise or of the following values:
# 1 Transient windows may raise.
# 2 Normal windows may raise.
# 4 New transient windows end up in the foreground.
# 8 New normal windows end up in the foreground.
rudeness 12
#+end_src

** Hooks.

1. Warp the rat to corner of the screen every time you press a top level bound key.
2. Display information about the current window when you switch to a different window.
3. Display information about the current window when you switch to a different frame.

#+begin_src sh :tangle ~/.ratpoisonrc
addhook key banish
addhook switchwin info [%n] %t
addhook switchframe info [%n] %t
#+end_src

** Key bindings.

*** Groups/Windows/Frames

#+begin_src sh :tangle ~/.ratpoisonrc
bind z windows
bind o only
bind u undo
bind d dedicate
bind g groups
#+end_src

*** Using Other Window Manager

#+BEGIN_QUOTE
Use at your own risk ☠!!!
#+END_QUOTE

Temporarily gives control over to [[https://github.com/ivoarch/calavera-wm][Calavera]] window manager and regains control once it has terminated.
I use this when I have to play with floating windows.

#+BEGIN_SRC sh :tangle ~/.ratpoisonrc
bind W tmpwm calavera-wm
#+END_SRC

*** Run-or-raise

Emulate stumpwm run-or-raise with ratpoison.

Get the run-or-raise script form [[https://raw.github.com/ivoarch/bin/master/ratpoison/rp-run-or-raise.sh][here]].

1. =C-t c= run-or-raise to the Urxvt inside running Screen session. Set window 0 for default shell in your =~/.screenrc= config.
2. =C-t E= run-or-raise Emacs GUI
3. =C-t e= run-or-raise to the Emacs inside running Screen session. Set window 1 for emacs in your =~/.screenrc= config.
4. =C-t w= run-or-raise Conkeror

#+begin_src sh :tangle ~/.ratpoisonrc
bind c exec screen -X select 0; exec ~/bin/ratpoison/rp-run-or-raise.sh URxvt 'urxvt'
alias emacs exec ~/bin/ratpoison/rp-run-or-raise.sh Emacs 'emacsclient -ca emacs'
bind E emacs
alias escreen exec screen -X select 1; exec ~/bin/ratpoison/rp-run-or-raise.sh URxvt 'urxvt'
bind e escreen
alias conkeror exec ~/bin/ratpoison/rp-run-or-raise.sh Conkeror 'conkeror'
bind w conkeror
#+end_src

*** Function

Open *man* pages from RP.
{'fraction_non_alphanumeric': 0.10030841533264796, 'fraction_numerical': 0.011161697752974004, 'mean_word_length': 4.135746606334842, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3338950', 'n_tokens_mistral': 2471, 'n_tokens_neox': 2358, 'n_words': 937}