Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create example hookscripts #16

Closed
2 tasks
dorianim opened this issue May 26, 2021 · 4 comments
Closed
2 tasks

Create example hookscripts #16

dorianim opened this issue May 26, 2021 · 4 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@dorianim
Copy link
Member

dorianim commented May 26, 2021

Create some example hook scripts for common tasks and publish them in the wiki.
Scripts should be created for:

  • Persistent profile storage on the server
  • Setting wallpaper from server

More ideas are welcome :)

@dorianim dorianim added documentation Improvements or additions to documentation help wanted Extra attention is needed labels May 26, 2021
@dorianim
Copy link
Member Author

dorianim commented Jul 20, 2021

This is an example on how to create static links of the following directories to the server home: Dokumente, Bilder, Musik, Videos, Downloads

# link dirs to server
for dir in Dokumente Musik Bilder Videos Downloads
do
  rmdir $HOME/$dir 2> /dev/null
  mkdir "$SERVERHOME/$dir" 2> /dev/null
  ln -sfn "$SERVERHOME/$dir" "$HOME/$dir"
done

This can be placed as a standalone script in the /etc/linuxmusterLinuxclient7/onLogin.d hookdir. Alternatively, it can also be appended to the server side logon hook: /var/lib/samba/sysvol/linuxmuster.lan/scripts/default-school/custom/linux/logon.sh.

@lawilfried
Copy link

My goal was a symbolic link on the desktop that leads directly to the user's home directory. At first I installed the gnome-extension "desktop-icons" with the browser and turned the extension on. Then I closed the browser. With a right click on the Desktop one get a window with settings. The second point offers the possibility to stop showing the home of linuxadmin on the desktop. After this there is a good place for the symbolic link in the upper left corner of the desktop.
And this is the "script" (it's only one line!) in the /etc/linuxmusterLinuxclient7/onLogin.d, called "testhome.sh":

#!/bin/bash
ln -sfn "$SERVERHOME"  "$HOME/Schreibtisch/§USER"

@lawilfried
Copy link

This script enables a user to save his own settings in his home directory on the server. In this case you can save settings for the Firefox application, e.g. bookmarks. For the first time it is necessary that there is no directory with previous settings and no symlink either. Please delete it before the script runs for the first time. The right place for the script is here: /etc/linuxmusterLinuxclient7/onLogin.d
The content is based on the work of the developers of linuxmuster and Dominik Förderer.

#!/bin/bash

# firefox profile on user share
if [ -d "$SERVERHOME/Einstellungen/firefox" ]; then            
    rm -rf "$HOME/.mozilla/firefox"                             
    ln -s "$SERVERHOME/Einstellungen/firefox" "$HOME/.mozilla/" 
else
    mkdir -p "$SERVERHOME/Einstellungen/firefox"               
    mv "$HOME/.mozilla/firefox" "$SERVERHOME/Einstellungen/"    
    ln -s "$SERVERHOME/Einstellungen/firefox" "$HOME/.mozilla/" 
fi

The script can be a template for other applications.

@dorianim dorianim pinned this issue Sep 5, 2022
@dorianim
Copy link
Member Author

dorianim commented Sep 5, 2022

This will be handled by "plugins" in the future. @lawilfried feel free to create pull requests to add your snippets as plugins :)

See the wiki over here: https://github.com/linuxmuster/linuxmuster-linuxclient7/wiki/About-plugins

Once there are more than 10 plugins, I may create a tool to install them, something like linuxmuster-linuxclient7 install-plugin conky

@dorianim dorianim closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants