Difference between revisions of "Basic Tips for conky/fa"
Views
Actions
Namespaces
Variants
Tools
(Created page with "* پیکربندی * متن") Tags: Mobile web edit Mobile edit |
(Updating to match new version of source page) Tags: Mobile web edit Mobile edit |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
==نصب و راهاندازی== | ==نصب و راهاندازی== | ||
کانکی را می توان با استفاده از مدیربسته نصب کرد: | کانکی را می توان با استفاده از مدیربسته نصب کرد: | ||
{{UserCmd|pamac install conky}} | {{UserCmd|command=pamac install conky}} | ||
<div class="mw-translate-fuzzy"> | |||
===پیکربندی=== | ===پیکربندی=== | ||
همهی فایل هایی که نامشان با نقطه <code>.</code> شروع میشوند، فایلهای مخفی هستند. اگر می خواهید فایلهای مخفی را در مدیر پرونده خود مشاهده کنید، باید آنها را قابل مشاهده کنید. در اکثر مدیر پروندهها این در گزینه ها موجود خواهد بود. | همهی فایل هایی که نامشان با نقطه <code>.</code> شروع میشوند، فایلهای مخفی هستند. اگر می خواهید فایلهای مخفی را در مدیر پرونده خود مشاهده کنید، باید آنها را قابل مشاهده کنید. در اکثر مدیر پروندهها این در گزینه ها موجود خواهد بود. | ||
Line 15: | Line 16: | ||
سپس پرونده پیشفرض را در home/ کپی کنید | سپس پرونده پیشفرض را در home/ کپی کنید | ||
{{UserCmd|command=cp /usr/share/doc/conky-1.11.5_pre/conky.conf ~/.config/conky/conky.conkyrc}} | {{UserCmd|command=cp /usr/share/doc/conky-1.11.5_pre/conky.conf ~/.config/conky/conky.conkyrc}} | ||
فایل پیکربندی یک فایل متنی ساده است که محتوای آن با استفاده از ''' | فایل پیکربندی یک فایل متنی ساده است که محتوای آن با استفاده از '''[https://www.lua.org| لوآ]''' نوشته شده است و به دو بخش تقسیم می شود. | ||
</div> | |||
* پیکربندی | * پیکربندی | ||
* متن | * متن | ||
=== | <div class="mw-translate-fuzzy"> | ||
===پیکربندی کانکی=== | |||
{{File|file=~/.config/conky/conky.conkyrc| | قسمت اول/بالا شامل تمام تنظیمات پیکربندی برای کل کانکی است. مواردی مانند موقعیت کانکی روی صفحه، تنظیمات شفافیت، تنظیمات حاشیه، فونت پیشفرض و اندازه آن، و تعداد دفعات بهروزرسانی مخزن شما. کل پیکربندی بین براکت هایی مانند این تعلق دارد | ||
content=<pre>conky.config = { | {{File|file=~/.config/conky/conky.conkyrc| content=<pre>conky.config = { };</pre>}} | ||
};</pre> | برخی از قوانین باید رعایت شوند : | ||
</div> | |||
* | <div class="mw-translate-fuzzy"> | ||
* | * هر خط با <code>,</code> پایان مییابد | ||
* | * مقدار غیرعددی باید بین <code>'</code> قرار گیرد | ||
* نظر، یا کامنت، با <code>--</code> شروع میشود | |||
'''1.''' | '''1.''' با این کار رنگ فونت پیشفرض کانکی شما روی سفید تنظیم میشود. علاوه بر این، یک <code>color1</code> با استفاده از یک [http://html-color-codes.info/ کد رنگ Html] روی آبی روشن تنظیم می شود: | ||
{{File|file=~/.config/conky/conky.conkyrc| | {{File|file=~/.config/conky/conky.conkyrc| content=<pre>conky.config = { | ||
content=<pre>conky.config = { | |||
... | ... | ||
default_color = 'white', | |||
-- White defaul | |||
... | color color1 = '0ab1ff', | ||
};</pre> | -- Light blue | ||
... | |||
};</pre> | |||
}} | }} | ||
'''2.''' این Xft را فعال می کند، فونت پیشفرض را تنظیم می کند (LiberationMono)، آن را پررنگ میکند و اندازه آن را تنظیم میکند (8): | |||
{{File|file=~/.config/conky/conky.conkyrc| content=<pre>conky.config = { ... use_xft = true, font = 'LiberationMono:bold:size=8', ... };</pre> }} | |||
'''3.''' برای اینکه کانکی خود را روی صفحهنمایش قرار دهید، این تنظیمات را تغییر دهید: | |||
{{File|file=~/.config/conky/conky.conkyrc| content=<pre>conky.config = { ... alignment = 'top_right', -- Conky gets placed in the top right corner of your desktop gap_x 18, -- with a horizontal gap of 18 pixels (to your right screen edge) gap_y 20, -- and a vertical gap of 20 pixels (to your top screen edge). ...};</pre> }} | |||
'''4.''' در برخی موارد می توانید چندین مقدار برای یک تنظیم داشته باشید، آنها با کاما از هم جدا می شوند: | |||
{{File|file=~/.config/conky/conky.conkyrc| content=<pre>conky.config = { ... own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below', ... };</pre> }} | |||
از دستور <code>man conky</code> استفاده کنید و به بخش '''CONFIGURATION SETTINGS''' نگاه کنید تا همه تنظیمات موجود را ببینید. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
===Conky text=== | ===Conky text=== | ||
The second part contains the displayed conky code. Every code line corresponds to one displayed line on your desktop. There are a lot of available for displaying and modifying all kinds of information. Use the command: <code>man conky</code>, and look into the '''OBJECTS/VARIABLES''' section to see every objects/variables available. | The second part contains the displayed conky code. Every code line corresponds to one displayed line on your desktop. There are a lot of available for displaying and modifying all kinds of information. Use the command: <code>man conky</code>, and look into the '''OBJECTS/VARIABLES''' section to see every objects/variables available. | ||
{{BoxInfo|Info|The lines in the '''conky.text''' section is printed exactly as is. E.g. if you create an empty line between sections - conky will display an empty line.}} | {{BoxInfo|Info|The lines in the '''conky.text''' section is printed exactly as is. E.g. if you create an empty line between sections - conky will display an empty line.}} | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
The whole code belong between these two double bracket: | The whole code belong between these two double bracket: | ||
{{File|file=~/.config/conky/conky. | {{File|file=~/.config/conky/conky.conf| | ||
content=<pre>conky.text = [[ | content=<pre>conky.text = [[ | ||
]];</pre> | ]];</pre> | ||
Line 81: | Line 70: | ||
===Examples=== | ===Examples=== | ||
'''1.''' You can choose the color of your font using one of the following variables: | '''1.''' You can choose the color of your font using one of the following variables: | ||
{{File|file=~/.config/conky/conky. | {{File|file=~/.config/conky/conky.conf| | ||
content=<pre>conky.text = [[ | content=<pre>conky.text = [[ | ||
... | ... | ||
Line 89: | Line 78: | ||
]];</pre> | ]];</pre> | ||
}} | }} | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Every variable is marked with a <code>$</code> sign and by <code>{ }</code> brackets (only needed, if the variable contains more than one word). | Every variable is marked with a <code>$</code> sign and by <code>{ }</code> brackets (only needed, if the variable contains more than one word). | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''2.''' You can call the default font (and it's size) with this command: | '''2.''' You can call the default font (and it's size) with this command: | ||
{{File|file=~/.config/conky/conky. | {{File|file=~/.config/conky/conky.conf| | ||
content=<pre>conky.text = [[ | content=<pre>conky.text = [[ | ||
... | ... | ||
Line 100: | Line 93: | ||
]];</pre> | ]];</pre> | ||
}} | }} | ||
If you want a different font (DejaVuSerif) and font size (9) in your conky, use this command in your <code>. | If you want a different font (DejaVuSerif) and font size (9) in your conky, use this command in your <code>.conf</code> code: | ||
{{File|file=~/.config/conky/conky. | {{File|file=~/.config/conky/conky.conf| | ||
content=<pre>conky.text = [[ | content=<pre>conky.text = [[ | ||
... | ... | ||
Line 109: | Line 102: | ||
}} | }} | ||
'''3.''' This code line displays the text "Kernel: " and the kernel you are using (using <code>$alignr</code> just yields a nicer formatting, it is not necessary: <code>$alignr</code> aligns all following text on the right of your conky): | '''3.''' This code line displays the text "Kernel: " and the kernel you are using (using <code>$alignr</code> just yields a nicer formatting, it is not necessary: <code>$alignr</code> aligns all following text on the right of your conky): | ||
{{File|file=~/.config/conky/conky. | {{File|file=~/.config/conky/conky.conf| | ||
content=<pre>conky.text = [[ | content=<pre>conky.text = [[ | ||
Kernel: ${alignr}${kernel} | Kernel: ${alignr}${kernel} | ||
Line 115: | Line 108: | ||
}} | }} | ||
'''4.''' This variable gives you the latest 3 manjaro blog entry titles (using rss). It checks for updates every 60 minutes. | '''4.''' This variable gives you the latest 3 manjaro blog entry titles (using rss). It checks for updates every 60 minutes. | ||
{{File|file=~/.config/conky/conky. | {{File|file=~/.config/conky/conky.conf| | ||
content=<pre>conky.text = [[ | content=<pre>conky.text = [[ | ||
${rss http://manjaro.org/feed/ 60 item_titles 3} | ${rss http://manjaro.org/feed/ 60 item_titles 3} | ||
Line 121: | Line 114: | ||
}} | }} | ||
'''5.''' Information about the root partition <code>/</code> of your manjaro installation is displayed using | '''5.''' Information about the root partition <code>/</code> of your manjaro installation is displayed using | ||
{{File|file=~/.config/conky/conky. | {{File|file=~/.config/conky/conky.conf| | ||
content=<pre>conky.text = [[ | content=<pre>conky.text = [[ | ||
Root: ${alignr}${fs_used /} of ${fs_size /} | Root: ${alignr}${fs_used /} of ${fs_size /} | ||
Line 127: | Line 120: | ||
}} | }} | ||
'''6.''' Instead of example 3, you can use the following code to display the exact same information: | '''6.''' Instead of example 3, you can use the following code to display the exact same information: | ||
{{File|file=~/.config/conky/conky. | {{File|file=~/.config/conky/conky.conf| | ||
content=<pre>conky.text = [[ | content=<pre>conky.text = [[ | ||
Kernel: ${alignr}${execi 3600 uname -r} | Kernel: ${alignr}${execi 3600 uname -r} | ||
]];</pre> | ]];</pre> | ||
}} | }} | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
===execi=== | ===execi=== | ||
The variable <code>${execi 3600 XXXX}</code> runs the <code>XXXX</code> bash code in your terminal every 3600 seconds and displays the result in your conky. The result of the <code>uname -r</code> bash command is your currently used kernel name. | The variable <code>${execi 3600 XXXX}</code> runs the <code>XXXX</code> bash code in your terminal every 3600 seconds and displays the result in your conky. The result of the <code>uname -r</code> bash command is your currently used kernel name. | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Use any bash command instead of <code>XXXX</code> you can think of. The bash commands can be as long and complicated as you want. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
{{BoxInfo|Warning|Using complicated bash commands (e.g. which call other programs or use large files) with low intervals (e.g. <code>${execi 2 XXXX}</code> runs the <code>XXXX</code> code once every 2 seconds and displays it's result in your conky) can use a lot of hardware resources and/or make your computer unresponsive.}} | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
===Running conky=== | ===Running conky=== | ||
If you want to display a conky on your desktop a {{ic|~/.config/conky/conky. | If you want to display a conky on your desktop a {{ic|~/.config/conky/conky.conf}} file with code in it is required. Next, open a terminal and run conky pointing to the file | ||
{{UserCmd|command=conky -c ~/.config/conky/conky. | {{UserCmd|command=conky -c ~/.config/conky/conky.conf}} | ||
or to run as background daemon | or to run as background daemon | ||
{{UserCmd|command=conky -d -c ~/.config/conky/conky. | {{UserCmd|command=conky -d -c ~/.config/conky/conky.conf}} | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you want to run conky automatically after each boot of your computer, you need to find out how to autostart a program. This depends on the Desktop Manager you are using. The next is examples of how to run conky from your system autostart folder/file/script/command. | If you want to run conky automatically after each boot of your computer, you need to find out how to autostart a program. This depends on the Desktop Manager you are using. The next is examples of how to run conky from your system autostart folder/file/script/command. | ||
<code>sleep 20</code> and <code>-p 20</code> delay the start of conky by 20 seconds after your Desktop Environment has started. Adjust this value to your liking. | <code>sleep 20</code> and <code>-p 20</code> delay the start of conky by 20 seconds after your Desktop Environment has started. Adjust this value to your liking. | ||
</div> | |||
{{UserCmd|command=conky -c ~/.config/conky/conky. | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
{{UserCmd|command=sleep 20 && conky -c ~/.config/conky/conky. | {{UserCmd|command=conky -c ~/.config/conky/conky.conf &}} | ||
{{UserCmd|command=sleep 20 && conky -c ~/.config/conky/conky.conf &}} | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
When you change the running conky configuration file - conky will reload. But if you changed one of your dependency scripts (e.g. because you changed a variable and want to see the consequences) you will have to reload conky | When you change the running conky configuration file - conky will reload. But if you changed one of your dependency scripts (e.g. because you changed a variable and want to see the consequences) you will have to reload conky | ||
{{UserCmd|command=killall conky && conky -c ~/.config/config/conky. | {{UserCmd|command=killall conky && conky -c ~/.config/config/conky.conf}} | ||
</div> | |||
=== | ===اشکالزدایی و نکتهها=== | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
====Missing rings==== | ====Missing rings==== | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
To be able to use LUA scripts to execute drawing functions like clock rings - you will a conky package compiled with LUA support. Either build the package the package {{ic|conky-lua}} from [[Arch_User_Repository|AUR]] or install the {{ic|conky-lua-nv}} from the official repo. | To be able to use LUA scripts to execute drawing functions like clock rings - you will a conky package compiled with LUA support. Either build the package the package {{ic|conky-lua}} from [[Arch_User_Repository|AUR]] or install the {{ic|conky-lua-nv}} from the official repo. | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
====Missing network information==== | ====Missing network information==== | ||
If network information is missing like download speed or network name (SSID), you need to replace the network interfaces in the configuration file with your network interface name. To get the names of your interfaces - open a terminal and execute | If network information is missing like download speed or network name (SSID), you need to replace the network interfaces in the configuration file with your network interface name. To get the names of your interfaces - open a terminal and execute | ||
{{UserCmd|command=ip a | grep ' state UP' | cut -d' ' -f2 | cut -d':' -f1}} | {{UserCmd|command=ip a | grep ' state UP' | cut -d' ' -f2 | cut -d':' -f1}} | ||
Use the output from the command. Interface names starting with <code>en</code> is ethernet interface and names starting with <code>wl</code> is wireless interfaces. Replace all network interfaces names with (e.g. <code>wlan0</code>, <code>eth0</code>) in your <code>. | Use the output from the command. Interface names starting with <code>en</code> is ethernet interface and names starting with <code>wl</code> is wireless interfaces. Replace all network interfaces names with (e.g. <code>wlan0</code>, <code>eth0</code>) in your <code>.conf</code> text section with the interface name(s) you retrieved from the above command. | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
===Conky Manager=== | ===Conky Manager=== | ||
An application named Conky manager exist but has not been updated for years and the configurations found in the package may work or they may not. You may install it - it can be a used as an inspiration but you should not rely on it. If you still think you it is a must have - you can build the package {{ic|conky-manager}} using [[Arch_User_Repository|AUR]] | An application named Conky manager exist but has not been updated for years and the configurations found in the package may work or they may not. You may install it - it can be a used as an inspiration but you should not rely on it. If you still think you it is a must have - you can build the package {{ic|conky-manager}} using [[Arch_User_Repository|AUR]] | ||
{{UserCmd|command=pamac build conky-manager}} | {{UserCmd|command=pamac build conky-manager}} | ||
</div> | |||
== | ==جستارهای وابسته== | ||
* | * [https://github.com/brndnmtthws/conky/wiki تارنمای کانکی] | ||
* | * صفحهٔ کانکی در [https://wiki.archlinux.org/index.php/conky ویکی آرچ] | ||
[[Category:Contents Page{{#translation:}}]] | [[Category:Contents Page{{#translation:}}]] | ||
[[Category:Applications{{#translation:}}]] | [[Category:Applications{{#translation:}}]] |
Latest revision as of 08:01, 5 July 2023
نصب و راهاندازی
کانکی را می توان با استفاده از مدیربسته نصب کرد:
پیکربندی
همهی فایل هایی که نامشان با نقطه .
شروع میشوند، فایلهای مخفی هستند. اگر می خواهید فایلهای مخفی را در مدیر پرونده خود مشاهده کنید، باید آنها را قابل مشاهده کنید. در اکثر مدیر پروندهها این در گزینه ها موجود خواهد بود.
پروندههای پیکربندی
فایل تنظیمات پیش فرض در این مکان قرار دارد
/usr/share/doc/conky-1.11.5_pre/conky.conf
کانکی به راحتی قابل تغییر است.
کانکی یک پوشه کانکی محلی ایجاد نمی کند، بنابراین باید خودتان یکی ایجاد کنید
سپس پرونده پیشفرض را در home/ کپی کنید
فایل پیکربندی یک فایل متنی ساده است که محتوای آن با استفاده از لوآ نوشته شده است و به دو بخش تقسیم می شود.
- پیکربندی
- متن
پیکربندی کانکی
قسمت اول/بالا شامل تمام تنظیمات پیکربندی برای کل کانکی است. مواردی مانند موقعیت کانکی روی صفحه، تنظیمات شفافیت، تنظیمات حاشیه، فونت پیشفرض و اندازه آن، و تعداد دفعات بهروزرسانی مخزن شما. کل پیکربندی بین براکت هایی مانند این تعلق دارد
conky.config = { };
برخی از قوانین باید رعایت شوند :
- هر خط با
,
پایان مییابد - مقدار غیرعددی باید بین
'
قرار گیرد - نظر، یا کامنت، با
--
شروع میشود
1. با این کار رنگ فونت پیشفرض کانکی شما روی سفید تنظیم میشود. علاوه بر این، یک color1
با استفاده از یک کد رنگ Html روی آبی روشن تنظیم می شود:
conky.config = { ... default_color = 'white', -- White defaul color color1 = '0ab1ff', -- Light blue ... };
2. این Xft را فعال می کند، فونت پیشفرض را تنظیم می کند (LiberationMono)، آن را پررنگ میکند و اندازه آن را تنظیم میکند (8):
conky.config = { ... use_xft = true, font = 'LiberationMono:bold:size=8', ... };
3. برای اینکه کانکی خود را روی صفحهنمایش قرار دهید، این تنظیمات را تغییر دهید:
conky.config = { ... alignment = 'top_right', -- Conky gets placed in the top right corner of your desktop gap_x 18, -- with a horizontal gap of 18 pixels (to your right screen edge) gap_y 20, -- and a vertical gap of 20 pixels (to your top screen edge). ...};
4. در برخی موارد می توانید چندین مقدار برای یک تنظیم داشته باشید، آنها با کاما از هم جدا می شوند:
conky.config = { ... own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below', ... };
از دستور man conky
استفاده کنید و به بخش CONFIGURATION SETTINGS نگاه کنید تا همه تنظیمات موجود را ببینید.
Conky text
The second part contains the displayed conky code. Every code line corresponds to one displayed line on your desktop. There are a lot of available for displaying and modifying all kinds of information. Use the command: man conky
, and look into the OBJECTS/VARIABLES section to see every objects/variables available.
The whole code belong between these two double bracket:
conky.text = [[ ]];
Examples
1. You can choose the color of your font using one of the following variables:
conky.text = [[ ... ${color} ${color1} ... ]];
Every variable is marked with a $
sign and by { }
brackets (only needed, if the variable contains more than one word).
2. You can call the default font (and it's size) with this command:
conky.text = [[ ... $font ... ]];
If you want a different font (DejaVuSerif) and font size (9) in your conky, use this command in your .conf
code:
conky.text = [[ ... ${font DejaVuSerif:size=9} ... ]];
3. This code line displays the text "Kernel: " and the kernel you are using (using $alignr
just yields a nicer formatting, it is not necessary: $alignr
aligns all following text on the right of your conky):
conky.text = [[ Kernel: ${alignr}${kernel} ]];
4. This variable gives you the latest 3 manjaro blog entry titles (using rss). It checks for updates every 60 minutes.
conky.text = [[ ${rss http://manjaro.org/feed/ 60 item_titles 3} ]];
5. Information about the root partition /
of your manjaro installation is displayed using
conky.text = [[ Root: ${alignr}${fs_used /} of ${fs_size /} ]];
6. Instead of example 3, you can use the following code to display the exact same information:
conky.text = [[ Kernel: ${alignr}${execi 3600 uname -r} ]];
execi
The variable ${execi 3600 XXXX}
runs the XXXX
bash code in your terminal every 3600 seconds and displays the result in your conky. The result of the uname -r
bash command is your currently used kernel name.
Use any bash command instead of XXXX
you can think of. The bash commands can be as long and complicated as you want.
Running conky
If you want to display a conky on your desktop a ~/.config/conky/conky.conf
file with code in it is required. Next, open a terminal and run conky pointing to the file
or to run as background daemon
If you want to run conky automatically after each boot of your computer, you need to find out how to autostart a program. This depends on the Desktop Manager you are using. The next is examples of how to run conky from your system autostart folder/file/script/command.
sleep 20
and -p 20
delay the start of conky by 20 seconds after your Desktop Environment has started. Adjust this value to your liking.
When you change the running conky configuration file - conky will reload. But if you changed one of your dependency scripts (e.g. because you changed a variable and want to see the consequences) you will have to reload conky
اشکالزدایی و نکتهها
Missing rings
To be able to use LUA scripts to execute drawing functions like clock rings - you will a conky package compiled with LUA support. Either build the package the package conky-lua
from AUR or install the conky-lua-nv
from the official repo.
Missing network information
If network information is missing like download speed or network name (SSID), you need to replace the network interfaces in the configuration file with your network interface name. To get the names of your interfaces - open a terminal and execute
Use the output from the command. Interface names starting with en
is ethernet interface and names starting with wl
is wireless interfaces. Replace all network interfaces names with (e.g. wlan0
, eth0
) in your .conf
text section with the interface name(s) you retrieved from the above command.
Conky Manager
An application named Conky manager exist but has not been updated for years and the configurations found in the package may work or they may not. You may install it - it can be a used as an inspiration but you should not rely on it. If you still think you it is a must have - you can build the package conky-manager
using AUR
جستارهای وابسته
- تارنمای کانکی
- صفحهٔ کانکی در ویکی آرچ