Skip to content

Commit

Permalink
Final installer
Browse files Browse the repository at this point in the history
Uninstallation method in README
  • Loading branch information
PaulCoral committed Jan 22, 2019
1 parent 9e424aa commit fdbdc48
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ You can easily use the nightlight mode with gnome desktops.

Easy installation

Go in the downloaded folder
Add the execution privileges to the installer.sh file (chmod u+x installer.sh)
Run the installer.sh and follow the instruction
Now you can switch the NightLight mode with Ctrl+Shift+L or your custom shortcut.
- Go in the downloaded folder
- Add the execution privileges to the installer.sh file (chmod u+x installer.sh)
- Run the installer.sh and follow the instruction
- Now you can switch the NightLight mode with Ctrl+Shift+L or your custom shortcut.


Hard Installation method (In case of issues)
Expand All @@ -19,6 +19,12 @@ It is very pleasant to use with shortcuts:
- (Easy)Go to Display Settings, at the bottom you should see "Night Light". Set the hour from 00:00 to 23:59.
(Advanced)You can also download the dconf editor and go to "org/gnome/settings-daemon/plugins/color/". Then set "night-light-schedule-from=0 and night-light-schedule-to=24.

/\/Modify the shortcut in Gnome settings under the keyboard tab\/\

Project creator : Paul Coral
Remove
- remove the .CoPaScripts in your home directory
- remove the shortcut in the gnome settings under the keyboard tab
- (an uninstaller.sh will be provided in the future)


------------------Project creator : Paul Coral----------------------------------
22 changes: 12 additions & 10 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-from
gsettings set org.gnome.settings-daemon.plugins.color night-light-schedule-to 24

#Adding a new custom keyboard shortcut
firstlist = $(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)
firstlist=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)

echo '$firstlist
echo "$firstlist
Enter the number of the last custom shortcut'
Enter the number of the last custom shortcut .../custom{NUMBER}/']'"
read lastcustom

sure=$true
Expand All @@ -41,9 +41,11 @@ while [[ $sure ]]; do
fi
done

lastcustom=$(($lastcustom+1))

addedString=", '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom"$lastcustom"/']"
firstlist = ${firstlist:0:-1}$addedString
echo firstlist
firstlist=${firstlist:0:-1}$addedString
echo "$firstlist"

echo "Change would be added.
Press Ctrl+C if you want to leave or Press Enter to continue..."
Expand All @@ -52,12 +54,12 @@ read lol
sure=true
while [[ $sure ]]; do
echo "By default the shortcut would be Ctrl+Shift+L
Do you want modify it? A shortcut code will be asked. (yes/no)"
Do you want modify it? A shortcut code will be asked. (yes/no)"
read response

if [[ $response="no" ]]; then
sure=$false
shortcutcode= "<Shift><Control>l"
shortcutcode="<Shift><Control>l"
elif [[ $response="yes" ]]; then
echo 'Enter the custom shortcut code'
read shortcutcode
Expand All @@ -67,14 +69,14 @@ done
echo "You will be able to modify the shortcut in the Gnome settings"

#Making the change
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings $firstlist

gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "$firstlist"
read lolll
#configuring the shortcut
echo "Enter the shortcut name"
read shortcutname
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom"$lastcustom"/ name "$shortcutname"

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom"$lastcustom"/ command '~/.CoPaScripts/Night-Light-Switch-Script-Gnome/nightLight.sh'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom"$lastcustom"/ command "/home/$USER/.CoPaScripts/Night-Light-Switch-Script-Gnome/nightLight.sh"

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom"$lastcustom"/ binding "$shortcutcode"

Expand Down

0 comments on commit fdbdc48

Please sign in to comment.