{"id":389,"date":"2022-10-19T13:41:30","date_gmt":"2022-10-19T21:41:30","guid":{"rendered":"https:\/\/nramkumar.org\/tech\/?p=389"},"modified":"2022-10-19T13:41:31","modified_gmt":"2022-10-19T21:41:31","slug":"starting-imwheel-automatically-on-login","status":"publish","type":"post","link":"https:\/\/nramkumar.org\/tech\/blog\/2022\/10\/19\/starting-imwheel-automatically-on-login\/","title":{"rendered":"Starting imwheel automatically on login"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This was way more annoying than it should have been &#8211; I am using imwheel to increase scroll speed and wanted to set up my Manjaro 5.15 KDE environment so that it starts automatically at startup. The following things did not work:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Setting up an autostart shortcut to imwheel<\/li><li>Setting up a login script for autostart that ran imwheel<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">There are likely some better low-tech (read simple linking to bash_profile or something similar) that would work but I decided to go for more punishment. I decided to look into using systemd user configured units to set up a unit that will auto start imwheel on login.<br><br>The critical thing to note is that imwheel should be started once the X session is established and you have the X authentication cookie and DISPLAY environment variables set. Trying to articulate all of this in systemd is a sheer exercise in frustration. This is one place where the Internetz did not help despite my search-fu. In the end, I came up with the following magic incantation that works perfectly. You need to put this in <code>$HOME\/.config\/systemd\/user\/imwheel.service<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=IMWheel\nAfter=plasma-kwin_x11.service\nPartOf=graphical-session.target\n&#91;Service]\nType=simple\nEnvironment=XAUTHORITY=%h\/.Xauthority\nEnvironment=DISPLAY=:0\nExecStart=\/usr\/bin\/imwheel -kill -d\nExecStop=\/usr\/bin\/pkill imwheel\nRemainAfterExit=yes\nRestart=on-failure\nSlice=session.slice\n&#91;Install]\nWantedBy=graphical-session.target<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After this, you should run <code>systemctl --user enable imwheel<\/code> and you should be all set to have imwheel automatically start when you login to your KDE environment. To come up with this magic incantation, I used <code>systemctl --user status<\/code> to list all the user level systemd units and then pieced this together. I really need to read the systemctl documentation to understand how to specify dependencies better but that needs to wait for another day.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This was way more annoying than it should have been &#8211; I am using imwheel to increase scroll speed and wanted to set up my Manjaro 5.15 KDE environment so that it starts automatically at startup. The following things did not work: Setting up an autostart shortcut to imwheel Setting up a login script for&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-389","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/comments?post=389"}],"version-history":[{"count":2,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":398,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/posts\/389\/revisions\/398"}],"wp:attachment":[{"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/media?parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/categories?post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nramkumar.org\/tech\/wp-json\/wp\/v2\/tags?post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}