Labwc replaces customized skin

Due to a job change, the previous Linux computer was handed over to the company. I've been using a Macbook pro for the past few weeks, and I can't define various settings myself, so my efficiency has dropped significantly.

Before 618, I went to JD.com and placed an order for a system-only mini host. Then I bought a memory stick and an SSD hard drive. I assembled the Linux host myself and played with it. It was very smooth and everything came back. I will write an article later to explain why I bought a mini host. Host, donโ€™t buy a Mac mini.

Back to the topic, the configuration of my system is placed in the dotfile warehouse on github, so I only need to install the operating system, install the necessary basic software, and then Just copy the various configurations in the .config directory to the warehouse.

During this process, I discovered that I had not recorded how to adjust the theme of labwc before. The original title menu was simple and monotonous.

origin theme

1. Find the right skin

Since there is no record of configuring the skin, I even forgot what theme I was using at the time. Fortunately, I found it by looking at the labwc documentation.

 1[mephisto@minipc labwc]$ grep -A3 -B3 theme rc.xml
 2     <reuseOutputMode>no</reuseOutputMode>
 3   </core>
 4
 5   <!-- <font><theme> can be defined without an attribute to set all places -->
 6   <theme>
 7     <name>Dracula</name>
 8     <cornerRadius>8</cornerRadius>
 9     <font place="ActiveWindow">
10--
11       <slant>normal</slant>
12       <weight>normal</weight>
13     </font>
14   </theme>
15
16   <windowSwitcher show="yes" preview="yes" outlines="yes">
17     <fields>
18[mephisto@minipc labwc]$

The name attribute above contains the Dracula I am looking for.

Dracula is a skin that can be used by various platform software. If you are interested, you can go to the official website https://draculatheme.com/

Since labwc applies the openbox mechanism, you only need to clone https://github.com/dracula/openbox locally and put it in the skin directory specified in the labwc document.

 1[mephisto@minipc Dracula]$ pwd
 2/home/mephisto/.local/share/themes/Dracula
 3[mephisto@minipc Dracula]$ tree
 4.
 5โ””โ”€โ”€ openbox-3
 6     โ”œโ”€โ”€ bullet.xbm
 7     โ”œโ”€โ”€ close_hover.xbm
 8     โ”œโ”€โ”€ close.xbm
 9     โ”œโ”€โ”€ desk_hover_toggled.xbm
10     โ”œโ”€โ”€ desk_hover.xbm
11     โ”œโ”€โ”€ desk_toggled.xbm
12     โ”œโ”€โ”€ desk.xbm
13     โ”œโ”€โ”€ iconify_hover.xbm
14     โ”œโ”€โ”€ iconify.xbm
15     โ”œโ”€โ”€ max_hover_toggled.xbm
16     โ”œโ”€โ”€ max_hover.xbm
17     โ”œโ”€โ”€ max_toggled.xbm
18     โ”œโ”€โ”€ max.xbm
19     โ”œโ”€โ”€ shade_hover_toggled.xbm
20     โ”œโ”€โ”€ shade_hover.xbm
21     โ”œโ”€โ”€ shade_toggled.xbm
22     โ”œโ”€โ”€ shade.xbm
23     โ”œโ”€โ”€ test.xbm
24     โ””โ”€โ”€ themerc

Judging from the contents of the file directory, it mainly consists of some icons, hover icons, and a themerc configuration file, which controls various style attributes and can be changed at will. In fact, you can also draw an icon yourself. Anyway, you can set it how you like. This is the biggest difference between Linux and commercial systems such as Mac and Windows.

2. Fill in the skin name in rc.xml of labwc

As shown in the figure below, just fill in the skin name in the name attribute in the theme.

1[mephisto@minipc labwc]$ pwd
2/home/mephisto/.config/labwc
3[mephisto@minipc labwc]$ vim rc.xml

labwc rc xml

3. Customization

Whether the skin looks good or not, everyone has different feelings. People with patience will read through labwc official documentation, and then slowly change it.

I personally think the default is pretty good, with very few changes.

If you want to change it, for example, I don't like the default border of Dracula, it's too wide. border.widtd controls this, I changed it from 5 to 1, and the surrounding borders will become narrower.

1[mephisto@minipc ~]$ grep ^border.width ~/.local/share/themes/Dracula/openbox-3/themerc
2border.width: 5
3[mephisto@minipc ~]$ grep ^border.width ~/.config/labwc/themerc
4border.width: 1

Note that it is best to make changes in your own themec file. The advantage of this is that next time you change the computer to pull this theme, everything will be what you want without any changes. I think you should understand.

4. Final effect

Finally look at the renderings:

labwc Dracula

1 and 2 are wofi launcher and terminal software Alacritty respectively. The border colors of the active window and the inactive window are different, and the color of the icon in the upper right corner is also different. When the active window is hovered with the mouse, the icon will switch.

Obviously, the title bar background color and font color are also different from the original plain interface. The font color is set to blue.

Netizens who don't want to bother can use my dotfile directly, and it doesn't cost any money anyway.

Since I customized my own desktop environment, I have been too lazy to look at Gnome, kde, xfce, cosmic, etc. It is still useful to build it myself.

There are no ads, no extra bells and whistles, and no unnecessary software or processes.

Various shortcut keys can be set according to your frequency of use and preferences. Frequently used switching operations do not require a mouse, which is really cool.

Lastmod๏ผš Tuesday, May 21, 2024

See Also:

Translations: