{"id":5035,"date":"2017-09-20T21:14:38","date_gmt":"2017-09-20T21:14:38","guid":{"rendered":"https:\/\/really.zonky.org\/?p=5035"},"modified":"2017-09-20T21:14:38","modified_gmt":"2017-09-20T21:14:38","slug":"awesome-a-better-way-of-setting-up-tags","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=5035","title":{"rendered":"Awesome: A &#8220;Better&#8221; Way Of Setting Up Tags"},"content":{"rendered":"<p>By default, the Awesome window manager sets up 9 tags and uses a rather clever method for setting keyboard shortcuts for those tags.<\/p>\n<p>And that is also one of the irritations of using Awesome because I have gotten into the habit of using more virtual screens (&#8220;tags&#8221;) than this. After a dumb way of increasing the number, I have come up with a rather improved method that can be used to replace the existing method in the Awesome\u00a0<em>rc.lua<\/em> file :-<\/p>\n<pre>local taglist = { \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\", \"-\", \"=\" }\r\n-- The list of tags that I use.\r\n\u2026\r\n awful.tag( taglist, s, awful.layout.layouts[1])\r\n\u2026\r\nfor i = 1, #taglist do\r\n  globalkeys = awful.util.table.join(globalkeys,\r\n    awful.key({ modkey}, taglist[i],\r\n                  function ()\r\n                        local screen = awful.screen.focused()\r\n                        local tag = screen.tags[i]\r\n                        if tag then\r\n                           tag:view_only()\r\n                        end\r\n                  end,\r\n                  {description = \"view tag\", group = \"tag\"}),\r\n        awful.key({ modkey, \"Control\" }, taglist[i],\r\n                  function ()\r\n                      local screen = awful.screen.focused()\r\n                      local tag = screen.tags[i]\r\n                      if tag then\r\n                         awful.tag.viewtoggle(tag)\r\n                      end\r\n                  end,\r\n                  {description = \"toggle tag\", group = \"tag\"}),\r\n        awful.key({ modkey, \"Shift\" }, taglist[i],\r\n                  function ()\r\n                      if client.focus then\r\n                          local tag = client.focus.screen.tags[i]\r\n                          if tag then\r\n                              client.focus:move_to_tag(tag)\r\n                          end\r\n                     end\r\n                  end,\r\n                  {description = \"move focused client to tag\", group = \"tag\"}),\r\n        awful.key({ modkey, \"Control\", \"Shift\" }, taglist[i],\r\n                  function ()\r\n                      if client.focus then\r\n                          local tag = client.focus.screen.tags[i]\r\n                          if tag then\r\n                              client.focus:toggle_tag(tag)\r\n                          end\r\n                      end\r\n                  end,\r\n                  {description = \"toggle focused client on tag\", group = \"tag\"})\r\n    )\r\nend\r\n<\/pre>\n<p>\nThat&#8217;s three different parts of the code to change &#8211; a list of tags to use at the top of the file, a replacement somewhere in the middle, and a large chunk replacing existing code at the end of the keyboard configuration. I don&#8217;t claim this is better than the standard way, but it is handy for me.<\/p>\n<div id=\"attachment_5018\" style=\"width: 705px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5018\" class=\"size-large wp-image-5018\" src=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2015-12-03-The-Window.jpg?resize=695%2C463&#038;ssl=1\" alt=\"\" width=\"695\" height=\"463\" srcset=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2015-12-03-The-Window.jpg?resize=1024%2C682&amp;ssl=1 1024w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2015-12-03-The-Window.jpg?resize=300%2C200&amp;ssl=1 300w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2015-12-03-The-Window.jpg?resize=768%2C512&amp;ssl=1 768w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2015-12-03-The-Window.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><p id=\"caption-attachment-5018\" class=\"wp-caption-text\">The Window<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>By default, the Awesome window manager sets up 9 tags and uses a rather clever method for setting keyboard shortcuts for those tags. And that is also one of the irritations of using Awesome because I have gotten into the habit of using more virtual screens (&#8220;tags&#8221;) than this. After a dumb way of increasing <a href='https:\/\/really.zonky.org\/?p=5035' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_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},"_share_on_mastodon":"0"},"categories":[4,209,226],"tags":[1048,725],"class_list":["post-5035","post","type-post","status-publish","format-standard","hentry","category-it","category-linux-it","category-working-notes","tag-awesome","tag-window-manager","category-4-id","category-209-id","category-226-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-1jd","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/5035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5035"}],"version-history":[{"count":2,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/5035\/revisions"}],"predecessor-version":[{"id":5037,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/5035\/revisions\/5037"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}