{"action":"closed","issue":{"url":"https://api.github.com/repos/microcai/gentoo-zh/issues/346","repository_url":"https://api.github.com/repos/microcai/gentoo-zh","labels_url":"https://api.github.com/repos/microcai/gentoo-zh/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/microcai/gentoo-zh/issues/346/comments","events_url":"https://api.github.com/repos/microcai/gentoo-zh/issues/346/events","html_url":"https://github.com/microcai/gentoo-zh/issues/346","id":119331892,"number":346,"title":"app-laptop/asus-keyboard-backlight  add systemD ","user":{"login":"necrose99","id":2396239,"avatar_url":"https://avatars.githubusercontent.com/u/2396239?v=3","gravatar_id":"","url":"https://api.github.com/users/necrose99","html_url":"https://github.com/necrose99","followers_url":"https://api.github.com/users/necrose99/followers","following_url":"https://api.github.com/users/necrose99/following{/other_user}","gists_url":"https://api.github.com/users/necrose99/gists{/gist_id}","starred_url":"https://api.github.com/users/necrose99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/necrose99/subscriptions","organizations_url":"https://api.github.com/users/necrose99/orgs","repos_url":"https://api.github.com/users/necrose99/repos","events_url":"https://api.github.com/users/necrose99/events{/privacy}","received_events_url":"https://api.github.com/users/necrose99/received_events","type":"User","site_admin":false},"labels":[{"id":181772716,"url":"https://api.github.com/repos/microcai/gentoo-zh/labels/Question","name":"Question","color":"207de5","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-11-29T02:43:10Z","updated_at":"2016-12-04T09:44:13Z","closed_at":"2016-12-04T09:44:13Z","body":"https://github.com/necrose99/necromancy-overlay/blob/master/app-laptop/asus-keyboard-backlight/asus-keyboard-backlight-0.1.ebuild\nthis is my lame attempt at a SystemD supportive ebuild , could be re-factored for Google upstart etc or any other init system that is not openrc, or sysvinit.\nSo far only thing working about it is frustration.\nSo I am Giving what I have. Hopefully With collaboration , I can achieve the desired outcome. \nASUS Republic of Gamers G73SW.  My own laptop. \nSabayon Linux (Gentoo Variant) \ninstead of directly installing to previous ebuild locations ..\nhttps://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=asus-kbd-backlight\nI took a clue from Arch Linux...\n/usr/bin/.... however added symbolic links to old directories.\nthus any other init system is more readily added. \nA: Symbolically linked B: similar to SystemD called executable from service/configuration file more  \neasily. \nAs well if user needs to /usr/bin a tad easier to execute manually. \nchanged header to match git EAPI 5 style as cvs header$ is dead. \n\nNote:Google Translator was used, other than please or  thanks, or a few trial pleasantries I don't speak enough Mandarin/Cantonese  to matter,  Japanese or Spanish,etc I am more useful.\n這是我的跛腳企圖在SystemD支持的ebuild，可以重新分解為谷歌新貴等或任何其他的初始化系統未OpenRC誕生了，或者sysvinit的。\n到目前為止，唯一的工作大約是無奈。\n所以，我給我有什麼。希望通過合作，我可以達到理想的效果。\n遊戲玩家G73SW華碩共和國。我自己的筆記本電腦。\n芭雍Linux的（Gentoo的變體）\n而不是直接安​​裝到以前的ebuild位置..\nhttps://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=asus-kbd-backlight\n我從Arch Linux的一個線索...\n在/ usr /斌/ ....但是添加符號鏈接到舊目錄。\n因此，任何其他的初始化系統更容易增加。\n答：象徵鏈接B：類似SystemD稱為從服務/配置文件可執行更​​多\n容易。\n至於如果用戶需要以及到/ usr / bin中稍微容易手動執行。\n改變的報頭相匹配的git EAPI 5風格CVS頭$已經死了。\n\n注：谷歌翻譯用，不是取悅或感謝，或幾個試驗寒暄我不會說普通話不夠/廣東話啦，日語或西班牙語等，等我更有用。\n\n```\n\n# Copyright 1999-2015 Gentoo Foundation\n# Distributed under the terms of the GNU General Public License v2\n# $Id$\n\nEAPI=5\n\nDESCRIPTION=\"Configure the brightness of the keyboard's backlight on ASUS\nlaptops.\"\nHOMEPAGE=\"http://projects.flogisoft.com/asus-keyboard-backlight/\"\nSRC_URI=\"http://projects.flogisoft.com/${PN}/download/${PN}_${PV}_src.tar.gz\nhttps://launchpad.net/${PN}/trunk/0.1/+download/${PN}_${PV}_0.1_src.tar.gz\"\n\nLICENSE=\"GPL-2\"\nSLOT=\"0\"\nKEYWORDS=\"~*\"\nIUSE=\"-sys-apps/systemd\"\n\nRDEPEND=\"${DEPEND}\n    dev-lang/python\n    sys-power/acpid\n    systemd? ( sys-apps/systemd )\"\n\nS=\"${WORKDIR}/asus-kbd-backlight-${PV}\"\n# write for systemD or other init Support , changed to bin path & Add Symlinks if using openrc,etc. better to be init neutral. \nsrc_install(){\n    #Install\n    #$1 : the output path, if different of /\n    #ACPI events\n    dodir /etc/acpi/events/\n    cp -v ./events/* \"$D\"/etc/acpi/events/\n    #ACPI script\n    cp -v ./code/asus-kbd-backlight.py \"$D\"/usr/bin/asus-kbd-backlight.py\n    dosym /usr/bin/asus-kbd-backlight.py \"$D\"/etc/acpi/asus-kbd-backlight.py\n    chmod 755 \"$D\"/usr/bin/asus-kbd-backlight.py\n    #Resume script\n    dodir /etc/pm/sleep.d/\n    cp -v ./code/asus-kbd-backlight_resume.sh \"$D\"/usr/bin/asus-kbd-backlight_resume\n    dosym /usr/bin/asus-kbd-backlight_resume /etc/pm/sleep.d/80_asus-kbd-backlight\n    chmod 755 \"$D\"/usr/bin/asus-kbd-backlight_resume\n    #Init script\n    dodir   /etc/init.d/\n    cp -v ./code/asus-kbd-backlight_init.sh  \"$D\"/usr/bin/asus-kbd-backlight\n    dosym /usr/bin/asus-kbd-backlight /etc/init.d/asus-kbd-backlight\n    chmod 755 \"$D\"/usr/bin/asus-kbd-backlight\n\n    #Bak\n    dodir /var/lib/asus-kbd-backlight/\n    echo 1 > \"$D\"/var/lib/asus-kbd-backlight/brightness\n}\n## ADD In Systemd Gentoo Devs Say its better to Install them all.\n# write for systemD use= if not using SystemD or going to Migrate to it no point in adding extra crap if user dont want it.\npkg_service() {\n    if USE=\"systemd?\"\ninherit systemd\n        # write the systemd unit file\n        cat <<-'EOF' > /usr/lib/systemd/system/asus-kbd-backlight.service\n        [Unit]\n        Description=Allow user access to keyboard backlight\n        After=systemd-udevd.service\n\n        [Service]\n        ExecStart=/usr/bin/asus-kbd-backlight allowusers\n\n        [Install]\n        WantedBy=multi-user.target \n        EOF\n\ndosym   /usr/lib/systemd/system/asus-kbd-backlight.service /etc/systemd/system/asus-kbd-backlight.service\nsystemd_enable_service /usr/lib/systemd/system/asus-kbd-backlight.service \n    else\n    fi\n}\n```\n"}}
{"actor":{"display_login":"biergaizi"}}