{"id":33315,"date":"2018-05-18T22:29:35","date_gmt":"2018-05-18T22:29:35","guid":{"rendered":"http:\/\/antonini.psc.br\/?p=33315"},"modified":"2022-05-08T01:35:43","modified_gmt":"2022-05-08T01:35:43","slug":"como-desativar-ativar-o-modo-grafico-no-linux-com-o-systemd","status":"publish","type":"post","link":"https:\/\/antonini.ddns.net\/?p=33315","title":{"rendered":"Como desativar\/ativar o modo gr\u00e1fico no Linux com o systemd"},"content":{"rendered":"<p style=\"text-align: justify;\">Voc\u00ea pode usar o systemd e seu comando systemctl para informar o sistema se quer usar sempre a interface gr\u00e1fica ou apenas a de linha de comando.<\/p>\n<p style=\"text-align: justify;\">O recurso permite a op\u00e7\u00e3o, sem desinstalar absolutamente nada e \u00e9 facilmente revers\u00edvel, como irei mostrar.<br \/>\nCom todos as cr\u00edticas que se possa ter ao systemd \u2014 e algumas delas s\u00e3o muito justas \u2014 temos que reconhecer que trouxe algumas comodidades e a uniformiza\u00e7\u00e3o de alguns procedimentos.<\/p>\n<p style=\"text-align: justify;\">O que vou descrever, neste artigo, foi testado no Fedora 26 Workstation \u2014 mas \u00e9 aplic\u00e1vel em qualquer outra distro que fa\u00e7a uso do systemd.<\/p>\n<p style=\"text-align: justify;\">Use o systemctl para determinar a interface padr\u00e3o no seu sistema<\/p>\n<p style=\"text-align: justify;\">Voc\u00ea pode usar o comando systemctl para gerenciar a interface padr\u00e3o \u2014 fazendo a troca entre GUI (modo gr\u00e1fico) e CLI (modo texto).<\/p>\n<p style=\"text-align: justify;\">Para ver qual \u00e9 o padr\u00e3o, neste momento, use o comando assim:<\/p>\n<p style=\"text-align: justify;\"><strong>systemctl get-default<\/strong><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000080;\"><strong>graphical.target<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">O resultado \u201cgraphical.target\u201d indica que a GUI \u00e9 a interface padr\u00e3o (no meu sistema). Se fosse a CLI, o get-default iria resultar em \u201cmulti-user.target\u201d<\/p>\n<p style=\"text-align: justify;\">Para mudar a interface padr\u00e3o para o modo texto, na pr\u00f3xima inicializa\u00e7\u00e3o do sistema, use o set-default:<\/p>\n<p style=\"text-align: justify;\"><strong>systemctl set-default multi-user.target<\/strong><\/p>\n<p style=\"text-align: justify;\">Aparecer\u00e1 na tela: <em>Created symlink \/etc\/systemd\/system\/default.target \u2192 \/lib\/systemd\/system\/multi-user.target<\/em>.<\/p>\n<p style=\"text-align: justify;\">Este comando pede autentica\u00e7\u00e3o de administrador do sistema e s\u00f3 ter\u00e1 efeito ap\u00f3s o reboot.<\/p>\n<p style=\"text-align: justify;\">Voc\u00ea reiniciar o sistema com o pr\u00f3prio systemctl:<\/p>\n<p style=\"text-align: justify;\"><strong>systemctl reboot<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-33318\" src=\"http:\/\/antonini.psc.br\/wp-content\/uploads\/2018\/05\/systemd-systemctl-CLI-GUI-002-e1526682927386.png\" alt=\"\" width=\"555\" height=\"171\"\/><\/p>\n<p style=\"text-align: justify;\">Para desfazer o procedimento \u2013 e voltar a usar a interface gr\u00e1fica como padr\u00e3o \u2013 use o seguinte comando:<\/p>\n<p style=\"text-align: justify;\"><strong>systemctl set-default graphical.target<\/strong><\/p>\n<p style=\"text-align: justify;\">Aparecer\u00e1 na tela: <em>Removed \/etc\/systemd\/system\/default.target<\/em>.<br \/>\n<em>Created symlink \/etc\/systemd\/system\/default.target \u2192 \/lib\/systemd\/system\/graphical.target.<\/em><\/p>\n<p style=\"text-align: justify;\">\u00c9 simples assim. ?<\/p>\n<p style=\"text-align: center;\">[<a href=\"javascript:history.go(-1)\">Voltar<\/a>]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Voc\u00ea pode usar o systemd e seu comando systemctl para informar o sistema se quer usar sempre a interface gr\u00e1fica ou apenas a de linha de comando. O recurso permite a op\u00e7\u00e3o, sem desinstalar absolutamente nada e \u00e9 facilmente revers\u00edvel, como irei mostrar. Com todos as cr\u00edticas que se possa ter ao systemd \u2014 e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[122],"tags":[],"class_list":["post-33315","post","type-post","status-publish","format-standard","hentry","category-zp"],"_links":{"self":[{"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=\/wp\/v2\/posts\/33315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33315"}],"version-history":[{"count":4,"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=\/wp\/v2\/posts\/33315\/revisions"}],"predecessor-version":[{"id":33320,"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=\/wp\/v2\/posts\/33315\/revisions\/33320"}],"wp:attachment":[{"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/antonini.ddns.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}