Skip to content

Commit

Permalink
update: startup script
Browse files Browse the repository at this point in the history
  • Loading branch information
wickes1 committed Sep 25, 2022
1 parent 8dbd220 commit 68a0a67
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ home_dotfiles:
- zsh/.p10k.zsh
- zsh/.keybindsrc
- zsh/.scripts.sh
home_scripts:
- zsh/.startup.sh
python:
pyenv_version: 3.10.4
Expand Down
19 changes: 19 additions & 0 deletions roles/base/files/zsh/.startup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@

# === Setup Environment ===
# load zshrc
source $HOME/.zshrc

# set extra env
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
export DISPLAY=:0.0

# === Startup Command ===
# welcome words
notify-send 'hello wolrd'

# auto hide mouse cursor
unclutter -idle 10 &

# go app update
gup update

# goodby words
notify-send 'goodbye wolrd'
18 changes: 17 additions & 1 deletion roles/base/tasks/dotfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,27 @@
- dotfiles
- dotfiles-home

- name: Copy home scripts
copy:
src: "{{ item }}"
dest: /home/{{ username }}/
force: True
owner: "{{ username }}"
group: "{{ username }}"
mode: 0777
with_items: "{{ home_scripts }}"
become: yes
tags:
- startup
- crontab
- dotfiles
- dotfiles-home

- name: Setup crontab job
ansible.builtin.cron:
name: "start up scripts"
special_time: reboot
job: /home/{{ username }}/.startup.sh
job: sleep 10; /usr/bin/zsh /home/{{ username }}/.startup.sh
tags:
- startup
- crontab
Expand Down

0 comments on commit 68a0a67

Please sign in to comment.