Skip to content

Commit bd02c17

Browse files
committed
update real world examples
1 parent 902c073 commit bd02c17

1 file changed

Lines changed: 54 additions & 6 deletions

File tree

README.md

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,66 @@ plz go ~/work/godot/ # cd's to ~/work/godot/ and lists the contents
287287
```
288288

289289
#### Real-world example
290-
Here is a real-world example of how I load my development environment for a <a href="https://godotengine.org/">Godot</a> project. In my global <code>.pls.yml</code> I have setup the following alias:
290+
Here are some real-world examples that show how I use `pls`.
291+
292+
##### Easy git clones
293+
294+
Using the alias below, I can easily clone any of my repositories by just running `pls clone <repo-name>`.
291295

292296
```yml
293-
- alias: godot
297+
- alias: clone
294298
command: |
295-
wezterm start --always-new-process -- bash -c "cd ~/work/godot/projects/tit-versus-tat && nvim .; exec zsh" &
296-
disown
297-
Godot_v4.2.2-stable_linux.x86_64 -e --path ~/work/godot/projects/tit-versus-tat/ --single-window &
299+
git clone git@github.com:codevogel/$1.git
300+
```
301+
302+
No more remembering the full git SSH URL, or having to copy-paste it from the browser!
303+
Expanding this further, I use the following alias to quickly clone repositories by other users than myself:
304+
305+
```yml
306+
- alias: clone-x
307+
command: |
308+
git clone git@github.com:$1/$2.git
309+
```
310+
##### Launching my TMUX sessions
311+
312+
After using `z` to jump to a project directory, I can quickly launch a default tmux session for that project by running `pls dev`:
313+
314+
```yml
315+
- alias: dev
316+
command: |
317+
~/startup/default
318+
```
319+
320+
This runs a tmux startup script defined in my [.dotfiles repository](https://github.com/codevogel/.dotfiles/blob/main/tmux/startup/default), which launches a tmux session with a few default windows, one running neovim, one running `lazygit`, and one running a shell.
321+
322+
##### Running and disowning processes
323+
324+
Sometimes I want to launch a GUI application from the terminal. But closing that very terminal would also close the application. We can use `disown` to prevent this from happening. But typing out the correct sequence of commands can become tedious. So, I created the following alias:
325+
326+
```yml
327+
- alias: se
328+
command: |
329+
$1 &
298330
disown
299331
exit
300332
```
301-
Now, whenever I sit down to work on my game, I just run `plz godot` and my project loads up, along with launching a new terminal with `nvim` open in the project directory.
333+
334+
Now, when I run `plz se <executable>`, it launched the executable, disowns it from the terminal, and closes the terminal.
335+
336+
##### Switching keyboard layouts
337+
338+
I usually type on a Sofle Choc, a split keyboard, which has CTRL and CAPS LOCK swapped in it's firmware. When I want to use my laptop keyboard, for example when I'm on the go, I need to swap these keys in software instead. I created the following alias to make this easy:
339+
340+
```yml
341+
- alias: keeb-split
342+
command: |
343+
sudo cat /etc/default/keyboard-split | sudo tee /etc/default/keyboard > /dev/null
344+
sudo dpkg-reconfigure keyboard-configuration
345+
- alias: keeb-laptop
346+
command: |
347+
sudo cat /etc/default/keyboard-laptop | sudo tee /etc/default/keyboard > /dev/null
348+
sudo dpkg-reconfigure keyboard-configuration
349+
```
302350

303351
## File format
304352

0 commit comments

Comments
 (0)