tagged codeblocks with language

master
Rachel Lambda Samuelsson 2022-01-27 20:29:29 +01:00
parent d46ddf9a7a
commit 890cc7f928
2 changed files with 7 additions and 7 deletions

View File

@ -48,7 +48,7 @@ $(full_name): $(in_files)
Here I used some special macros, the `$(CC)` macro is used to let users specify their preferred C compiler in the `CC` environment variable, if it is not set it will default to `cc` or `c99`. This is preferable to hard coding `gcc`, `clang`, or whatever compiler you might use since not everyone will use the same tools as you. The `$(CFLAGS)` macro is added to let the user specify flags to send to the C compiler in their `CFLAGS` environment variable. Lastly, and maybe most importantly, the `$@` macro evaluates to the name of the current target, which in this case is `$(full_name)`, which in turn evaluates to `hello_world`. Ultimately this target will run the following shell:
```
```sh
cc -o hello_world hello.o world.o
```
@ -63,7 +63,7 @@ world.o: world.c
Now running make will run the following:
```
```sh
cc -c -o hello.o hello.c
cc -c -o world.o world.c
cc -o hello_world hello.o world.o
@ -71,7 +71,7 @@ cc -o hello_world hello.o world.o
Now make knows how to make our full `hello_world` program, but why do we specify that `hello.o` depends on `hello.c`? We write the source ourselves, so surely there is no need to tell make this? Well, the beauty of make is that it checks the last edited date of depends to rebuild targets. In other words, if we edit hello.c and rerun make it will only run the following:
```
```sh
cc -c -o hello.o hello.c
cc -o hello_world hello.o world.o
```

View File

@ -31,7 +31,7 @@ Xft.dpi: 144
If you're using xinit/startx you'll also want to add this to your xinitrc (if it's not already there).
```
```sh
xrdb -merge "$HOME/.Xresources"
```
@ -41,7 +41,7 @@ Note that you might not need this as some desktop environments handle this autom
Long story short, many other people have written, bad, half working scripts. I've hacked together these and written a, less bad, working script.
```
```sh
#!/bin/sh -e
# Auto rotate screen based on device orientation
@ -98,7 +98,7 @@ done
```
To use this make sure to install iio-sensor-proxy, and then edit this line
```
```sh
DNAME=eDP1
```
to the name listed as connected by the output of the `xrandr` command.
@ -106,6 +106,6 @@ to the name listed as connected by the output of the `xrandr` command.
Then mark the file as executable and add it to your autostart.
If your wallpaper looks weird after rotating you can edit the script, adding a line which re-sets your wallpaper after this line.
```
```sh
xrandr --output "$DNAME" --rotate "$NEW_ROT"
```