From 6678300a2be7469e82acd7ef14b0790b41298a67 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 12 Dec 2014 03:52:41 +0300 Subject: [PATCH 1/5] add paper, fix imaging --- _layouts/paper.html | 2 +- .../2014-12-12-encryption-home-directory.html | 173 ++++++++++++++++++ blog/index.html | 2 +- resources/papers/single-door.jpg | Bin 0 -> 5389 bytes .../2014-12-12-encryption-home-directory.html | 172 +++++++++++++++++ ru/blog/index.html | 2 +- 6 files changed, 348 insertions(+), 3 deletions(-) create mode 100644 _posts/2014-12-12-encryption-home-directory.html create mode 100644 resources/papers/single-door.jpg create mode 100644 ru/_posts/2014-12-12-encryption-home-directory.html diff --git a/_layouts/paper.html b/_layouts/paper.html index 326128f..1415dac 100644 --- a/_layouts/paper.html +++ b/_layouts/paper.html @@ -49,7 +49,7 @@ layout: default

{{ page.title }}

-{{ page.description }} +

{{ page.description }}


{{ content }} diff --git a/_posts/2014-12-12-encryption-home-directory.html b/_posts/2014-12-12-encryption-home-directory.html new file mode 100644 index 0000000..57526df --- /dev/null +++ b/_posts/2014-12-12-encryption-home-directory.html @@ -0,0 +1,173 @@ +--- +category: en +type: paper +hastr: true +layout: paper +tags: linux, systemd, ecryptfs +title: How to encrypt home directory. For dummies +short: ecnryption-home-directory +description:
single-door
This paper is about encryption home directory using ecryptfs and automount settins using systemd and key on flash card. +--- +

Step 0: Preparation

+
    +
  1. Logout as user.
  2. +
  3. Login as root on tty. The following actions should be done as root.
  4. +
  5. Move your home directory and create empty directory (s/$USER/user name/): + +{% highlight bash %} +mv /home/{$USER,$USER-org} +mkdir /home/$USER +chmod 700 /home/$USER +chown $USER:users /home/$USER +{% endhighlight %} + +
  6. +
+ +

Step 1: Encryption

+

The widespread solution in the Internet is to use automatic utilities to do it. However in our case they are not suitable, since we need to import key / password signature, which is not possible in this case.

+ +

The encryption can be done by the following command (lol):

+ +{% highlight bash %} +mount -t ecryptfs /home/$USER /home/$USER +{% endhighlight %} + +

While process it asks some question (I suggest to do first mounting in the interactive mode). The answers may be like following (see the comments), +please note that if you change something, it will be changed in some lines below too:

+ +{% highlight bash %} +# key or certificate. The second one is more reliable while you don't lose it %) +Select key type to use for newly created files: + 1) passphrase + 2) openssl +Selection: 1 +# password +Passphrase: +# cipher, select default +Select cipher: + 1) aes: blocksize = 16; min keysize = 16; max keysize = 32 + 2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56 + 3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24 + 4) twofish: blocksize = 16; min keysize = 16; max keysize = 32 + 5) cast6: blocksize = 16; min keysize = 16; max keysize = 32 + 6) cast5: blocksize = 8; min keysize = 5; max keysize = 16 +Selection [aes]: 1 +# key size, select default +Select key bytes: + 1) 16 + 2) 32 + 3) 24 +Selection [16]: 1 +# enable reading/writing to the non-encrypted files +Enable plaintext passthrough (y/n) [n]: n +# enable filename encryption +Enable filename encryption (y/n) [n]: y +Filename Encryption Key (FNEK) Signature [XXXXX]: +# toolongdontread +Attempting to mount with the following options: + ecryptfs_unlink_sigs + ecryptfs_fnek_sig=XXXXX + ecryptfs_key_bytes=16 + ecryptfs_cipher=aes + ecryptfs_sig=XXXXX +WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt], +it looks like you have never mounted with this key +before. This could mean that you have typed your +passphrase wrong. + +# accept, quit +Would you like to proceed with the mount (yes/no)? : yes +Would you like to append sig [XXXXX] to +[/root/.ecryptfs/sig-cache.txt] +in order to avoid this warning in the future (yes/no)? : yes +Successfully appended new sig to user sig cache file +Mounted eCryptfs +{% endhighlight %} + +

Then copy files from home directory to encrypted one:

+ +{% highlight bash %} +cp -a /home/$USER-org/. /home/$USER +{% endhighlight %} + +

Step 2: systemd automounting

+

