{"id":9112,"date":"2005-06-19T11:17:24","date_gmt":"2005-06-19T08:17:24","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=9112"},"modified":"2005-10-03T09:01:30","modified_gmt":"2005-10-03T06:01:30","slug":"watching-over-logs-in-kde","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2005\/06\/19\/watching-over-logs-in-kde\/","title":{"rendered":"Watching over logs in KDE"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>I know of a lot of people who enjoy having a terminal window with scrolling logs on their desktop.  Setting one up was never a challange, but there are some nice KDE options that one could use that not so many people know about.  At least I didn&#8217;t know until today.<\/p>\n<p><!--more--><\/p>\n<p>First of all, the simpliest way you could have it is <code>konsole -e tail -f <em>some_log_file<\/em><\/code>.  Substitute <code><em>some_log_file<\/em><\/code> with your choice of log file.  If you are out of ideas, <code>\/var\/log\/messages<\/code> or <code>\/var\/log\/httpd\/access.log<\/code> might be a good start.<\/p>\n<p>The problem that you might have discovered just now is that you&#8217;re running KDE as a regular user, while most of log files require root priviledges.  At least all the interesting ones.  Not to worry &#8211; <code>sudo<\/code> will save the day.  As root edit <code>\/etc\/sudoers<\/code> and add the following line:<\/p>\n<pre>someuser  ALL=(ALL) NOPASSWD: ALL<\/pre>\n<p>Change <code>someuser<\/code> to your username.  From now on, you can do whatever root can do by prepending <code>sudo <\/code> to your command.  For example: <code>sudo tail -f \/var\/log\/messages<\/code>.  Nice, eh?<\/p>\n<p>Back to that <code>konsole<\/code> window of yours.  Simple watching of logs in it can now be done with <code>konsole -e sudo tail -f <em>some_log_file<\/em><\/code>.<\/p>\n<p>Good.  What else?<\/p>\n<p>By default, <code>konsole<\/code> window has a lot of attributes that are otherwise useful, but not when scrolling logs in it.  I am talking about menubar, statusbar, scrollbar, history, and things like that.  You can switch them all off.  Take a look at the output of <code>konsole --help<\/code>.  It suggests a number of options.  Here is my first selection:<\/p>\n<pre>konsole --nohist --nomenubar --noframe \\\r\n--noscrollbar -e sudo tail -f <em>some_log_file<\/em><\/pre>\n<p>It looks better now, but not perfect.  More options are available with profiles.  Right-click in <code>konsole<\/code> window and choose <code>Settings<\/code> menu.  Change everything else to suit your needs.  For example, make font smaller and configure proper encoding.  Now select the <code>Settings<\/code> &#038;raquo <code>Save Sessions Profile<\/code> menu.  You&#8217;ll be asked for a name of the profile.  Name it &#8220;Logs&#8221; or something meaningful.<\/p>\n<p>Here is the full <code>konsole<\/code> command line that I use.  Except for the <code><em>some_log_file<\/em><\/code>, of course.<\/p>\n<pre>konsole --vt_sz 120x3 --profile Logs \\\r\n--nohist --nomenubar --noframe --noscrollbar \\\r\n--schema Transparent.schema \\\r\n-e sudo tail -f <em>some_log_file<\/em><\/pre>\n<p>You can see that I specify the profile to use, the schema that I want and terminal window size (columns by rows), as well as use all arguments discussed previously.<\/p>\n<p>Now my terminal window looks even better, but there is still room for improvement.  What else can be done?  A bit.  I want to get rid of the window title bar as I don&#8217;t need at all.  And I want to have my logs terminal on all desktops.<\/p>\n<p>KDE has an excellent utility which one could use to control window&#8217;s properties from the command line (as opposite from activating Window menu by pressing <code>Alt+F3<\/code>).  It&#8217;s called <code>kstart<\/code>.  You can have a look at its options by executing <code>kstart --help<\/code>.<\/p>\n<p>Here is how the whole thing looks like:<\/p>\n<pre>kstart --alldesktops --type Override \\\r\nkonsole --vt_sz 120x3 --profile Logs --nohist \\\r\n--nomenubar --noframe --noscrollbar \\\r\n--schema Transparent.schema \\\r\n-e sudo tail -f <em>some_log_file<\/em><\/pre>\n<p><code>kstart<\/code> starts on all desktops with the window that has no titlebar (type: Override) in which it runs <code>konsole<\/code>.  <code>konsole<\/code> in turn resizes the window to 120 columns by 3 rows, switches off menus, scrollbars, frames, etc.  Than it makes the window transparent, decreases the font size and executes the <code>sudo<\/code>.  <code>sudo<\/code> adjusts the access level of the current user and makes it possible for <code>tail -f <em>some_log_file<\/em><\/code> to work.<\/p>\n<p>Presto!<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>I know of a lot of people who enjoy having a terminal window with scrolling logs on their desktop. Setting one up was never a challange, but there are some nice KDE options that one could use that not so many people know about. At least I didn&#8217;t know until today.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18],"tags":[1960,65,66,74],"keyring_services":[],"class_list":["post-9112","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","tag-command-line","tag-desktop","tag-kde","tag-tips"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":26297,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/07\/28\/exporting-messages-from-gmail-with-fetchmail-and-procmail\/","url_meta":{"origin":9112,"position":0},"title":"Exporting messages from Gmail with fetchmail and procmail","author":"Leonid Mamchenkov","date":"July 28, 2016","format":false,"excerpt":"One of the projects that I am involved in has a requirement of importing all the historical emails from a number of Gmail accounts into another system. \u00a0It's not the most challenging of tasks, but since I spent a bit of time on it, I figured I should blog it\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11309,"url":"https:\/\/mamchenkov.net\/wordpress\/2008\/06\/24\/there-is-hope-for-kde-4\/","url_meta":{"origin":9112,"position":1},"title":"There is hope for KDE 4","author":"Leonid Mamchenkov","date":"June 24, 2008","format":false,"excerpt":"Here is the story about openSUSE 11 with KDE 4.0.4 in KDE.news.\u00a0 Do you want to know what I thought was so special about it?\u00a0 I'll tell you.\u00a0 It features screenshots of the KDE desktop with some icons.\u00a0 Yes, this is the first bunch of KDE 4 screenshots with desktop\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2008\/06\/kde4-desktop-300x240.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":9017,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/05\/28\/how-to-switch-the-go-around-desktops-thingy-in-kde\/","url_meta":{"origin":9112,"position":2},"title":"How to switch the go-around-desktops thingy in KDE","author":"Leonid Mamchenkov","date":"May 28, 2005","format":false,"excerpt":"KDE is an excellent desktop with reasonable defaults. One of the defaults does not work for me though. It annoys me beyond limits that switching desktops wraps around. That is when I am at the left-most desktop and I press Ctrl+Left arrow, which is my key for switching one dekstop\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11513,"url":"https:\/\/mamchenkov.net\/wordpress\/2009\/02\/20\/another-look-at-kde-4\/","url_meta":{"origin":9112,"position":3},"title":"Another look at KDE 4","author":"Leonid Mamchenkov","date":"February 20, 2009","format":false,"excerpt":"Last time I wrote about KDE 4, I said that it wasn't very usable for me.\u00a0 Recenlty, the much praised upgrade to KDE 4.2 became available via Fedora updates.\u00a0 So I got it and switched to KDE for a couple of days. What can I say?\u00a0 Quite an improvement indeed.\u00a0\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7597,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/06\/22\/excellent-article-about-kde-at-slashdot\/","url_meta":{"origin":9112,"position":4},"title":"Excellent article about KDE at Slashdot","author":"Leonid Mamchenkov","date":"June 22, 2004","format":false,"excerpt":"Slashdot is running a post with a link to an excellent article about KDE. Be careful though - if you have a fresh version of KDE installed, this article might result in you playing with your desktop for the rest of the working day. :)","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8862,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/04\/22\/kde-pager-progress\/","url_meta":{"origin":9112,"position":5},"title":"KDE pager progress","author":"Leonid Mamchenkov","date":"April 22, 2005","format":false,"excerpt":"KDE pager is one of the biggest annoyances for people coming to KDE from AfterStep world. But the good news are here: the pager has gained drag and drop, so you can move windows between desktops using it. in fact, you can drag from the taskbar to the pager as\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/9112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=9112"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/9112\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=9112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=9112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=9112"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=9112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}