Skip to content

Commit

Permalink
Autostart xremap
Browse files Browse the repository at this point in the history
  • Loading branch information
granddaifuku committed Aug 16, 2024
1 parent 962d22f commit de73959
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .chezmoiscripts/run_once_after_00-installer.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ cargo install cargo-update
## xfce
if [ ! $(command -v xremap) ]; then
cargo install xremap --features x11
sudo mv ${CARGO_HOME}/bin/xremap /usr/local/bin
fi

{{ end -}}
Expand Down
16 changes: 7 additions & 9 deletions .chezmoiscripts/run_once_after_01-chores.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ mkdir -p ${XDG_DATA_HOME}/fonts/{Meslo,Noto}
(cd ${XDG_DATA_HOME}/fonts/Meslo && curl -fLO https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/Meslo/M/Regular/MesloLGMNerdFontMono-Regular.ttf)
fc-cache -v

## Run xremap automatically
# sudo cp ${XDG_CONFIG_HOME}/xremap/xremap.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl enable xremap.service

## Guard for CI
# if [ "$CI" != true ]; then
# sudo systemctl start xremap.service
# fi
# Run xremap automatically
if [ "$MY_ENV" != CI ]; then
sudo cp ${XDG_CONFIG_HOME}/xremap/xremap.service /etc/systemd/system/
xhost +SI:localuser:root
sudo systemctl daemon-reload
sudo systemctl start xremap.service
fi

if [ "$MY_ENV" = PERSONAL ]; then
sudo systemctl start docker
Expand Down
6 changes: 4 additions & 2 deletions private_dot_config/xremap/xremap.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ Description=xremap

[Service]
KillMode=process
ExecStart=/home/granddaifuku/.local/share/cargo/bin/xremap --watch=config /home/granddaifuku/.config/xremap/config.yml
ExecStart=/usr/local/bin/xremap --watch=config /home/granddaifuku/.config/xremap/config.yml
Type=simple
Restart=always
User=root
Group=root

[Install]
WantedBy=default.target
WantedBy=default.target

0 comments on commit de73959

Please sign in to comment.