Create file on flash card (I've used microSD) with the following text (you should insert your password):

+ +{% highlight bash %} +passphrase_passwd=someverystronguniqpassword +{% endhighlight %} + +

Add card automount (mount point is /mnt/key) to fstab with option ro, for example:

+ +{% highlight bash %} +UUID=dc3ecb41-bc40-400a-b6bf-65c5beeb01d7 /mnt/key ext2 ro,defaults 0 0 +{% endhighlight %} + +

Let's configure home directory mounting. The mount options can be found in the following output:

+ +{% highlight bash %} +mount | grep ecryptfs +{% endhighlight %} + +

I should note that there are not all options there, you need add key, no_sig_cache, ecryptfs_passthrough too. Thus systemd mount-unit should be like the following (if you are systemd-hater you can write the own daemon, because it doesn't work over fstab without modification (see below)).

+ +{% highlight bash %} +# cat /etc/systemd/system/home-$USER.mount +[Unit] +Before=local-fs.target +After=mnt-key.mount + +[Mount] +What=/home/$USER +Where=/home/$USER +Type=ecryptfs +Options=rw,nosuid,nodev,relatime,key=passphrase:passphrase_passwd_file=/mnt/key/keyfile,no_sig_cache,ecryptfs_fnek_sig=XXXXX,ecryptfs_sig=XXXXX,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n,ecryptfs_unlink_sigs + +[Install] +WantedBy=local-fs.target +{% endhighlight %} + +

XXXXX should be replaced to signature from options with which directory are currently mounting. Also you need to insert user name and edit path to file with password (and unit name) if it is needed. Autoload:

+ +{% highlight bash %} +systemctl enable home-$USER.mount +{% endhighlight %} + +

Here is a service to unmount flash card when it will be unneeded:

+ +{% highlight bash %} +# cat /etc/systemd/system/umount-key.service +[Unit] +Description=Unmount key card +Before=local-fs.target +After=home-arcanis.mount + +[Service] +Type=oneshot +ExecStart=/usr/bin/umount /mnt/key + +[Install] +WantedBy=local-fs.target +{% endhighlight %} + +

Enable:

+ +{% highlight bash %} +systemctl enable umount-key.service +{% endhighlight %} + +

Reboot. Remove backups if all is ok. If not then you did a mistake, resurrect system from emergency mode.

+ +

Why not fstab?

+

In my case I could not to make flash mounting before home decryption. Thus I saw emergency mode on load in which I should just continue loading. There are two solutions in the Internet:

+ + + +

In my opinion both of them are workarounds too much.

+ +

Why not pam?

+

Other solution is to mount using pam entry. In my case I have authentication without password on fingerprint so it doesn't work for me.

\ No newline at end of file diff --git a/blog/index.html b/blog/index.html index 0345898..d9f6bd9 100644 --- a/blog/index.html +++ b/blog/index.html @@ -23,6 +23,6 @@ hastr: true {{ post.title }}

{{ post.date | date_to_string }}

-{{ post.description }} +

{{ post.description }}

Tags: {{ post.tags }}

{% endfor %} diff --git a/resources/papers/single-door.jpg b/resources/papers/single-door.jpg new file mode 100644 index 0000000000000000000000000000000000000000..850e95386234d2a2b79fbd02d53f1ae7ee75bc8a GIT binary patch literal 5389 zcmbW&c{J4jzX$M-?1QY6ZL&mJBMc#XF?MD!*2*4223bSM(u6T(C(1TtD~vT;7;9wB z8rjAYvWzwS`rdob@1Ar2y7xZMdH?l(o%eY?&g;D2?~93xd4Ne*OGgVJ`x|jGaR9iO z2JQkhR8-Vdlr+@T)U>oTAbK_idOA9KP8L>1wyRvcJXg6O5I#W(A--$k0uYGsZ4vQX zQcx(AS4crwURp^)1}go}A!M|)wDffJ91IK`()Hl*sS^;JnAO#pDC%Xn*VkRSJ zCcEeWcmaTn@}F+W$bkO}*(GucN-Am^S`gje0z4CNiHw~55(POWB?ZOb>X5(t00lE8 z3%`^)6)W71`WlK&Ivo3+MnL0J8yGS4TTsT{JAxK;g`I-r5LVG&WNtlVvR1;xAf zG__#bI=UvNW=L}jODhLQC+9~lu5LcQPyPG@0)rx7L`BEMzC^!%la!p2nwFlCo0nfu zh$|}oP+3)tuc@u8Z}`&Q(Mjm)?&%#K866w{J~27?{_DC#K|xMI{f~?6lKxl zD|2tU3|4a67*nhjG0D5w=zr!PE22_E~T&!GzwA83c z`&~ZadBqbRJmyhRbpVWf19_dlB@luZYcRD+PG2EZq8cQX^Z7!zlt6tA5vHob^83XD zWrFai>4-a#<0U#JJ^aU`%=?}9h0P3?OyAxpg*&50vHIdVOBoq~;|_^+s#edO!v6&AxKKahD9wrY|j(kacBxC4!U^N?Q6#e5Cw#e*il$VZwn0u~fAX|vr z@KLIgJ?_IfJ?h~gyhu*oz z-s;#`BXUEl-+CIF#XX+qhq#ktx!9oG@DX8`&pN1Y(^8E z6oP_& zsJJW>wq&KyYEt?r5qy&^ZG`nH2xTD3-fV=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z(_fvm{N#a<>Kx`|*h_3$XREK!Y3+0-C~6_Ghk3p+ax34Is`qEKZDRy#n#FdM1r|tq z_UkgtyP_dgl)c*dxiQuJCdN*Sop<9P=U}*U%9xu%k##CdLW0SOGZxniSqW#^?2dQh z{Ur+x^k&HuK97?!&4ioZf1|}Xnh`H#mgw%ydRpEw)GOftyUD><@qj^GJh8u$Pyq3N zK(d&XKWD{wYHE3oD5FSh!}j$^BhcEDFy-Cpjzbv*Y=)<|&LHQ!>8B3cW0OPqwc79# zGpu(2A8{J0JW}}+Yt(e7XUiZ}T8n?&%l~bPDRWWh@CwcjS?ldrjSDB? zVhbpqMHb#c9J4z9d3B5+qdFg6+<6xxf9DtnWm!yuoFYPABjf=PfQAc*z>ZV$BJ7-) z(R|FbJsc&f_I3Lj${BfAre9K0g?zp9j;4S$OSFpTs6>aSRU46wr}whqr)5%AH*%`O zoVjHMqwfm34BQT^l0tHfCwhVV(9a2pM?k!DkUj_=1H6;i#b#EpH>bzLrC^<0l@G2^>FTvdwYP3| z7_42}IWfDDm1o zh-Gk3iil%_8@;n>@qC}Ez~2-Dz9Xp5`LN$})+M*fz52zeAWI1o_o~4o1A34axD|4? z<&s;>(pA>X#w@^dXQ*19V8PSDqFTlV_tHk|S+<^ywXOZJ{D8PWNDlTFJeA5tSL^Yl zzF|&ICMdh92g^x2xt|H=Mkm??G}R5Vgxcq`r`m>)S`Tv3;xVX2#Ao2y;vV#>+fNHB z;EaI{v8?W=^msQs9{2rDF?WYyJ3R#R1ueX+-rrleHQQsyDx$Pwq!()#YQ9+RlAFlL QdUwDsingle-doorСтатья посвящена шифрованию домашнего каталога с использованием ecryptfs и настройке автомонтирования посредством systemd с использованием ключа на флешке. +--- +

Шаг 0: Подготовка

+
    +
  1. Разлогинились пользователем. То есть совсем-совсем.
  2. +
  3. Зашли под root в tty. Дальнейшие действия описаны от него.
  4. +
  5. Передвинули наш хомяк и создали пустую директорию (s/$USER/имя пользователя/): + +{% highlight bash %} +mv /home/{$USER,$USER-org} +mkdir /home/$USER +chmod 700 /home/$USER +chown $USER:users /home/$USER +{% endhighlight %} + +
  6. +
+ +

Шаг 1: Шифрование

+

Самое распространенное решение в интернетах - воспользоваться автоматическими тулзами. Однако в нашем случае они не подходят, так как нам необходимо импортировать сигнатуру ключа / пароля, что при данном решении невозможно (или у автора руки кривые).

+ +

Делается шифрование следующим образом (lol):

+ +{% highlight bash %} +mount -t ecryptfs /home/$USER /home/$USER +{% endhighlight %} + +

В процессе он у нас задаст несколько вопросов (я предлагаю первое монтирование делать в интерактивном режиме). Ответы можно взять примерно такие (в комментариях показано, что эти опции делают), обратите внимание, что если вы что то измените, то изменится и некоторые строчки далее:

+ +{% highlight bash %} +# ключ или сертификат. Второе надежнее, но до тех пор пока не потеряете %) +Select key type to use for newly created files: + 1) passphrase + 2) openssl +Selection: 1 +# пароль +Passphrase: +# шифрование, ставим берем дефолт +Select cipher: + 1) aes: blocksize = 16; min keysize = 16; max keysize = 32 + 2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56 + 3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24 + 4) twofish: blocksize = 16; min keysize = 16; max keysize = 32 + 5) cast6: blocksize = 16; min keysize = 16; max keysize = 32 + 6) cast5: blocksize = 8; min keysize = 5; max keysize = 16 +Selection [aes]: 1 +# размер ключа, берем дефолт +Select key bytes: + 1) 16 + 2) 32 + 3) 24 +Selection [16]: 1 +# разрешать читать/писать в нешифрованные файлы в точке монтирования +Enable plaintext passthrough (y/n) [n]: n +# включить шифрование имен файлов +Enable filename encryption (y/n) [n]: y +Filename Encryption Key (FNEK) Signature [360d0573e701851e]: +# многабукафниасилил +Attempting to mount with the following options: + ecryptfs_unlink_sigs + ecryptfs_fnek_sig=360d0573e701851e + ecryptfs_key_bytes=16 + ecryptfs_cipher=aes + ecryptfs_sig=360d0573e701851e +WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt], +it looks like you have never mounted with this key +before. This could mean that you have typed your +passphrase wrong. + +# подтверждаем, выходим +Would you like to proceed with the mount (yes/no)? : yes +Would you like to append sig [360d0573e701851e] to +[/root/.ecryptfs/sig-cache.txt] +in order to avoid this warning in the future (yes/no)? : yes +Successfully appended new sig to user sig cache file +Mounted eCryptfs +{% endhighlight %} + +

Далее просто копируем файлы из родного хомяка:

+ +{% highlight bash %} +cp -a /home/$USER-org/. /home/$USER +{% endhighlight %} + +

Шаг 2: Автомонтирование с systemd

+

Создадим файл на флешке (я использовал microSD) со следующим содержанием (пароль только поставьте свой):

+ +{% highlight bash %} +passphrase_passwd=someverystronguniqpassword +{% endhighlight %} + +

Добавим автомонтирование флешки (направление /mnt/key) в fstab с опцией ro, например так:

+ +{% highlight bash %} +UUID=dc3ecb41-bc40-400a-b6bf-65c5beeb01d7 /mnt/key ext2 ro,defaults 0 0 +{% endhighlight %} + +

Теперь настроим монтирование хомяка. Опции монтирования можно подглядеть как то так:

+ +{% highlight bash %} +mount | grep ecryptfs +{% endhighlight %} + +

Однако замечу, что там указаны не все опции, необходимо добавить также key, no_sig_cache, ecryptfs_passthrough. Таким образом, для systemd mount-юнит выглядит примерно так (любители shell-простыней смогут написать свой демон, потому что через fstab не сработает просто так (см. ниже)).

+ +{% highlight bash %} +# cat /etc/systemd/system/home-$USER.mount +[Unit] +Before=local-fs.target +After=mnt-key.mount + +[Mount] +What=/home/$USER +Where=/home/$USER +Type=ecryptfs +Options=rw,nosuid,nodev,relatime,key=passphrase:passphrase_passwd_file=/mnt/key/keyfile,no_sig_cache,ecryptfs_fnek_sig=XXXXX,ecryptfs_sig=XXXXX,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n,ecryptfs_unlink_sigs + +[Install] +WantedBy=local-fs.target +{% endhighlight %} + +

XXXXX нужно заменить на сигнатуру из опций, с которыми сейчас смонтирована директория. Также нужно вставить имя пользователя и отредактировать путь к файлу с паролем (и имя mount-юнита), если это необходимо. Автозагрука:

+ +{% highlight bash %} +systemctl enable home-$USER.mount +{% endhighlight %} + +

Сервис для отмонтирования флешки, когда она не нужна будет:

+ +{% highlight bash %} +# cat /etc/systemd/system/umount-key.service +[Unit] +Description=Unmount key card +Before=local-fs.target +After=home-arcanis.mount + +[Service] +Type=oneshot +ExecStart=/usr/bin/umount /mnt/key + +[Install] +WantedBy=local-fs.target +{% endhighlight %} + +

Включаем:

+ +{% highlight bash %} +systemctl enable umount-key.service +{% endhighlight %} + +

Перезагружаемся, если все ок, удаляем бекап. Если нет - значит что то где то неправильно сделали, восстанавливаем из режима восстановления.

+ +

Почему не fstab?

+

В моем случае, мне не получилось заставить флешку монтироваться раньше. Таким образом на загрузке я попадал в консоль восстановления из которой нужно было просто продолжить загрузку. Существующие в интернете методы предлагают два возможных варианта:

+ +
    +
  • Создать запись с опцией noauto, потом монтировать через специальную запись в rc.local.
  • +
  • Создать запись с опцией nofail, потом перемонтировать все разделы через rc.local.
  • +
+ +

Оба варианта меня не устроили в виду их костыльности.

+ +

Почему не pam?

+

Другое распространенное предложение - монтировать через запись в настройках pam. Мне этот вариант не подходит, так как у меня авторизация беспарольная по отпечатку пальца.

\ No newline at end of file diff --git a/ru/blog/index.html b/ru/blog/index.html index d66d2d3..301ddb0 100644 --- a/ru/blog/index.html +++ b/ru/blog/index.html @@ -24,6 +24,6 @@ hastr: true {{ post.title }}

{% include shortdate_to_ru.html %}

-{{ post.description }} +

{{ post.description }}

Тэги: {{ post.tags }}

{% endfor %} From 3a5ade22f884d9e984da7080725f6f7648a52428 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Wed, 17 Dec 2014 07:44:38 +0300 Subject: [PATCH 2/5] update pages to recent changes (excluding paper) --- projects/awesome-widgets.html | 28 ++++++++++++---------------- ru/projects/awesome-widgets.html | 28 ++++++++++++---------------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/projects/awesome-widgets.html b/projects/awesome-widgets.html index 44fa035..c2d8343 100644 --- a/projects/awesome-widgets.html +++ b/projects/awesome-widgets.html @@ -86,7 +86,7 @@ sudo make install

How to use

-

Open your Plasma widgetes and select Awesome Widget.

+

Open your Plasma widgets and select Awesome Widget.

Tips & tricks

You may use different colors for labels. Just put label text into html code. See issue for more details.

@@ -106,14 +106,6 @@ sudo make install ACPIPATH Path to ACPI devices. Default is /sys/class/power_supply/. - - CUSTOM - Custom commands to run. Default is wget -qO- http://ifconfig.me/ip. Separator is @@. - - - DESKTOPCMD - Command which defines the current desktop. Default is qdbus org.kde.kwin /KWin currentDesktop. - GPUDEV Set GPU device. May be nvidia (for nVidia), ati (for ATI Radeon), disable or auto. Default is auto. @@ -533,16 +525,14 @@ sudo make install

AC offline tag: Line which will be shown when AC is offline. Default is ( ).

+

Check updates: Check updates on load. Default is true.

+

Tooltips

Since version 1.7.0 CPU, CPU clock, memory, swap, network and battery support graphical tooltip. To enable them just make the needed checkboxes a fully checked. The number of stored values can be set in the tab. Colors of graphs are configurable too.

DataEngine settings

ACPI path: Path to ACPI devices. The file /sys/class/power_supply/.

-

Custom command: Commands, which will be run for custom label. For example, wget -qO- http://ifconfig.me/ip will return external IP.

- -

Desktop cmd: Type a command which will be run for desktop DataEngine. Default is qdbus org.kde.kwin /KWin currentDesktop.

-

GPU device: Select one of supported GPU devices. auto will enable auto selection, disable will disable all GPU monitors. Default is auto.

HDD: Select one of HDDs for HDD temperature monitor. all will enable monitor for all devices, disable will disable HDD temperature monitor. Default is all.

@@ -604,7 +594,11 @@ sudo make install

Vertical layout: Use vertical layout instead of horizontal one.

-

Add stretch: Add stretch (spacer) to the selected side of the widget.

+

Enable tooltip: Check to enable preview on selected destkop. Default is true. Also you show specify type of preview, default is Windows.

+ +

Tooltip width: Using tooltip width in px. Default is 200px.

+ +

Color of window borders: Color of window contours which are used in "Contours preview". Default is #ffffff.

Mark: Type symbol (or string) which will be shown if this desktop is active now.

@@ -614,6 +608,10 @@ sudo make install $mark Show mark if this desktop is active. + + $fullmark + The same as $mark, but shows empty space too. + $name Name of the desktop. @@ -628,8 +626,6 @@ sudo make install -

Command: Type command which will be run on left click on the selected desktop. Available variables are same as for pattern. Default is dbus org.kde.kwin /KWin setCurrentDesktop $number.

-

Panel toggle: Select panels which will be set hidden on hotkey.

diff --git a/ru/projects/awesome-widgets.html b/ru/projects/awesome-widgets.html index fd171fa..d2f5e02 100644 --- a/ru/projects/awesome-widgets.html +++ b/ru/projects/awesome-widgets.html @@ -107,14 +107,6 @@ sudo make install ACPIPATH Путь к устройствам ACPI. По умолчанию /sys/class/power_supply/. - - CUSTOM - Свои команды для запуска. По умолчанию wget -qO- http://ifconfig.me/ip. Разделитель @@. - - - DESKTOPCMD - Комадна, которая определяет текущий рабочий стол. По умолчанию qdbus org.kde.kwin /KWin currentDesktop. - GPUDEV Устанавливает тип GPU. Может быть nvidia (для nVidia), ati (для ATI Radeon), disable или auto. По умолчанию auto. @@ -534,16 +526,14 @@ sudo make install

AC offline тег: Строка, которая будет показана, когда AC оффлайн. По умолчанию ( ).

+

Проверять обновления: Проверять или нет обновления при запуске. По умолчанию проверять.

+

Тултипы

-

Начиная с версии 1.7.0, поля CPU, частота CPU, память, swap, сеть и батарея поддерживают графический тултип (всплывающая подсказка). Чтобы включить их, просто сделайте требуемые чекбоксы полностью чекнутыми. Число хранимых значений может быть установленно во вкладке. Цвета графиков настраиваются тоже.

+

Начиная с версии 1.7.0, поля CPU, частота CPU, память, swap, сеть и батарея поддерживают графический тултип (всплывающая подсказка). Чтобы включить их, просто сделайте требуемые чекбоксы полностью чекнутыми. Число хранимых значений может быть установлено во вкладке. Цвета графиков настраиваются тоже.

Настройка DataEngine

Устройства ACPI: Путь к устройствам ACPI. По умолчанию /sys/class/power_supply/.

-

Своя команда: Команды, которые будут запущены для соответствующего поля. Например, wget -qO- http://ifconfig.me/ip вернет внешний IP.

- -

Комадна для определения рабочего стола Введите команду, которая будет запущеная для desktop DataEngine. По умолчанию qdbus org.kde.kwin /KWin currentDesktop.

-

Устройство GPU: Выберете одно из поддерживаемых устройств GPU. auto включит автоматическое определение устройства, disable отключит все мониторы GPU. По умолчанию auto.

HDD: Выберете один из HDD для монитора температуры HDD. all включит монитор для всех доступных устройств, disable отключит монитор температуры HDD. По умолчанию all.

@@ -605,7 +595,11 @@ sudo make install

Вертикальная разметка: Использовать вертикальную разметку вместо горизонтальной.

-

Добавить пустое пространство: Добавить пустое пространство в указанное место виджета.

+

Включить тултип: Включать или нет графическое превью выбранного рабочего стола. Вы также должны указать тип превью, по умолчанию Окна.

+ +

Ширина тултипа: Ширина тултипа в пикселях. По умолчанию 200px.

+ +

Цвет границ окна: Цвет рамок окон в тултипе "Контуры". По умолчанию #ffffff.

Метка Введите символ (или строку), которая будет показана, если данный рабочий стол сейчас активен.

@@ -615,6 +609,10 @@ sudo make install $mark Показать метку, если данный рабочий стол активен. + + $fullmark + Также, как и $mark, но показывать пустое место. + $name Имя рабочего стола. @@ -629,8 +627,6 @@ sudo make install -

Команда: Введите команду, которая будет запущена по клику левой кнопкой мыши на выбранном рабочем столе. Доступны те же переменные, что и для шаблонов. По умолчанию dbus org.kde.kwin /KWin setCurrentDesktop $number.

-

Скрытие панелей: Выберите панели, которые будут скрыты при нажатии на горячую клавишу.

From f92ad7181d072c3c9aa7853c3d9e90f0cbb3f479 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 19 Dec 2014 02:20:39 +0300 Subject: [PATCH 3/5] add paper --- .../2014-12-19-aw-2.1-bells-and-whistles.html | 138 ++++++++++++++++++ .../2014-12-19-aw-2.1-bells-and-whistles.html | 138 ++++++++++++++++++ 2 files changed, 276 insertions(+) create mode 100644 _posts/2014-12-19-aw-2.1-bells-and-whistles.html create mode 100644 ru/_posts/2014-12-19-aw-2.1-bells-and-whistles.html diff --git a/_posts/2014-12-19-aw-2.1-bells-and-whistles.html b/_posts/2014-12-19-aw-2.1-bells-and-whistles.html new file mode 100644 index 0000000..5c81eaf --- /dev/null +++ b/_posts/2014-12-19-aw-2.1-bells-and-whistles.html @@ -0,0 +1,138 @@ +--- +category: en +type: paper +hastr: true +layout: paper +tags: awesome-widgets, pytextmonitor +title: Awesome Widgets 2.1: bells and whistles +short: aw-2.1-bells-and-whistles +description: The paper deals with settings of a custom scripts and graphical bars in the new version of Awesome Widgets (2.1). +--- +

Introduction

+

For a start it is highly recommended copy file $HOME/.kde4/share/config/extsysmon.conf after widget update before you open widget settings, because old and new script settings are incompatible. Also I should note that these features can be configured from graphical interface, but I will describe how it can be done by simply editing the desktop file.

+ +

Bars

+

Bars are stored in the two directories: /usr/share/apps/plasma_applet_awesome-widget/desktops/ and $HOME/.kde4/share/apps/plasma_applet_awesome-widget/desktops/ (path may be differ in depend from your distro). Settings in the home directory have a higher priority that global ones. Configuration files have the following fields:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldRequiredValueDefault
Nameyesbar name. It should be as barN and should be uniquenone
Commentnocommentempty
X-AW-Valueyesbar value. The following tags are available cpu*, gpu, mem, swap, hdd*, batcpu
X-AW-ActiveColoryesactive part fill in format R,G,B,A0,0,0,130
X-AW-InactiveColoryesinactive part fill in format R,G,B,A255,255,255,130
X-AW-Typeyesbar type. The following types are supported Horizontal, Vertical, CircleHorizontal
X-AW-Directionyesthe fill direction. The following variants are supported LeftToRight, RightToLeftLeftToRight
X-AW-Heightyesheight, pixels100
X-AW-Widthyeswidth, pixels100
+ +

Scripts

+

Scripts are stored in the two directories: /usr/share/apps/plasma_engine_extsysmon/scripts/ and $HOME/.kde4/share/apps/plasma_engine_extsysmon/scripts/ (path may be differ in depend from your distro). Settings in the home directory have a higher priority that global ones. To enable script you should type it on the output field. Configuration files have the following fields:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldRequiredValueDefault
Nameyesscript namenone
Commentnocommentempty
Execyespath to executable file/usr/bin/true
X-AW-Prefixnoprefix to executable file. Usually it's not required, but in other you may want to specify interpretor for example.
X-AW-Activenowhether or not the script is activetrue
X-AW-Outputnowhether or not the script has output to console. You may set it to false if you want use the script as cron jobstrue
X-AW-Redirectnostream redirection. The following variants are available stderr2stdout, nothing, stdout2stderr. stderr will be enabled, if you run application with DEBUG=yesnothing
X-AW-Intervalnoupdate interval in standard widget intervals1
\ No newline at end of file diff --git a/ru/_posts/2014-12-19-aw-2.1-bells-and-whistles.html b/ru/_posts/2014-12-19-aw-2.1-bells-and-whistles.html new file mode 100644 index 0000000..a73b7b7 --- /dev/null +++ b/ru/_posts/2014-12-19-aw-2.1-bells-and-whistles.html @@ -0,0 +1,138 @@ +--- +category: ru +type: paper +hastr: true +layout: paper +tags: awesome-widgets, pytextmonitor +title: Awesome Widgets 2.1: свистелки и перделки +short: aw-2.1-bells-and-whistles +description: Данная статья посвящена обсуждению настройки своих скриптов и графических баров в новой версии Awesome Widgets (2.1). +--- +

Введение

+

Для начала, я настоятельно рекомендую для после обновления не открывая настроек виджета скопировать в безопасное место файл $HOME/.kde4/share/config/extsysmon.conf, так как старые настройки кастомных скриптов теперь несовместимы. Вообще, следует заметить, что обе новых фичи можно настраивать и из графического интерфейса, однако я опишу, как это делается простым редактированием desktop файлов.

+ +

Бары

+

Бары хранятся в двух директориях: /usr/share/apps/plasma_applet_awesome-widget/desktops/ и $HOME/.kde4/share/apps/plasma_applet_awesome-widget/desktops/ (пути могут немного отличаться в зависимости от используемого дистрибутива). Настройки в домашней директории перезаписывают глобальные настройки. Файлы настроек имеют следующие поля:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ПолеОбязательноеЗначениеПо-умолчанию
Nameдаимя бара. Должно иметь вид barN и быть уникальнымnone
Commentнеткомментарийempty
X-AW-Valueдазначение бара. Доступны теги cpu*, gpu, mem, swap, hdd*, batcpu
X-AW-ActiveColorдазаполнение активной части в формате R,G,B,A0,0,0,130
X-AW-InactiveColorдазаполнение неактивной части в формате R,G,B,A255,255,255,130
X-AW-Typeдатип бара. Поддерживаемые типы Horizontal, Vertical, CircleHorizontal
X-AW-Directionданаправление заполнения. Доступны варианты LeftToRight, RightToLeftLeftToRight
X-AW-Heightдавысота в пикселях100
X-AW-Widthдаширина в пикселях100
+ +

Скрипты

+

Скрипты хранятся в двух директориях: /usr/share/apps/plasma_engine_extsysmon/scripts/ и $HOME/.kde4/share/apps/pplasma_engine_extsysmon/scripts/ (пути могут немного отличаться в зависимости от используемого дистрибутива). Настройки в домашней директории перезаписывают глобальные настройки. Для того, чтобы активировать скрипт необходимо прописать нужный тег в поле вывода. Файлы настроек имеют следующие поля:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ПолеОбязательноеЗначениеПо-умолчанию
Nameдаимя скриптаnone
Commentнеткомментарийempty
Execдапуть к исполняемому файлу/usr/bin/true
X-AW-Prefixнетпрефикс к исполняемому файлу. Обычно не требуется, однако в отдельных случаях может потребоваться явно указать путь, например, к используемому интерпретатору
X-AW-Activeнетактивен или нет данный скриптtrue
X-AW-Outputнетимеет ли данный скрипт сообщения в консоль. Полезно выставить в false, если вы хотите использовать скрипт, как аналог задач в crontrue
X-AW-Redirectнетперенаправление потоков сообщений. Доступны варианты stderr2stdout, nothing, stdout2stderr. stderr доступен, если запустить с DEBUG=yesnothing
X-AW-Intervalдаинтервал запуска скрипта в стандартных интервалах обновления виджета1
\ No newline at end of file From fc475d3501467d6e0335b30fb025d7924f0f48f6 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 19 Dec 2014 02:22:44 +0300 Subject: [PATCH 4/5] rename --- ...-whistles.html => 2014-12-19-aw-v21-bells-and-whistles.html} | 2 +- ...-whistles.html => 2014-12-19-aw-v21-bells-and-whistles.html} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename _posts/{2014-12-19-aw-2.1-bells-and-whistles.html => 2014-12-19-aw-v21-bells-and-whistles.html} (99%) rename ru/_posts/{2014-12-19-aw-2.1-bells-and-whistles.html => 2014-12-19-aw-v21-bells-and-whistles.html} (99%) diff --git a/_posts/2014-12-19-aw-2.1-bells-and-whistles.html b/_posts/2014-12-19-aw-v21-bells-and-whistles.html similarity index 99% rename from _posts/2014-12-19-aw-2.1-bells-and-whistles.html rename to _posts/2014-12-19-aw-v21-bells-and-whistles.html index 5c81eaf..aedb57e 100644 --- a/_posts/2014-12-19-aw-2.1-bells-and-whistles.html +++ b/_posts/2014-12-19-aw-v21-bells-and-whistles.html @@ -5,7 +5,7 @@ hastr: true layout: paper tags: awesome-widgets, pytextmonitor title: Awesome Widgets 2.1: bells and whistles -short: aw-2.1-bells-and-whistles +short: aw-v21-bells-and-whistles description: The paper deals with settings of a custom scripts and graphical bars in the new version of Awesome Widgets (2.1). ---

Introduction

diff --git a/ru/_posts/2014-12-19-aw-2.1-bells-and-whistles.html b/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html similarity index 99% rename from ru/_posts/2014-12-19-aw-2.1-bells-and-whistles.html rename to ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html index a73b7b7..99c2c5b 100644 --- a/ru/_posts/2014-12-19-aw-2.1-bells-and-whistles.html +++ b/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html @@ -5,7 +5,7 @@ hastr: true layout: paper tags: awesome-widgets, pytextmonitor title: Awesome Widgets 2.1: свистелки и перделки -short: aw-2.1-bells-and-whistles +short: aw-v21-bells-and-whistles description: Данная статья посвящена обсуждению настройки своих скриптов и графических баров в новой версии Awesome Widgets (2.1). ---

Введение

From ff887fdfd1ad25edef440c9f489a5b35884f9c67 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 19 Dec 2014 02:25:00 +0300 Subject: [PATCH 5/5] fix layout --- _posts/2014-12-19-aw-v21-bells-and-whistles.html | 4 ++-- ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_posts/2014-12-19-aw-v21-bells-and-whistles.html b/_posts/2014-12-19-aw-v21-bells-and-whistles.html index aedb57e..4426c46 100644 --- a/_posts/2014-12-19-aw-v21-bells-and-whistles.html +++ b/_posts/2014-12-19-aw-v21-bells-and-whistles.html @@ -4,7 +4,7 @@ type: paper hastr: true layout: paper tags: awesome-widgets, pytextmonitor -title: Awesome Widgets 2.1: bells and whistles +title: Awesome Widgets 2.1 - bells and whistles short: aw-v21-bells-and-whistles description: The paper deals with settings of a custom scripts and graphical bars in the new version of Awesome Widgets (2.1). --- @@ -135,4 +135,4 @@ description: The paper deals with settings of a custom scripts and graphical bar update interval in standard widget intervals 1 - \ No newline at end of file + diff --git a/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html b/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html index 99c2c5b..edecc73 100644 --- a/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html +++ b/ru/_posts/2014-12-19-aw-v21-bells-and-whistles.html @@ -4,7 +4,7 @@ type: paper hastr: true layout: paper tags: awesome-widgets, pytextmonitor -title: Awesome Widgets 2.1: свистелки и перделки +title: Awesome Widgets 2.1 - свистелки и перделки short: aw-v21-bells-and-whistles description: Данная статья посвящена обсуждению настройки своих скриптов и графических баров в новой версии Awesome Widgets (2.1). --- @@ -135,4 +135,4 @@ description: Данная статья посвящена обсуждению интервал запуска скрипта в стандартных интервалах обновления виджета 1 - \ No newline at end of file +