diff --git a/defaults/main.yaml b/defaults/main.yaml index bea6f6f..f84faab 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -1,52 +1,48 @@ --- +home_xft_dpi: 96 home_copy_pulseaudio_cookie: false home_desktop: 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_settings: "{{ lookup('file', '~/.kanboard_api_settings.json' | from_json) }}" # kanboard_api_url: https://kanboard.katyx.net/jsonrpc.php # kanboard_api_user: ka # kanboard_api_key: xxx home_vdesk_started_and_enabled: false -eralitex_directory: ~/.eralitex +home_profile: desktop -eralitex_profile: desktop - -eralitex_terminal: urxvt -eralitex_browser: firefox +default_terminal: urxvt +default_browser: firefox # feature flags -eralitex_with_activity: false +with_activity: false -eralitex_applications: +application_shortcuts: a: atom w: lowriter - c: localc + c: "{{calculator_command}}" i: loimpress d: lodraw - F: catfish # search - j: "{{eralitex_jupyter_console_command}}" s: xfce4-screenshooter - l: catfish - f: "{{eralitex_file_browser_command}}" # files - m: "{{eralitex_mail_command}}" + l: catfish # search + f: "{{file_browser_command}}" # files + m: "{{mail_command}}" r: arandr ssh_over_tor: false -eralitex_lock_command: xset s activate -eralitex_enable_screensaver_command: /usr/local/bin/screensaver-enable -eralitex_disable_screensaver_command: /usr/local/bin/screensaver-disable -eralitex_suspend_command: systemctl suspend -eralitex_reboot_command: systemctl reboot -eralitex_poweroff_command: systemctl poweroff +session_lock_command: xset s activate +session_enable_screensaver_command: /usr/local/bin/screensaver-enable +session_disable_screensaver_command: /usr/local/bin/screensaver-disable +system_suspend_command: systemctl suspend +system_reboot_command: systemctl reboot +system_poweroff_command: systemctl poweroff -eralitex_file_browser_command: thunar -eralitex_calculator_command: "{{eralitex_jupyter_console_command}}" -eralitex_jupyter_console_command: jupyter qtconsole --no-confirm-exit -eralitex_mail_command: thunderbird +file_browser_command: thunar +calculator_command: "{{default_browser}} --new-window https://www.geogebra.org/calculator" +mail_command: thunderbird -eralitex_background_image: false +background_image: false diff --git a/files/bin/i3-watchers b/files/bin/i3-watchers index 0899a61..5450688 100644 --- a/files/bin/i3-watchers +++ b/files/bin/i3-watchers @@ -2,4 +2,4 @@ set DIR (cd (dirname (status -f)); and pwd) -i3-msg -t subscribe -m '["workspace"]' | jq --raw-output --unbuffered 'select(.change == "focus").current.name' | xargs -n1 -r $DIR/on-focus-workspace & +i3-msg -t subscribe -m '["workspace"]' | jq --raw-output --unbuffered 'select(.change == "focus").current.name' | xargs -n1 -r on-focus-workspace & diff --git a/files/bin/on-focus-workspace b/files/bin/on-focus-workspace index 2cafc0f..2cabc46 100644 --- a/files/bin/on-focus-workspace +++ b/files/bin/on-focus-workspace @@ -5,13 +5,10 @@ if count $argv else set ws (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.focused == true).name') end -set script ~/.eralitex/workspace-cmd/$ws.focus -set oscript ~/.eralitex/workspace-cmd/other-focus +set script ~/.workspaces/$ws.focus if type -q $script $script else - if type -q $oscript - $oscript - end + i3-msg mode default end diff --git a/files/bin/on-space-shortcut b/files/bin/on-space-shortcut index 9284e26..369e8ed 100644 --- a/files/bin/on-space-shortcut +++ b/files/bin/on-space-shortcut @@ -1,7 +1,7 @@ #!/usr/bin/fish set ws (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.focused == true).name') -set script ~/.eralitex/workspace-cmd/$ws.space +set script ~/.workspaces/$ws.space if type -q $script $script diff --git a/files/bin/timer b/files/bin/timer index eb507bd..315858a 100644 --- a/files/bin/timer +++ b/files/bin/timer @@ -3,6 +3,8 @@ switch $argv[1] case "activity" /opt/activity/select_activity + case "uniklinik" + /opt/activity/activity 'Arbeit:Uniklinik Köln' case "end" /opt/activity/activity end diff --git a/tasks/background.yaml b/tasks/background.yaml new file mode 100644 index 0000000..d14c1a3 --- /dev/null +++ b/tasks/background.yaml @@ -0,0 +1,13 @@ +--- + +- name: backgrounds directory + file: + path: ~/.backgrounds + state: directory + when: background_image is defined + +- name: background image + copy: + src: "{{background_image}}" + dest: "{{background_image_path}}" + when: background_image is defined diff --git a/tasks/clean.yaml b/tasks/clean.yaml index 8f02efd..c30bcb7 100644 --- a/tasks/clean.yaml +++ b/tasks/clean.yaml @@ -12,3 +12,8 @@ file: path: ~/.config/systemd/user/eralitex@.service state: absent + +- name: remove old eralitex directory + file: + path: ~/.eralitex + state: absent diff --git a/tasks/eralitex.yaml b/tasks/eralitex.yaml deleted file mode 100644 index 33a9861..0000000 --- a/tasks/eralitex.yaml +++ /dev/null @@ -1,106 +0,0 @@ ---- - -- name: xsession scripts - template: - src: xsession.sh.j2 - dest: "{{eralitex_directory}}/{{item}}/xsession" - mode: 0755 - with_items: "{{ eralitex_profiles }}" - -- name: session reload scripts - template: - src: reload.sh.j2 - dest: "{{eralitex_directory}}/{{item}}/reload" - mode: 0755 - with_items: "{{ eralitex_profiles }}" - -- name: rofi themes - template: - src: rofi.theme.j2 - dest: "{{eralitex_directory}}/{{item}}/rofi.theme" - mode: 0755 - with_items: "{{ eralitex_profiles }}" - -- name: Xmodmap - template: - src: Xmodmap.j2 - dest: "{{eralitex_directory}}/Xmodmap" - -- name: urxvt Xresources system config - template: - src: urxvt.Xresources.j2 - dest: "{{eralitex_directory}}/urxvt.Xresources" - -- name: eralitex bin directory - copy: - src: bin/ - dest: "{{eralitex_directory}}/bin/" - mode: 0755 - -- name: link selected profile as active - file: - dest: "{{eralitex_directory}}/active-profile" - src: "{{eralitex_profile}}" - state: link - - -- name: link etx cli utility from users bin - file: - dest: ~/bin/etx - src: "{{eralitex_directory}}/bin/etx" - state: link - -- name: link selected profile as active - file: - dest: "{{eralitex_directory}}/active-profile" - src: "{{eralitex_profile}}" - state: link - -- name: background image directory - file: - path: "{{eralitex_directory}}/backgrounds" - state: directory - when: eralitex_background_image is defined - -- name: background image - copy: - src: "{{eralitex_background_image}}" - dest: "{{eralitex_background_image_path}}" - when: eralitex_background_image is defined - -- name: workspace-cmd directory - file: - path: "{{eralitex_directory}}/workspace-cmd" - state: directory - -- 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 - -- name: vnc options - template: - src: vnc-options.fish.j2 - dest: ~/.eralitex/workspace-cmd/vnc-options - mode: 0755 diff --git a/tasks/i3.yaml b/tasks/i3.yaml index 076ed4a..fec74f1 100644 --- a/tasks/i3.yaml +++ b/tasks/i3.yaml @@ -1,18 +1,25 @@ --- +- name: i3 config directory + file: + path: ~/.config/i3 + state: directory + - name: i3 config template: src: i3.config.j2 - dest: "{{eralitex_directory}}/{{item}}/i3.config" - with_items: "{{ eralitex_profiles }}" + dest: ~/.config/i3/config - name: check i3 config - command: i3 -c {{eralitex_directory}}/{{item}}/i3.config -C - with_items: "{{ eralitex_profiles }}" + command: i3 -c ~/.config/i3/config -C changed_when: false +- name: i3blocks config directory + file: + path: ~/.config/i3blocks + state: directory + - name: i3blocks config template: src: i3blocks.config.j2 - dest: "{{eralitex_directory}}/{{item}}/i3blocks.config" - with_items: "{{ eralitex_profiles }}" + dest: ~/.config/i3blocks/config diff --git a/tasks/kanboard.yaml b/tasks/kanboard.yaml index e102e88..51bc240 100644 --- a/tasks/kanboard.yaml +++ b/tasks/kanboard.yaml @@ -3,5 +3,5 @@ - name: kanboard api settings copy: content: "{{ kanboard_api_settings | to_json }}" - dest: ~/.eralitex/kanboard_api_settings.json + dest: ~/.kanboard_api_settings.json when: home_kanboard_api_settings diff --git a/tasks/main.yaml b/tasks/main.yaml index f0f3a79..801cbc8 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -11,14 +11,13 @@ - import_tasks: points.yaml -- import_tasks: i3.yaml - when: home_desktop -- import_tasks: eralitex.yaml - when: home_desktop -- import_tasks: x11.yaml - when: home_desktop - -- import_tasks: vdesk.yaml +- block: + - import_tasks: i3.yaml + - import_tasks: workspaces.yaml + - import_tasks: background.yaml + - import_tasks: rofi.yaml + - import_tasks: x11.yaml + - import_tasks: vdesk.yaml when: home_desktop - name: flush handlers diff --git a/tasks/points.yaml b/tasks/points.yaml index f2edf78..95ce72f 100644 --- a/tasks/points.yaml +++ b/tasks/points.yaml @@ -3,5 +3,5 @@ - name: points counter copy: content: 0 - dest: "{{eralitex_directory}}/points" + dest: ~/.points force: no diff --git a/tasks/rofi.yaml b/tasks/rofi.yaml new file mode 100644 index 0000000..d5fbe46 --- /dev/null +++ b/tasks/rofi.yaml @@ -0,0 +1,12 @@ +--- + +- name: rofi config directory + file: + path: ~/.config/rofi + state: directory + +- name: rofi theme + template: + src: rofi.theme.j2 + dest: ~/.config/rofi/theme + mode: 0755 diff --git a/tasks/ssh.yaml b/tasks/ssh.yaml index 49f1df7..cf08d26 100644 --- a/tasks/ssh.yaml +++ b/tasks/ssh.yaml @@ -23,4 +23,4 @@ name: ssh-agent.service state: started enabled: true - user: true + scope: user diff --git a/tasks/structure.yaml b/tasks/structure.yaml index eb7fdeb..e95d9ae 100644 --- a/tasks/structure.yaml +++ b/tasks/structure.yaml @@ -1,22 +1,17 @@ --- -- name: ~/bin directory +- name: bin directory file: path: ~/bin state: directory +- name: binaries + copy: + src: bin/ + dest: ~/bin + mode: 0755 + - name: systemd user config directory file: path: ~/.config/systemd/user state: directory - -- name: eralitex directory - file: - path: "{{eralitex_directory}}" - state: directory - -- name: profile directories - file: - path: "{{eralitex_directory}}/{{item}}" - state: directory - with_items: "{{ eralitex_profiles }}" diff --git a/tasks/vnc.yaml b/tasks/vnc.yaml index 1f50ed9..403c254 100644 --- a/tasks/vnc.yaml +++ b/tasks/vnc.yaml @@ -24,3 +24,9 @@ src: ~/.vnc/passwd.{{item}} dest: ~/.vnc/passwd.{{item}} with_items: "{{ home_access_to_hosts }}" + +- name: default vnc client options + template: + src: tigervnc.default.j2 + dest: ~/.vnc/default.tigervnc + mode: 0755 diff --git a/tasks/workspaces.yaml b/tasks/workspaces.yaml new file mode 100644 index 0000000..f7711c1 --- /dev/null +++ b/tasks/workspaces.yaml @@ -0,0 +1,24 @@ +--- + +- name: workspaces directory + file: + path: ~/.workspaces + state: directory + +- name: workspace focus scripts + template: + src: workspace.focus.fish.j2 + dest: ~/.workspaces/{{workspace}}.focus + mode: 0755 + with_items: "{{workspaces|dict2items|json_query(\"[?value.type=='vdesk'].key\") }}" + loop_control: + loop_var: workspace + +- name: workspace space shortcut scripts + template: + src: workspace.space.fish.j2 + dest: ~/.workspaces/{{workspace}}.space + mode: 0755 + with_items: "{{workspaces|dict2items|json_query(\"[?value.type=='vdesk'||value.type=='tmux'].key\") }}" + loop_control: + loop_var: workspace diff --git a/tasks/x11.yaml b/tasks/x11.yaml index 4e447ad..f5d7caa 100644 --- a/tasks/x11.yaml +++ b/tasks/x11.yaml @@ -1,6 +1,28 @@ --- +- name: Xresources + template: + src: Xresources.j2 + dest: ~/.Xresources + +- name: Xmodmap + template: + src: Xmodmap.j2 + dest: ~/.Xmodmap + +- name: xsession script + template: + src: xsession.fish.j2 + dest: ~/.xsession.fish + mode: 0755 + +- name: xsession reload script + template: + src: xsession.reload.fish.j2 + dest: ~/.xsession.reload.fish + mode: 0755 + - name: xsessionrc copy: - content: exec fish {{eralitex_directory}}/active-profile/xsession + content: exec fish ~/.xsession.fish dest: ~/.xsessionrc diff --git a/templates/Xmodmap.j2 b/templates/Xmodmap.j2 index 86417f7..d036ba3 100644 --- a/templates/Xmodmap.j2 +++ b/templates/Xmodmap.j2 @@ -1,6 +1,6 @@ ! {{ ansible_managed }} ! -! xmodmap {{eralitex_directory}}/Xmodmap +! xmodmap ~/.Xmodmap ! ! default modifier configuration ! diff --git a/templates/urxvt.Xresources.j2 b/templates/Xresources.j2 similarity index 66% rename from templates/urxvt.Xresources.j2 rename to templates/Xresources.j2 index dc73047..131d09e 100644 --- a/templates/urxvt.Xresources.j2 +++ b/templates/Xresources.j2 @@ -1,6 +1,19 @@ -! set font to Terminus -urxvt*font: xft:Terminus:pixelsize=14 -urxvt*boldFont: xft:Terminus:pixelsize=14 +! {{ansible_managed}} + +! DPI +Xft.dpi: {{home_xft_dpi}} + +! These might also be useful depending on your monitor and personal preference: +Xft.autohint: 0 +Xft.lcdfilter: lcddefault +Xft.hintstyle: hintfull +Xft.hinting: 1 +Xft.antialias: 1 +Xft.rgba: rgb + +! set fonts +URxvt.font:xft:Monospace:pixelsize=15 +URxvt.boldfont:xft:Monospace-Bold:pixelsize=15 ! set colors URxvt*background: black diff --git a/templates/i3.config.j2 b/templates/i3.config.j2 index 17e1f6b..bf9a7f6 100644 --- a/templates/i3.config.j2 +++ b/templates/i3.config.j2 @@ -5,11 +5,21 @@ # Please see http://i3wm.org/docs/userguide.html for a complete reference! {% set workspace_switcher = "exec fish -c \"i3-msg workspace (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.num == -1).name' | rofi -dmenu -p workspace )\"" %} -{% set on_focus_workspace = "exec --no-startup-id " + eralitex_directory + "/bin/on-focus-workspace" %} - +{% set on_focus_workspace = "exec --no-startup-id ~/bin/on-focus-workspace" %} ### Font -font pango:Terminus 14px +#font pango:DejaVu Sans Mono 12 +#font pango:DejaVu Sans Mono, Terminus Bold Semi-Condensed 11 +#font pango:Droid Sans Mono Dotted 12 +#font pango:DroidSansMono 13 +#font pango:Sans 13 +#font pango:hermit 12 +#font pango:Inconsolata 14 +font pango:monospace 10 +#font pango:SourceCodePro-SemiBold 11 +#font pango:Source Code Pro for Powerline, FontAwesome Regular, Icons 9 +#font pango:Terminus 14px +#font pango:UbuntuMono-regular 12 @@ -31,10 +41,10 @@ set $right odiaeresis ### default/local mode ## special keys -bindsym XF86Sleep exec {{eralitex_lock_command}} -bindsym XF86Mail exec {{eralitex_mail_command}} -bindsym XF86HomePage exec {{eralitex_browser}} -bindsym XF86Calculator exec {{eralitex_calculator_command}} +bindsym XF86Sleep exec {{session_lock_command}} +bindsym XF86Mail exec {{mail_command}} +bindsym XF86HomePage exec {{default_browser}} +bindsym XF86Calculator exec {{calculator_command}} ## Special modes bindsym $mod+t mode timer @@ -44,17 +54,17 @@ bindcode $mod+49 mode "remote" ## Applications -bindsym $mod+Return exec "{{eralitex_terminal}}" -bindsym $mod+b exec "{{eralitex_browser}}" +bindsym $mod+Return exec "{{default_terminal}}" +bindsym $mod+b exec "{{default_browser}}" bindsym $mod+d exec rofi -show drun -show-icons bindsym $mod+e exec rofi -show run bindsym $mod+a mode "apps" -bindsym $mod+space exec "{{eralitex_directory}}/bin/on-space-shortcut" +bindsym $mod+space exec "~/bin/on-space-shortcut" ## Workspaces bindsym $mod+w {{workspace_switcher}} -{% for ws in eralitex_numbered_workspace_keymaps %} +{% for ws in i3_number_workspace_keymaps %} bindsym $mod+{{ws.keysym}} workspace "{{ws.workspace}}" {% endfor %} # focus workspace @@ -98,6 +108,8 @@ bindsym $mod+x exec xkill # points bindsym $mod+minus exec {{points_down_command}} bindsym $mod+plus exec {{points_up_command}} +bindsym $mod+KP_Subtract exec {{points_down_command}} +bindsym $mod+KP_Add exec {{points_up_command}} # unlearn #exec {{points_down_command}} @@ -106,15 +118,15 @@ bindsym $mod+plus exec {{points_up_command}} ## stuff that is available in default and remote mode {% macro overall() %} - {% if item == "desktop" %} - bindsym $plexmod+space exec "{{eralitex_directory}}/bin/on-space-shortcut" + {% if home_profile == "desktop" %} + bindsym $plexmod+space exec ~/bin/on-space-shortcut bindsym $plexmod+BackSpace kill bindsym $plexmod+w {{workspace_switcher}} - {% for ws in eralitex_numbered_workspace_keymaps %} + {% for ws in i3_number_workspace_keymaps %} bindsym $plexmod+{{ws.keysym}} workspace "{{ws.workspace}}" {% endfor %} - {% for ws in eralitex_letter_workspace_keymaps %} + {% for ws in i3_letter_workspace_keymaps %} bindsym $plexmod+{{ws.keysym}} workspace "{{ws.workspace}}" {% endfor %} # focus workspace @@ -141,7 +153,7 @@ bindsym $mod+plus exec {{points_up_command}} mode "remote" { bindcode $mod+9 mode "default" - bindsym XF86Sleep exec {{eralitex_lock_command}} + bindsym XF86Sleep exec {{session_lock_command}} # The middle button over a titlebar kills the window bindsym --release button2 kill @@ -154,7 +166,7 @@ mode "remote" { ### Applications mode mode "apps" { -{% for a in eralitex_applications | dict2items %} +{% for a in application_shortcuts | dict2items %} bindsym {{a.key}} exec {{a.value}}; mode "default" {% endfor %} bindsym Escape mode "default" @@ -165,15 +177,15 @@ mode "apps" { ### Session mode "session" { bindsym q exit - bindsym r reload; exec --no-startup-id {{eralitex_directory}}/{{item}}/reload; mode "default"; {{on_focus_workspace}} - bindsym R reload; exec --no-startup-id {{eralitex_directory}}/{{item}}/reload; mode "default"; {{on_focus_workspace}} - bindsym s exec --no-startup-id {{eralitex_lock_command}}; exec --no-startup-{{eralitex_suspend_command}}; mode "default"; {{on_focus_workspace}} - bindsym x exec --no-startup-id {{eralitex_lock_command}}; mode "default"; {{on_focus_workspace}} - bindsym e exec --no-startup-id {{eralitex_enable_screensaver_command}}; mode "default"; {{on_focus_workspace}} - bindsym d exec --no-startup-id {{eralitex_disable_screensaver_command}}; mode "default"; {{on_focus_workspace}} + 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 {{session_lock_command}}; exec --no-startup {{system_suspend_command}}; mode "default"; {{on_focus_workspace}} + bindsym x 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 b exec --no-startup-id xsetroot -solid black; mode "default"; {{on_focus_workspace}} - bindsym Shift+R exec --no-startup-id {{eralitex_reboot_command}}; mode "default"; {{on_focus_workspace}} - bindsym Shift+P exec --no-startup-id {{eralitex_poweroff_command}}; 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}} # back to normal: Escape bindsym Escape mode "default"; {{on_focus_workspace}} @@ -182,10 +194,10 @@ mode "session" { ### Timer mode "timer" { - bindsym a exec "{{eralitex_directory}}/bin/timer activity"; mode "default"; {{on_focus_workspace}} - bindsym e exec "{{eralitex_directory}}/bin/timer end"; mode "default"; {{on_focus_workspace}} - bindsym r exec "{{eralitex_directory}}/bin/timer update"; mode "default"; {{on_focus_workspace}} - bindsym u exec "/opt/activity/activity 'Arbeit:Uniklinik Köln'"; mode "default"; {{on_focus_workspace}} + bindsym a exec "~/bin/timer activity"; mode "default"; {{on_focus_workspace}} + bindsym e exec "~/bin/timer end"; mode "default"; {{on_focus_workspace}} + bindsym r exec "~/bin/timer update"; mode "default"; {{on_focus_workspace}} + bindsym r exec "~/bin/timer uniklinik"; mode "default"; {{on_focus_workspace}} # back to normal: Escape bindsym Escape mode "default"; {{on_focus_workspace}} @@ -237,7 +249,7 @@ mode "move" { bindsym $right move right # move window to workspace -{% for ws in eralitex_numbered_workspace_keymaps %} +{% for ws in i3_number_workspace_keymaps %} bindsym {{ws.keysym}} move container to workspace "{{ws.workspace}}"; mode "default" {% endfor %} bindsym w exec fish -c "i3-msg move container to workspace (i3-msg -t get_workspaces | jq --raw-output '.[]|select(.num == -1).name' | rofi -dmenu -p 'move to workspace' )"; mode "default" @@ -308,7 +320,7 @@ bar { tray_output primary - status_command "i3blocks -c {{eralitex_directory}}/{{item}}/i3blocks.config" + status_command i3blocks colors { background #000000 @@ -316,15 +328,15 @@ bar { separator #666666 # - {% if item == "desktop" %} + {% if home_profile == "desktop" %} # lila: Farbton 274 focused_workspace #774C99 #552877 #ffffff {% endif %} - {% if item == "vdesk" %} + {% if home_profile == "vdesk" %} # grün: Farbton 110 focused_workspace #4D994C #357728 #ffffff {% endif %} - {% if item == "presentation" %} + {% if home_profile == "presentation" %} # gelb: Farbton 60 focused_workspace #99994C #777728 #ffffff {% endif %} @@ -340,15 +352,15 @@ bar { ### Design # class border backgr. text indicator child_border -{% if item == "desktop" %} +{% if home_profile == "desktop" %} # lila: Farbton 274 client.focused #784C99 #552877 #ffffff #9E2EF4 #552877 {% endif %} -{% if item == "vdesk" %} +{% if home_profile == "vdesk" %} # grün: Farbton 110 client.focused #59994C #357728 #ffffff #4FF42E #357728 {% endif %} -{% if item == "presentation" %} +{% if home_profile == "presentation" %} # gelb: Farbton 60 client.focused #99994C #777728 #ffffff #F4F42E #777728 {% endif %} @@ -373,6 +385,7 @@ focus_on_window_activation urgent ### Application specific rule for_window [class="^Vncviewer$"] border none +for_window [class="^TigerVNC Viewer$"] border none for_window [window_role="^About$"] floating enable for_window [class="^Pavu"] floating enable for_window [class="^Paman$"] floating enable @@ -383,11 +396,9 @@ for_window [class="^URxvt$" title="^tmux-workspace$"] border none ### Autostart -exec "{{eralitex_terminal}}" +exec "{{default_terminal}}" -{% if item == "desktop" %} -exec --no-startup-id "{{eralitex_directory}}/bin/i3-watchers" -{% endif %} +exec --no-startup-id "~/bin/i3-watchers" ### free keys # $mod+i diff --git a/templates/i3blocks.config.j2 b/templates/i3blocks.config.j2 index b7b4fd6..32e4fe7 100644 --- a/templates/i3blocks.config.j2 +++ b/templates/i3blocks.config.j2 @@ -30,7 +30,7 @@ command=/usr/share/i3blocks/$BLOCK_NAME separator_block_width=15 markup=none -{% if eralitex_with_activity %} +{% if with_activity %} # activity [activity] command=/opt/activity/i3blocks-activity diff --git a/templates/other-workspace-focus.fish.j2 b/templates/other-workspace-focus.fish.j2 deleted file mode 100644 index c05ead0..0000000 --- a/templates/other-workspace-focus.fish.j2 +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/fish -{{ ansible_managed | comment }} -i3-msg mode default diff --git a/templates/reload.sh.j2 b/templates/reload.sh.j2 deleted file mode 100644 index 7523caf..0000000 --- a/templates/reload.sh.j2 +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/fish - -# keymap -setxkbmap de -xmodmap {{eralitex_directory}}/Xmodmap -setxkbmap -option caps:hyper -xmodmap {{eralitex_directory}}/Xmodmap -xkbset nullify lock - -# background -xsetroot -solid black -{% if eralitex_background_image is defined %} -{{eralitex_background_command}} -{% endif %} - -# urxvt config -xrdb -merge {{eralitex_directory}}/urxvt.Xresources - -# rofi config -rofi -theme {{eralitex_directory}}/{{item}}/rofi.theme -dump-xresources | xrdb -merge - -# screensaver settings -/usr/local/bin/screensaver-settings diff --git a/templates/rofi.theme.j2 b/templates/rofi.theme.j2 index 79159be..ddd00bb 100644 --- a/templates/rofi.theme.j2 +++ b/templates/rofi.theme.j2 @@ -24,22 +24,22 @@ active-background: #6A6A6A; selected-urgent-background: #2f343a; - {% if item == "desktop" %} + {% if home_profile == "desktop" %} selected-normal-background: #552877; selected-active-background: #784C99; {% endif %} - {% if item == "vdesk" %} + {% if home_profile == "vdesk" %} selected-normal-background: #357728; selected-active-background: #59994C; {% endif %} - {% if item == "presentation" %} + {% if home_profile == "presentation" %} selected-normal-background: #99994C; selected-active-background: #777728; {% endif %} spacing: 2; - font: "Terminus 12"; + font: "monospace 10"; } #window { background-color: @background; diff --git a/templates/tigervnc.default.j2 b/templates/tigervnc.default.j2 new file mode 100644 index 0000000..52d7d9b --- /dev/null +++ b/templates/tigervnc.default.j2 @@ -0,0 +1,9 @@ +TigerVNC Configuration file Version 1.0 + +MenuKey=Pause +#AutoSelect=0 +#QualityLevel=0 +#FullColor=0 +#LowColorLevel=2 +#PreferredEncoding=Tight +#CompressLevel=0 diff --git a/templates/vdesk.service.j2 b/templates/vdesk.service.j2 index 35ca567..0cf84f9 100644 --- a/templates/vdesk.service.j2 +++ b/templates/vdesk.service.j2 @@ -11,17 +11,17 @@ # `loginctl enable-linger username` # # 3. The server can be enabled and started like this once configured: -# `systemctl --user start eralitex@:.service` -# `systemctl --user enable eralitex@:.service` +# `systemctl --user start vdesk@:.service` +# `systemctl --user enable vdesk@:.service` [Unit] -Description=eralitex vdesk service - display %i +Description=vdesk service - display %i After=syslog.target network.target [Service] Type=forking ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' -ExecStart=/usr/bin/fish -c "/usr/bin/vncserver -xstartup {{eralitex_directory}}/vdesk/xsession %i" +ExecStart=/usr/bin/fish -c "/usr/bin/vncserver -xstartup ~/.xsession.fish %i" ExecStop=/usr/bin/vncserver -kill %i [Install] diff --git a/templates/vnc-options.fish.j2 b/templates/vnc-options.fish.j2 deleted file mode 100644 index aaa2232..0000000 --- a/templates/vnc-options.fish.j2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/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 diff --git a/templates/remote-workspace-focus.fish.j2 b/templates/workspace.focus.fish.j2 similarity index 100% rename from templates/remote-workspace-focus.fish.j2 rename to templates/workspace.focus.fish.j2 diff --git a/templates/remote-workspace-space.fish.j2 b/templates/workspace.space.fish.j2 similarity index 88% rename from templates/remote-workspace-space.fish.j2 rename to templates/workspace.space.fish.j2 index ba836e7..17eb455 100644 --- a/templates/remote-workspace-space.fish.j2 +++ b/templates/workspace.space.fish.j2 @@ -1,8 +1,12 @@ #!/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 %} diff --git a/templates/xsession.sh.j2 b/templates/xsession.fish.j2 similarity index 56% rename from templates/xsession.sh.j2 rename to templates/xsession.fish.j2 index bb1f46f..2a15f7d 100644 --- a/templates/xsession.sh.j2 +++ b/templates/xsession.fish.j2 @@ -2,29 +2,27 @@ {{ ansible_managed | comment }} - - # set PATH so it includes users # private bin directory if it exists if test -d "$HOME/bin" set -x PATH "$HOME/bin:$PATH" end -# reload script -source {{eralitex_directory}}/{{item}}/reload +# xsession reload script +source ~/.xsession-reload.fish -{% if item != "vdesk" %} +{% if home_profile != "vdesk" %} blueman-applet & pasystray & nm-applet & {% endif %} -{% if item != "presentation" and item != "vdesk" %} +{% if home_profile != "presentation" and home_profile != "vdesk" %} /usr/local/bin/screensaver-start & {% endif %} -{% if item == "presentation" %} +{% if home_profile == "presentation" %} unclutter & {% endif %} -exec /usr/bin/i3 -c {{eralitex_directory}}/{{item}}/i3.config +exec /usr/bin/i3 diff --git a/templates/xsession.reload.fish.j2 b/templates/xsession.reload.fish.j2 new file mode 100644 index 0000000..1ea52c2 --- /dev/null +++ b/templates/xsession.reload.fish.j2 @@ -0,0 +1,23 @@ +#!/usr/bin/fish + +# keymap +setxkbmap de +xmodmap ~/.Xmodmap +setxkbmap -option caps:hyper +xmodmap ~/.Xmodmap +xkbset nullify lock + +# background +xsetroot -solid black +{% if background_image is defined %} +{{background_command}} +{% endif %} + +# Xresources +xrdb -merge ~/.Xresources + +# rofi +rofi -theme ~/.config/rofi/theme -dump-xresources > ~/.config/rofi/config + +# screensaver settings +/usr/local/bin/screensaver-settings diff --git a/vars/main.yaml b/vars/main.yaml index 4ff76c0..398cc55 100644 --- a/vars/main.yaml +++ b/vars/main.yaml @@ -1,9 +1,4 @@ -eralitex_profiles: - - desktop - - vdesk - - presentation - -eralitex_numbered_workspace_keymaps: +i3_number_workspace_keymaps: - keysym: 1 workspace: 1 - keysym: 2 @@ -50,7 +45,7 @@ eralitex_numbered_workspace_keymaps: workspace: 22 -eralitex_letter_workspace_keymaps: +i3_letter_workspace_keymaps: - keysym: a workspace: 23:a - keysym: b @@ -112,8 +107,8 @@ eralitex_letter_workspace_keymaps: - keysym: ssharp workspace: 52:ß -points_up_command: fish -c "echo (expr (cat ~/.eralitex/points) + 1 > ~/.eralitex/points) (i3-nagbar -m (cat ~/.eralitex/points)\ Ω)" -points_down_command: fish -c "echo (expr (cat ~/.eralitex/points) - 1 > ~/.eralitex/points) (i3-nagbar -m (cat ~/.eralitex/points)\ Ω)" +points_up_command: fish -c "echo (expr (cat ~/.points) + 1 > ~/.points) (rofi -m (cat ~/.points)\ Ω)" +points_down_command: fish -c "echo (expr (cat ~/.points) - 1 > ~/.points) (rofi -m (cat ~/.points)\ Ω)" -eralitex_background_image_path: "{{eralitex_directory}}/backgrounds/{{eralitex_background_image|basename}}" -eralitex_background_command: feh --no-fehbg --bg-fill {{eralitex_background_image_path}} +background_image_path: ~/.backgrounds/{{background_image|basename}} +background_command: feh --no-fehbg --bg-fill {{background_image_path}}