Переглянути джерело

homedir config

systemd-xsession
Markus Katharina Brechtel 4 роки тому
джерело
коміт
861c88e13f
17 змінених файлів з 158 додано та 2 видалено
  1. +11
    -0
      defaults/main.yaml
  2. +30
    -0
      tasks/eralitex.yaml
  3. +6
    -0
      tasks/git.yaml
  4. +7
    -0
      tasks/kanboard.yaml
  5. +8
    -2
      tasks/main.yaml
  6. +8
    -0
      tasks/pulseaudio.yaml
  7. +7
    -0
      tasks/ssh.yaml
  8. +7
    -0
      tasks/tmux.yaml
  9. +32
    -0
      tasks/vnc.yaml
  10. +10
    -0
      templates/default.tigervnc.j2
  11. +3
    -0
      templates/gitconfig.j2
  12. +3
    -0
      templates/other-workspace-focus.fish.j2
  13. +3
    -0
      templates/remote-workspace-focus.fish.j2
  14. +8
    -0
      templates/remote-workspace-space.fish.j2
  15. +1
    -0
      templates/tmux.conf.j2
  16. +10
    -0
      templates/tmux@.service.j2
  17. +4
    -0
      templates/vnc-options.fish.j2

+ 11
- 0
defaults/main.yaml Переглянути файл

@@ -0,0 +1,11 @@
---
home_copy_pulseaudio_cookie: false
home_eralitex: false
home_access_to_hosts: []
home_vnc_client_low_bandwidth: false
home_remote_workspace_config: false
home_kanboard_api_settings: false
kanboard_api_settings: "{{ lookup('file', '~/.eralitex/kanboard_api_settings.json' | from_json) }}"
# kanboard_api_url: https://kanboard.katyx.net/jsonrpc.php
# kanboard_api_user: ka
# kanboard_api_key: xxx

+ 30
- 0
tasks/eralitex.yaml Переглянути файл

@@ -0,0 +1,30 @@
---

- import_role:
name: eralitex

- name: other workspace focus script
template:
src: other-workspace-focus.fish.j2
dest: ~/.eralitex/workspace-cmd/other-focus
mode: 0755

- name: remote workspace focus scripts
template:
src: remote-workspace-focus.fish.j2
dest: ~/.eralitex/workspace-cmd/{{workspace}}.focus
mode: 0755
with_items: "{{workspaces|dict2items|json_query(\"[?value.type=='vdesk'].key\") }}"
loop_control:
loop_var: workspace
when: home_remote_workspace_config

- name: remote workspace space shortcut scripts
template:
src: remote-workspace-space.fish.j2
dest: ~/.eralitex/workspace-cmd/{{workspace}}.space
mode: 0755
with_items: "{{workspaces|dict2items|json_query(\"[?value.type=='vdesk'||value.type=='tmux'].key\") }}"
loop_control:
loop_var: workspace
when: home_remote_workspace_config

+ 6
- 0
tasks/git.yaml Переглянути файл

@@ -0,0 +1,6 @@
---

- name: git config
template:
src: gitconfig.j2
dest: ~/.gitconfig

+ 7
- 0
tasks/kanboard.yaml Переглянути файл

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

- name: kanboard api settings
copy:
content: "{{ kanboard_api_settings | to_json }}"
dest: ~/.eralitex/kanboard_api_settings.json
when: home_kanboard_api_settings

+ 8
- 2
tasks/main.yaml Переглянути файл

@@ -1,4 +1,10 @@
---

- import_role:
name: eralitex
- import_tasks: ssh.yaml
- import_tasks: vnc.yaml
- import_tasks: tmux.yaml
- import_tasks: pulseaudio.yaml
- import_tasks: git.yaml

- import_tasks: eralitex.yaml
when: home_eralitex

+ 8
- 0
tasks/pulseaudio.yaml Переглянути файл

@@ -0,0 +1,8 @@
---

- name: pulse cookie
copy:
src: ~/.pulse-cookie
dest: ~/.pulse-cookie
mode: 0600
when: home_copy_pulseaudio_cookie

