{"id":1517,"date":"2017-06-20T16:08:32","date_gmt":"2017-06-20T16:08:32","guid":{"rendered":"http:\/\/hauweele.net\/~gawen\/blog\/?p=1517"},"modified":"2017-06-20T18:26:42","modified_gmt":"2017-06-20T18:26:42","slug":"custom-user-xsession-with-sddm","status":"publish","type":"post","link":"https:\/\/hauweele.net\/~gawen\/blog\/?p=1517","title":{"rendered":"Custom user Xsession with SDDM"},"content":{"rendered":"<p>Debian stretch is out, a lot of obsolete packages, a lot of major upgrades, which all in all resulted in quite a painful transition the last few days. But I&#8217;ll tell you more about that in the following posts.<\/p>\n<p>I don&#8217;t really spend much time on Linux nowadays so KDE (along with KDM) has always been my goto solution for a jack all trade no-BS works-out-of-the-box desktop environment. And it worked like that just fine, until&#8230; well you know how software goes. KDE has been upgraded, KDM has been depreciated and replaced with SDDM.<\/p>\n<p>I also use <code>xsession<\/code> so that I have a common way of starting session scripts and daemons (such as <a href=\"http:\/\/github.com\/gawen947\/gpushd\">this one<\/a>) and configuring stuff across different desktops. I generally selected <i>custom session<\/i> in the display manager and that was it. But SDDM does not seem to provide a way to do so, or at least that&#8217;s not so clear.<\/p>\n<p>By default, it will execute <code>\/etc\/sddm\/xsession<\/code> which itself sources <code>\/etc\/X11\/Xsession<\/code> to which it will pass as argument the value of the <i>Exec<\/i> line in the desktop file (located in <code>\/usr\/share\/xsessions<\/code>) describing the currently selected session.<\/p>\n<p>If we want to bypass this, we need to scrap the argument passed to <code>\/etc\/X11\/Xsession<\/code> no matter what SDDM thinks the current session should be. To do so create a wrapper for Xsession in <code>\/etc\/X11\/user-Xsession<\/code>:<\/p>\n<pre>\r\n#!\/bin\/sh\r\n\r\nexport PATH=\/bin:\/usr\/bin:\/usr\/local\/bin:\/sbin:\/usr\/sbin:\/usr\/local\/sbin\r\n\r\n# Discard argument, we don't care about selecting the desktop environment.\r\n\/etc\/X11\/Xsession\r\n<\/pre>\n<p>And now configure SDDM to use this instead of its own version of it, in <code>\/etc\/sddm.conf<\/code>:<\/p>\n<pre>\r\n[X11]\r\nSessionCommand=\/etc\/X11\/user-Xsession\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Debian stretch is out, a lot of obsolete packages, a lot of major upgrades, which all in all resulted in quite a painful transition the last few days. But I&#8217;ll tell you more about that in the following posts. I &hellip; <a href=\"https:\/\/hauweele.net\/~gawen\/blog\/?p=1517\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[7,834,835,6,836,833,464,837],"class_list":["post-1517","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-debian","tag-kde","tag-kdm","tag-linux","tag-sddm","tag-stretch","tag-user","tag-xsession"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1517"}],"version-history":[{"count":0,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1517\/revisions"}],"wp:attachment":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}