Skip to content

Commit

Permalink
Give load function better output
Browse files Browse the repository at this point in the history
Also improve commenting in autoload and update README
  • Loading branch information
rliou92 committed May 27, 2018
1 parent 703c527 commit 7bc02e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ home you plug in an external monitor, and you want to save that configuration as
```
# With only the laptop screen (no external monitors)
$ umonitor --save home
Unknown profile*
---------------------------------
Profile home saved!
# Plug in external monitor
# Setup your desired configuration
Expand All @@ -45,10 +44,8 @@ $ xrandr --output eDP1 --mode 1600x900 --pos 0x0
# Save the current configuration into a profile
$ umonitor --save docked
home
Unknown profile*
---------------------------------
Profile docked saved!
# Begin autodetecting changes in monitor
$ umonitor --listen
home
Expand Down Expand Up @@ -84,19 +81,22 @@ I think a couple people are using this program. Give me some feedback!
* Rotation
* Daemonizes when called with `--listen`
* Prevents saving of duplicate profiles
* Valgrind clean

Future improvements:

<!-- TODO prevent loading of outputs that don't exist in the setup -->
<!-- TODO view profile contents -->
<!-- TODO improve load output (Profile xxxx loaded!) -->
<!-- TODO valgrind load, autoload -->
<!--* Implement debug as compile option -->
<!-- * Encoding of resolution -->
* Use valgrind to check for memory errors
<!-- * More commandline options
* Alternate configuration file location? -->
<!-- * Handling the case when multiple outputs are connected to same crtc? -->
* Bugs:
* Tell me! Run umonitor with the `--verbose` flag to get debugging output
* After load the outputs display extra return character
* After load the output displays an extra unknown character
<!--* Updating Doxygen documentation? -->

I'm open for any feature requests!
Expand Down
2 changes: 1 addition & 1 deletion src/autoload.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void get_profile_found(autoload_class * self, int * profile_found, const

/*! \brief Find which profile matches the current setup and conditionally load it
Also prints out the list of configurations along with the current configuration.
Also conditionally prints out the list of configurations along with the current configuration.
The current configuration is either the current configuration (applying no
settings), or the newly loaded configuration. */

Expand Down
5 changes: 4 additions & 1 deletion src/umonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ static void start_load(char *profile_name)
load_o->load_profile(load_o, profile_group, 0);
load_class_destructor(load_o);

print_state("Profile %s loaded!\n", profile_name);
print_state("---------------------------------\n");

}

static void start_delete_and_save(save_or_delete_t save_or_delete,
Expand Down Expand Up @@ -338,7 +341,7 @@ static void start_autoload()
if (!config_read_file(&config, CONFIG_FILE))
exit(NO_CONF_FILE_FOUND);
autoload_constructor(&autoload_o, &screen_o, &config);
autoload_o->find_profile_and_load(autoload_o, LOAD, NO_PRINT);
autoload_o->find_profile_and_load(autoload_o, LOAD, PRINT);
autoload_destructor(autoload_o);

}
Expand Down

0 comments on commit 7bc02e4

Please # to comment.