+ 7
- 0
tasks/ssh.yaml Переглянути файл

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

- name: ssh-keys
copy:
src: ~/ssh-keys/
dest: ~/ssh-keys
mode: u=rw,g=,o=

+ 7
- 0
tasks/tmux.yaml Переглянути файл

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

- name: tmux config
template:
src: tmux.conf.j2
dest: ~/.tmux.conf
mode: 0755

+ 32
- 0
tasks/vnc.yaml Переглянути файл

@@ -0,0 +1,32 @@
---

- name: vnc directory
file:
path: ~/.vnc
state: directory
mode: 0700

- name: vnc passwd
copy:
content: "{{ lookup('pipe','pwgen 24 1' )}}"
dest: ~/.vnc/passwd
mode: 0600
force: no

- name: fetch vnc passwd
fetch:
src: ~/.vnc/passwd
dest: ~/.vnc/passwd.{{inventory_hostname}}
flat: yes

- name: copy vnc passwd files
copy:
src: ~/.vnc/passwd.{{item}}
dest: ~/.vnc/passwd.{{item}}
with_items: "{{ home_access_to_hosts }}"

- name: vnc options
template:
src: vnc-options.fish.j2
dest: ~/.eralitex/workspace-cmd/vnc-options
mode: 0755

+ 10
- 0
templates/default.tigervnc.j2 Переглянути файл

@@ -0,0 +1,10 @@
TigerVNC Configuration file Version 1.0
MenuKey=Pause
{% if vnc_client_low_bandwidth %}
AutoSelect=0
QualityLevel=0
FullColor=0
LowColorLevel=2
PreferredEncoding=Tight
CompressLevel=0
{% endif %}

+ 3
- 0
templates/gitconfig.j2 Переглянути файл

@@ -0,0 +1,3 @@
[user]
email = markus.katharina.brechtel@thengo.net
name = Markus Katharina Brechtel

+ 3
- 0
templates/other-workspace-focus.fish.j2 Переглянути файл

@@ -0,0 +1,3 @@
#!/usr/bin/fish
{{ ansible_managed | comment }}
i3-msg mode default

+ 3
- 0
templates/remote-workspace-focus.fish.j2 Переглянути файл

@@ -0,0 +1,3 @@
#!/usr/bin/fish
{{ ansible_managed | comment }}
i3-msg mode remote

+ 8
- 0
templates/remote-workspace-space.fish.j2 Переглянути файл

@@ -0,0 +1,8 @@
#!/usr/bin/fish
{{ ansible_managed | comment }}
{% if workspaces[workspace].type == "vdesk" %}
source (dirname (status --current-filename))/vnc-options
xtigervncviewer localhost:{{workspaces[workspace].display|default(16)}} -via {{workspaces[workspace].host}} -PasswordFile ~/.vnc/passwd.{{workspaces[workspace].host}}
{% elif workspaces[workspace].type == "tmux" %}
urxvt -title tmux-workspace -e fish -c 'ssh -t {{workspaces[workspace].host}} tmux attach -d -t {{workspaces[workspace].session}}'
{% endif %}

+ 1
- 0
templates/tmux.conf.j2 Переглянути файл

@@ -0,0 +1 @@
set-option -g status-position top

+ 10
- 0
templates/tmux@.service.j2 Переглянути файл

@@ -0,0 +1,10 @@
[Unit]
Description=tmux session

[Service]
Type=forking
ExecStart=/usr/bin/tmux new-session -s %i -d
ExecStop=/usr/bin/tmux kill-session -t %i

[Install]
WantedBy=default.target

+ 4
- 0
templates/vnc-options.fish.j2 Переглянути файл

@@ -0,0 +1,4 @@
#!/usr/bin/fish
{{ ansible_managed | comment }}
#set -a vnc_options -MenuKey Pause
#set -a vnc_options -AutoSelect=0 -QualityLevel=0 -FullColor=0 -LowColorLevel=2 -PreferredEncoding=Tight -CompressLevel=0