Преглед на файлове

Merge branch 'master' of git.thengo.net:ka/ansible-role-home

pull/1/head
Markus Katharina Brechtel преди 2 години
родител
ревизия
55d908cd0c
променени са 12 файла, в които са добавени 88 реда и са изтрити 19 реда
  1. +6
    -4
      defaults/main.yaml
  2. +2
    -0
      files/bin/screensaver
  3. +2
    -0
      tasks/apt.yaml
  4. +7
    -0
      tasks/clean.yaml
  5. +24
    -0
      tasks/lockscreen.yaml
  6. +3
    -1
      tasks/main.yaml
  7. +0
    -7
      tasks/screensaver.yaml
  8. +6
    -6
      templates/i3/i3.config.j2
  9. +13
    -0
      templates/lockscreen/lockscreen-auto.service.j2
  10. +5
    -0
      templates/lockscreen/lockscreen.env.j2
  11. +14
    -0
      templates/lockscreen/lockscreen.service.j2
  12. +6
    -1
      templates/x11/xsession.reload.fish.j2

+ 6
- 4
defaults/main.yaml Целия файл

@@ -45,10 +45,12 @@ system_suspend_command: systemctl suspend
system_reboot_command: systemctl reboot
system_poweroff_command: systemctl poweroff

session_lock_enabled: "{{ (home_profile != 'presentation') and (home_profile != 'vdesk') }}"
session_lock_command: xset s activate
session_enable_screensaver_command: /usr/local/bin/screensaver-enable
session_disable_screensaver_command: /usr/local/bin/screensaver-disable
lockscreen_enabled: "{{ (home_profile != 'presentation') and (home_profile != 'vdesk') }}"
lockscreen_lock_command: xset s activate
lockscreen_timeout: 300
lockscreen_locktime: 30

display_sleeptime: 300

file_browser_command: thunar
calculator_command: "{{default_browser}} --new-window https://www.geogebra.org/calculator"


+ 2
- 0
files/bin/screensaver Целия файл

@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/libexec/xscreensaver/glmatrix -density 50 -no-rotate $@

+ 2
- 0
tasks/apt.yaml Целия файл

@@ -5,3 +5,5 @@
pkg:
- socat
- fish
- xsecurelock
- xss-lock

+ 7
- 0
tasks/clean.yaml Целия файл

@@ -62,3 +62,10 @@
path: ~/.config/systemd/user/autostart-desktop-app@.service
state: absent
notify: systemd daemon-reload

- name: screensaver graphical-session service disabled
systemd:
name: screensaver.service
enabled: false
state: stopped
scope: user

+ 24
- 0
tasks/lockscreen.yaml Целия файл

@@ -0,0 +1,24 @@
---

- name: lockscreen environment
template:
src: lockscreen/lockscreen.env.j2
dest: ~/.lockscreen.env

- name: lockscreen graphical-session service
template:
src: lockscreen/lockscreen.service.j2
dest: ~/.config/systemd/user/lockscreen.service
notify: systemd daemon-reload

- name: lockscreen-auto graphical-session service
template:
src: lockscreen/lockscreen-auto.service.j2
dest: ~/.config/systemd/user/lockscreen-auto.service
notify: systemd daemon-reload

- name: lockscreen graphical-session service enabled
systemd:
name: lockscreen.service
enabled: "{{ lockscreen_enabled }}"
scope: user

+ 3
- 1
tasks/main.yaml Целия файл

@@ -6,7 +6,6 @@
- import_tasks: ssh.yaml
- import_tasks: tmux.yaml
- import_tasks: pulseaudio.yaml
- import_tasks: screensaver.yaml
- import_tasks: git.yaml
- import_tasks: timer.yaml

@@ -18,6 +17,9 @@
- import_tasks: i3.yaml
tags:
- i3
- import_tasks: lockscreen.yaml
tags:
- lockscreen
- import_tasks: workspaces.yaml
- import_tasks: icons.yaml
- import_tasks: background.yaml


+ 0
- 7
tasks/screensaver.yaml Целия файл

@@ -1,7 +0,0 @@
---

- name: screensaver graphical-session service enabled
systemd:
name: screensaver.service
enabled: "{{ session_lock_enabled }}"
scope: user

+ 6
- 6
templates/i3/i3.config.j2 Целия файл

@@ -22,7 +22,7 @@ floating_modifier $mod
### default/local mode

