Skip to content

Commit

Permalink
WIP: Add ansible configuration playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
foxeng committed Jun 7, 2021
1 parent ad59faa commit b374609
Show file tree
Hide file tree
Showing 18 changed files with 455 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ansible/roles/common/files/Thunar/uca.xml
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<icon>utilities-terminal</icon>
<name>Open Terminal Here</name>
<command>exo-open --working-directory %f --launch TerminalEmulator</command>
<description>Example for a custom action</description>
<patterns>*</patterns>
<startup-notify/>
<directories/>
</action>
<action>
<icon>org.xfce.catfish</icon>
<name>Search</name>
<command>catfish --path=%f</command>
<description></description>
<patterns>*</patterns>
<directories/>
</action>
</actions>
4 changes: 4 additions & 0 deletions ansible/roles/common/files/lightdm.conf.d/50-local.conf
@@ -0,0 +1,4 @@
[Seat:*]
allow-user-switching=false
allow-guest=false
session-setup-script=/usr/local/sbin/revert-home.sh
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,35 @@
// Prevent suspend and hibernate for labuser
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.login1.suspend" ||
action.id == "org.freedesktop.login1.suspend-multiple-sessions" ||
action.id == "org.freedesktop.login1.hibernate" ||
action.id == "org.freedesktop.login1.hibernate-multiple-sessions") &&
subject.user == "labuser") {

return polkit.Result.NO;
}
});


// Prevent shut down for labuser
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.login1.halt" ||
action.id == "org.freedesktop.login1.halt-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions") &&
subject.user == "labuser") {

return polkit.Result.NO;
}
});


// Prevent running xfsm-shutdown-helper and xfce4-pm-helper for labuser
polkit.addRule(function(action, subject) {
if ((action.id == "org.xfce.session.xfsm-shutdown-helper" ||
action.id == "org.xfce.power.xfce4-pm-helper") &&
subject.user == "labuser") {

return polkit.Result.NO;
}
});
1 change: 1 addition & 0 deletions ansible/roles/common/files/xfce4/helpers.rc
@@ -0,0 +1 @@
WebBrowser=firefox
@@ -0,0 +1,13 @@
[Desktop Entry]
Version=1.0
Type=Application
Exec=exo-open --launch TerminalEmulator
Icon=org.xfce.terminalemulator
StartupNotify=true
Terminal=false
Categories=Utility;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-AppStream-Ignore=True
Name=Terminal Emulator
Comment=Use the command line
X-XFCE-Source=file:///usr/share/applications/xfce4-terminal-emulator.desktop
@@ -0,0 +1,14 @@
[Desktop Entry]
Version=1.0
Type=Application
Exec=exo-open --launch FileManager %u
Icon=org.xfce.filemanager
StartupNotify=true
Terminal=false
Categories=Utility;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-XFCE-MimeType=inode/directory;x-scheme-handler/trash;
X-AppStream-Ignore=True
Name=File Manager
Comment=Browse the file system
X-XFCE-Source=file:///usr/share/applications/xfce4-file-manager.desktop
@@ -0,0 +1,27 @@
[Desktop Entry]
Version=1.0
Name=Firefox
GenericName=Web Browser
Comment=Browse the World Wide Web
Keywords=Internet;WWW;Browser;Web;Explorer
Exec=/usr/lib/firefox/firefox %u
Icon=firefox
Terminal=false
X-MultipleArgs=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
StartupNotify=true
StartupWMClass=firefox
Categories=Network;WebBrowser;
Actions=new-window;new-private-window;
X-XFCE-Source=file:///usr/share/applications/firefox.desktop

[Desktop Action new-window]
Name=New Window
Name[en_US]=New Window
Exec=/usr/lib/firefox/firefox --new-window %u

[Desktop Action new-private-window]
Name=New Private Window
Name[en_US]=New Private Window
Exec=/usr/lib/firefox/firefox --private-window %u
4 changes: 4 additions & 0 deletions ansible/roles/common/files/xfce4/panel/whiskermenu-1.rc
@@ -0,0 +1,4 @@
button-title=Start
show-button-title=true
default-category=2
show-command-lockscreen=false
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<channel name="keyboard-layout" version="1.0">
<property name="Default" type="empty">
<property name="XkbOptions" type="empty">
<property name="Group" type="string" value="grp:alt_shift_toggle"/>
</property>
<property name="XkbLayout" type="string" value="us,gr"/>
<property name="XkbDisable" type="bool" value="false"/>
</property>
</channel>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<channel name="thunar-volman" version="1.0">
<property name="automount-drives" type="empty">
<property name="enabled" type="bool" value="true"/>
</property>
</channel>
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-panel" version="1.0">
<property name="configver" type="int" value="2"/>
<property name="panels" type="array">
<value type="int" value="1"/>
<property name="dark-mode" type="bool" value="false"/>
<property name="panel-1" type="empty">
<property name="position" type="string" value="p=8;x=960;y=949"/> <!-- TODO: Verify these -->
<property name="length" type="uint" value="100"/>
<property name="position-locked" type="bool" value="true"/>
<property name="size" type="uint" value="26"/>
<property name="plugin-ids" type="array">
<value type="int" value="1"/>
<value type="int" value="2"/>
<value type="int" value="3"/>
<value type="int" value="4"/>
<value type="int" value="5"/>
<value type="int" value="6"/>
<value type="int" value="7"/>
<value type="int" value="8"/>
<value type="int" value="9"/>
<value type="int" value="10"/>
<value type="int" value="11"/>
<value type="int" value="12"/>
</property>
</property>
</property>
<property name="plugins" type="empty">
<property name="plugin-1" type="string" value="whiskermenu"/>
<property name="plugin-2" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-3" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="16215916401.desktop"/>
</property>
</property>
<property name="plugin-4" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="16215916912.desktop"/>
</property>
</property>
<property name="plugin-5" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="16217825961.desktop"/>
</property>
</property>
<property name="plugin-6" type="string" value="tasklist"/>
<property name="plugin-7" type="string" value="separator">
<property name="expand" type="bool" value="true"/>
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-8" type="string" value="systray"/>
<property name="plugin-9" type="string" value="xkb">
<property name="group-policy" type="uint" value="1"/>
<property name="display-type" type="uint" value="2"/>
</property>
<property name="plugin-10" type="string" value="pulseaudio"/>
<property name="plugin-11" type="string" value="clock"/>
<property name="plugin-12" type="string" value="notification-plugin"/>
</property>
</channel>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-session" version="1.0">
<property name="general" type="empty">
<property name="SaveOnExit" type="bool" value="false"/>
</property>
</channel>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfwm4" version="1.0">
<property name="general" type="empty">
<property name="workspace_count" type="int" value="1"/>
</property>
</channel>

0 comments on commit b374609

Please sign in to comment.