Skip to content

Commit

Permalink
Release v1.8.1 (#31)
Browse files Browse the repository at this point in the history
Allow Makefile default settings to be overridden by environment
variables; patch contributed by Ionic
  • Loading branch information
faf0 authored Jul 27, 2022
1 parent d3942ec commit 2a62dd4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
PROJECT: https://github.com/faf0/sct

1.8.1: Ionic and faf0 on 27 Jul 2022
* Allow Makefile default settings to be overridden by environment variables; patch
contributed by Ionic

1.8: faf0 on 01 Jun 2022
* Options --screen and --crtc added to select a specific screen and CRTC to use

Expand Down
57 changes: 24 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,37 @@ Original code was published by Ted Unangst in the public domain:
https://www.tedunangst.com/flak/post/sct-set-color-temperature

Minor modifications were made in order to get sct to:
- compile on Ubuntu 14.04
- compile on Ubuntu 14.04 and later releases
- iterate over all screens of the default display and change the color
temperature
- free the Display structure
- fix memleaks
- clean up code
- return EXIT_SUCCESS
- return `EXIT_SUCCESS`

# Installation

## Make-based

On UNIX-based systems, a convenient method of building this software is using
Make. Since the `Makefile` is simple and portable, both the BSD and
[GNU make](https://www.gnu.org/software/make/) variants will have no problems
parsing and executing it correctly.
On UNIX-based systems, a convenient method of building this software is using Make.
Since the `Makefile` is simple and portable, both the BSD and [GNU make](https://www.gnu.org/software/make/) variants will have no problems parsing and executing it correctly.

The simplest invocation is

~~~sh
make
~~~

which will use the default values for all flags as provided in the Makefile.

Overriding any of the following variables is supported by exporting a variable
with the same name and your desired content to the environment:

* `CC`
* `CFLAGS`
* `LDFLAGS`
* `PREFIX`
* `BIN` (the directory into which the resulting binary will be installed)
* `MAN` (the directory into which the man page will be installed)
* `INSTALL` (`install(1)` program used to create directories and copy files)

Both example calls are equivalent and will build the software with the
specified compiler and custom compiler flags:

that will use the default values for all flags as provided in the `Makefile`.

Overriding any of the following variables is supported by exporting a variable with the same name and your desired content to the environment:
* `CC`
* `CFLAGS`
* `LDFLAGS`
* `PREFIX`
* `BIN` (the directory into which the resulting binary will be installed)
* `MAN` (the directory into which the man page will be installed)
* `INSTALL` (`install(1)` program used to create directories and copy files)

Both example calls are equivalent and will build the software with the specified compiler and custom compiler flags:
~~~sh
make CC='clang' CFLAGS='-O2 -pipe -g3 -ggdb3' LDFLAGS='-L/very/special/directory -flto'
~~~
Expand All @@ -63,15 +55,12 @@ export LDFLAGS='-L/very/special/directory -flto'
make
~~~

Lastly, the software can be installed by calling

The software can be installed by running the following command:
~~~sh
make install
~~~

Or, if you prefer a different installation location, override the `PREFIX`
variable:

If you prefer a different installation location, override the `PREFIX` variable:
~~~sh
make install PREFIX="${HOME}/xsct-prefix"
~~~
Expand All @@ -88,9 +77,11 @@ Compile the code using the following command:
gcc -Wall -Wextra -Werror -pedantic -std=c99 -O2 -I /usr/X11R6/include xsct.c -o xsct -L /usr/X11R6/lib -lX11 -lXrandr -lm -s
~~~

Execute xsct using the following command:
# Usage

Provided that xsct binary is located in your `$PATH`, execute it using the following command:
~~~sh
./xsct 3700
xsct 3700
~~~

The first parameter (`3700` above) represents the color temperature.
Expand All @@ -108,12 +99,12 @@ The following options, which can be specified before the optional temperature pa

Test xsct using the following command:
~~~sh
./xsct 3700 && ./xsct
xsct 3700 && xsct
~~~

# Resources

The following website provides a table for the conversion between black-body temperatures and color pixel values:
The following website by Mitchell Charity provides a table for the conversion between black-body temperatures and color pixel values:
http://www.vendian.org/mncharity/dir3/blackbody/

---
Expand Down

4 comments on commit 2a62dd4

@zvezdochiot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @faf0 .

Add attach: sct-1.8.1.tar.xz in https://github.com/faf0/sct/releases/tag/1.8.1
Without this, statistics GitHub all releases do not work.

@faf0
Copy link
Owner Author

@faf0 faf0 commented on 2a62dd4 Jul 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing this to my attention, @zvezdochiot .

I ended up removing the downloads button, as there are no releases at the moment: 1bfe075

@zvezdochiot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @faf0 .

It was easier to add sct-1.8.1.tar.xz to the current release.

@faf0
Copy link
Owner Author

@faf0 faf0 commented on 2a62dd4 Jul 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that adding sct-1.8.1.tar.xz is easy. However, the download statistics won't reflect who just clones the repo and builds sct, which I think is the preferred workflow, unless the distribution comes with a packaged version already. Not sure if sct-1.8.1.tar.xz provides much value and it can get inconsistent with the actual code easily. To avoid this, a GitHub Actions workflow can create this file whenever a new release tag is added, but then again I think it's just easier to build the sct binary from the repo rather than the .tar.xz.

Please sign in to comment.