## special keys
bindsym XF86Sleep exec {{i3_exec_command_prefix}} {{session_lock_command}}
bindsym XF86Sleep exec {{i3_exec_command_prefix}} {{lockscreen_lock_command}}
bindsym XF86Mail exec {{i3_exec_command_prefix}} {{mail_command}}
bindsym XF86HomePage exec {{i3_exec_command_prefix}} {{default_browser}}
bindsym XF86Calculator exec {{i3_exec_command_prefix}} {{calculator_command}}
@@ -172,7 +172,7 @@ bindsym $mod+KP_Add exec {{points_up_command}}
mode "remote" {

bindcode $mod+9 mode "default"
bindsym XF86Sleep exec {{session_lock_command}}
bindsym XF86Sleep exec {{lockscreen_lock_command}}

# The middle button over a titlebar kills the window
bindsym --release button2 kill
@@ -199,11 +199,11 @@ mode "session" {
bindsym r reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}}
bindsym R reload; exec --no-startup-id ~/.xsession.reload.fish; mode "default"; {{on_focus_workspace}}
bindsym s exec --no-startup-id {{system_suspend_command}}; mode "default"; {{on_focus_workspace}}
bindsym l exec --no-startup-id {{session_lock_command}}; mode "default"; {{on_focus_workspace}}
bindcode 49 exec --no-startup-id {{session_lock_command}}; mode "default"; {{on_focus_workspace}}
bindsym e exec --no-startup-id {{session_enable_screensaver_command}}; mode "default"; {{on_focus_workspace}}
bindsym d exec --no-startup-id {{session_disable_screensaver_command}}; mode "default"; {{on_focus_workspace}}
bindsym l exec --no-startup-id {{lockscreen_lock_command}}; mode "default"; {{on_focus_workspace}}
bindcode 49 exec --no-startup-id {{lockscreen_lock_command}}; mode "default"; {{on_focus_workspace}}
bindsym b exec --no-startup-id xsetroot -solid black; mode "default"; {{on_focus_workspace}}
bindsym e exec --no-startup-id systemctl --user start lockscreen.service; mode "default"; {{on_focus_workspace}}
bindsym d exec --no-startup-id systemctl --user stop lockscreen.service; mode "default"; {{on_focus_workspace}}
bindsym Shift+R exec --no-startup-id {{system_reboot_command}}; mode "default"; {{on_focus_workspace}}
bindsym Shift+P exec --no-startup-id {{system_poweroff_command}}; mode "default"; {{on_focus_workspace}}



+ 13
- 0
templates/lockscreen/lockscreen-auto.service.j2 Целия файл

@@ -0,0 +1,13 @@
{{ ansible_managed | comment }}

[Unit]
Description=Screensaver
PartOf=graphical-session.target

[Service]
Type=simple
ExecStart=/usr/bin/xss-lock -l -- systemctl --user start lockscreen.service
Restart=always

[Install]
WantedBy=graphical-session.target

+ 5
- 0
templates/lockscreen/lockscreen.env.j2 Целия файл

@@ -0,0 +1,5 @@
{{ ansible_managed | comment }}

#XSECURELOCK_SAVER=$HOME/bin/screensaver
XSECURELOCK_AUTH_BACKGROUND_COLOR={{home_base_color_hue|hsv2rgb(66,47)}}
XSECURELOCK_SWITCH_USER_COMMAND=dm-tool switch-to-greeter

+ 14
- 0
templates/lockscreen/lockscreen.service.j2 Целия файл

@@ -0,0 +1,14 @@
{{ ansible_managed | comment }}

[Unit]
Description=Screensaver
PartOf=graphical-session.target

[Service]
Type=notify
ExecStart=xsecurelock -- systemd-notify --ready
NotifyAccess=all
EnvironmentFile=%h/.lockscreen.env

[Install]
WantedBy=graphical-session.target

+ 6
- 1
templates/x11/xsession.reload.fish.j2 Целия файл

@@ -20,7 +20,12 @@ xrdb -merge ~/.Xresources
rofi -theme ~/.config/rofi/theme -dump-xresources > ~/.config/rofi/config

# screensaver settings
/usr/local/bin/screensaver-settings
xset s on
xset +dpms
xset s {{ lockscreen_timeout | int }} {{ lockscreen_locktime | int }}

# DPMS options
xset dpms {{ display_sleeptime | int }} {{ display_sleeptime | int }} {{ display_sleeptime | int }}

# allow hosts
{% for xhost in home_xhosts_allow %}