📜 ⬆️ ⬇️

Scratchpad with mcabber in awesome WM

In this topic, I will tell you how, using the scratch module, I set up a convenient call and hide the console mcabber Jabber client in the awesome window manager on a hotkey. This allowed me to release the whole tag that was previously used for the chat client, plus there is no need to remove focus from the current tag, which you are working with. Yeahconsole for this task did not suit me, because it does not have true-transparency (alpha channel) support, and it sometimes crookedly displays ncurses applications.

Software used in this scheme: awesome, screen, urxvt, mcabber, module scratch.

To begin with, I created a screenrc file in the ~ / .mcabber directory:
')
# , ,
hardstatus ignore

# mcabber Esc,
maptimeout 0

# mcabber, alparo
chdir /home/alparo/.mcabber

# mcabber ( )
# , ,
screen -t gtalk 1 mcabber -f mcabberrc_gtalk
screen -t main 0 mcabber -f mcabberrc

# screen ctrl+`
bindkey ^` next

In this file, I indicated only those screen settings that are needed for mcabber. All other system-wide settings I have in / etc / screenrc.

The awesome wiki has a section on the Scratchpad manager where you can read about all its features.
In short, I downloaded the scratch directory from git.sysphere.org/awesome-configs/tree and put it in ~ / .config / awesome / .

Then I added a line to the beginning of the ~ / .config / awesome / rc.lua file:

require("scratch")

And in the globalkeys section of this file added:

-- Scratchdrop
awful.key({ modkey }, "grave", function () scratch.drop("urxvtc -name scratch -e screen -rD -S mcabber", top, center, 0.98, 0.95) end),


Where top is the vertical position of the called terminal (maybe even bottom or center),
center - horizontal position (maybe left or right)
0.98 - terminal height (maximum 1)
0.95 - terminal width (maximum 1)

The final touch is to add to the autorun or manually start the command:

screen -c /home/%username%/.mcabber/screenrc -d -m -S mcabber

At the output we get the following picture:
when the system is started or started manually by the above command, a detailed screen is started and two mcabberes are running in it - each has its own account. By pressing win + `(win + grave), the scratchpad is called and the urxvtc terminal emulator is launched in it, to which the screen is attacked with mcabber running in it. Switch between accounts mcabber by ctrl + `(ctrl + grave). By pressing win + `again, the scratchpad is hidden.

With this method of launching screen, a problem appears: hot keys ctrl + s and ctrl + q do not work. But they can be emulated by pressing ctrl + a, s and ctrl + a, q respectively.

This is especially cool if you include true-transparency in urxvtc (meaning that the composite manager is running), adding the following lines to ~ / .Xdefaults:

scratch*depth: 32
scratch*background:[85]black


I would welcome any comments, especially regarding the improvement and optimization of this scheme.

UPD added a screenshot:

Source: https://habr.com/ru/post/94611/


All Articles