{"id":2066,"date":"2018-08-28T23:30:36","date_gmt":"2018-08-28T14:30:36","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=2066"},"modified":"2018-08-28T23:30:36","modified_gmt":"2018-08-28T14:30:36","slug":"awesome-specify-the-home-directory-within-the-wm-settings","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2018\/08\/28\/awesome-specify-the-home-directory-within-the-wm-settings\/","title":{"rendered":"awesome WM \u306e\u8a2d\u5b9a\u5185\u3067 \u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3059\u308b"},"content":{"rendered":"<div id=\"__asciidoctor-preview-1__\" class=\"paragraph\">\n<p>awesome WM \u3067\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f Lua \u3067\u66f8\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3059\u304c\uff0cLua \u304c\u3088\u304f\u308f\u304b\u3089\u305a\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\u306e\u306b <code style=\"font-family: Menlo, Consolas, &quot;DejaVu Sans Mono&quot;, monospace;\">~`\u3084 `${HOME}<\/code> \u304c\u5229\u7528\u3067\u304d\u306a\u3044\u306e\u3067 <code style=\"font-family: Menlo, Consolas, &quot;DejaVu Sans Mono&quot;, monospace;\">\/home\/USER<\/code> \u306a\u611f\u3058\u3067\u30d5\u30eb\u30d1\u30b9\u3067\u66f8\u3044\u3066\u3044\u305f\u306e\u3067\u3059\u304c\uff0c\u3044\u3064\u3082\u3068\u9055\u3046\u30a2\u30ab\u30a6\u30f3\u30c8\u540d\u306e\u74b0\u5883\u306b clone \u3057\u3066\u3044\u308d\u3044\u308d\u3068\u52d5\u304b\u306a\u304f\u306a\u308a\u307e\u3057\u305f\uff0e<br \/>\n\u307e\u305f\u30d1\u30b9\u3092\u66f8\u304d\u63db\u3048\u308b\u306e\u3082\u306a\u30fc\u3068\u3044\u3046\u3053\u3068\u3067\u3061\u3083\u3093\u3068\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\uff0c<code style=\"font-family: Menlo, Consolas, &quot;DejaVu Sans Mono&quot;, monospace;\">os.getenv(HOME)<\/code> \u304c\u4f7f\u3048\u305d\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-2__\" class=\"quoteblock\">\n<div class=\"title\"><a href=\"https:\/\/www.lua.org\/manual\/5.3\/manual.html#pdf-os.getenv\">Lua 5.3 Reference Manual<\/a><\/div>\n<blockquote>\n<div id=\"__asciidoctor-preview-3__\" class=\"literalblock\">\n<div class=\"content\">\n<pre>os.getenv (varname)\r\nReturns the value of the process environment variable varname, or nil if the variable is not defined.<\/pre>\n<\/div>\n<\/div>\n<\/blockquote>\n<\/div>\n<div id=\"__asciidoctor-preview-4__\" class=\"paragraph\">\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\uff0c\u3053\u3093\u306a\u611f\u3058\u3067\u5225\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u3082\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f :)<br \/>\n\u3053\u308c\u3067 <code style=\"font-family: Menlo, Consolas, &quot;DejaVu Sans Mono&quot;, monospace;\">\/home\/*<\/code> \u3060\u308d\u3046\u304c <code style=\"font-family: Menlo, Consolas, &quot;DejaVu Sans Mono&quot;, monospace;\">\/export\/home\/*<\/code> \u3060\u308d\u3046\u304c\u3078\u3063\u3061\u3083\u3089\u3067\u3059!<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-5__\" class=\"listingblock lua\">\n<div class=\"title\">rc.lua<\/div>\n<div class=\"content\">\n<pre class=\"\"><code style=\"font-family: Menlo, Consolas, &quot;DejaVu Sans Mono&quot;, monospace;\">diff --git a\/rc.lua b\/rc.lua\r\nindex 817937a..a564559 100644\r\n--- a\/rc.lua\r\n+++ b\/rc.lua\r\n@@ -11,6 +11,8 @@ local naughty = require(\"naughty\")\r\n local menubar = require(\"menubar\")\r\n local hotkeys_popup = require(\"awful.hotkeys_popup\").widget\r\n\r\n+local home = os.getenv(\"HOME\")\r\n+\r\n -- Load Debian menu entries\r\n require(\"debian.menu\")\r\n\r\n@@ -276,14 +278,14 @@ globalkeys = awful.util.table.join(\r\n\r\n     -- bind PrintScrn to capture a screen\r\n-    awful.key({                   }, \"Print\", function () awful.util.spawn(\"\/home\/mk\/.config\/awesome\/bin\/ss-root.sh\", false)   end),\r\n-    awful.key({ \"Mod1\"            }, \"Print\", function () awful.util.spawn(\"\/home\/mk\/.config\/awesome\/bin\/ss-window.sh\", false) end),\r\n-    awful.key({ \"Shift\"           }, \"Print\", function () awful.util.spawn(\"\/home\/mk\/.config\/awesome\/bin\/ss-area.sh\", false)   end),\r\n+    awful.key({                   }, \"Print\", function () awful.util.spawn(home .. \"\/.config\/awesome\/bin\/ss-root.sh\", false)   end),\r\n+    awful.key({ \"Mod1\"            }, \"Print\", function () awful.util.spawn(home .. \"\/.config\/awesome\/bin\/ss-window.sh\", false) end),\r\n+    awful.key({ \"Shift\"           }, \"Print\", function () awful.util.spawn(home .. \"\/.config\/awesome\/bin\/ss-area.sh\", false)   end),\r\n\r\n     -- Audio Controle<\/code><\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-1__\" class=\"listingblock bash\">\n<div class=\"title\">\u74b0\u5883<\/div>\n<div class=\"content\">\n<pre class=\"\"><code style=\"font-family: Menlo, Consolas, &quot;DejaVu Sans Mono&quot;, monospace;\">$ dpkg-query -W awesome*\r\nawesome 4.2-5\r\nawesome-doc     4.2-5\r\nawesome-extra   2018041201\r\n$ lsb_release -d\r\nDescription:    Debian GNU\/Linux unstable (sid)\r\n$ uname -m\r\nx86_64<\/code><\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>awesome WM \u3067\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f Lua \u3067\u66f8\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3059\u304c\uff0cLua \u304c\u3088\u304f\u308f\u304b\u3089\u305a\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\u306e\u306b ~`\u3084 `${HOME} \u304c\u5229\u7528\u3067\u304d\u306a\u3044\u306e\u3067 \/home\/USER \u306a\u611f\u3058\u3067\u30d5 [&hellip;]<\/p>\n","protected":false},"author":1,"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,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,199],"tags":[78],"class_list":["post-2066","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-sid","tag-awesome"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=2066"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2066\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=2066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=2066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=2066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}