mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-21 22:02:15 +03:00
crate pulseaudio autostart file while opening user session on default_policy module
This commit is contained in:
parent
5f092a86d7
commit
423faea01a
4 changed files with 27 additions and 2 deletions
|
@ -142,6 +142,7 @@ class CommandRunner(object):
|
|||
self.logger.info("Applying default policies for user {0}".format(Util.get_username()))
|
||||
self.default_policy.default_firefox_policy(Util.get_username())
|
||||
self.default_policy.disable_update_package_notify(Util.get_username())
|
||||
self.default_policy.create_pulseaudio_autostart()
|
||||
# Default policy for users --->> STOP
|
||||
|
||||
get_policy_message = self.message_manager.policy_request_msg(username)
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Name=sesbaslat
|
||||
Comment=Start the PulseAudio Sound System
|
||||
Exec=sh -c 'killall pulseaudio; sleep 3; pulseaudio --start'
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=
|
||||
GenericName=
|
||||
X-GNOME-Autostart-Phase=Initialization
|
||||
X-KDE-autostart-phase=1
|
|
@ -134,4 +134,18 @@ class DefaultPolicy:
|
|||
new_element.attrib["value"] = app_name_for_blocking
|
||||
tree.write(fileName)
|
||||
else:
|
||||
self.logger.info("'" + app_name_for_blocking + "' is already added to muted_applications tag.")
|
||||
self.logger.info("'" + app_name_for_blocking + "' is already added to muted_applications tag.")
|
||||
|
||||
# create pulseaudio autostart file while user opening session
|
||||
def create_pulseaudio_autostart(self):
|
||||
pulseaudio_des_path = "/etc/xdg/autostart/ahenk.pulseaudio.start.desktop"
|
||||
pulseaudio_src_path = "/usr/share/ahenk/base/default_policy/config-files/ahenk.pulseaudio.start.desktop"
|
||||
pulseaudio_old_file = "/etc/xdg/autostart/ahenk.pulseaudio.desktop"
|
||||
if Util.is_exist(pulseaudio_old_file):
|
||||
Util.delete_file(pulseaudio_old_file)
|
||||
|
||||
if not Util.is_exist(pulseaudio_des_path):
|
||||
Util.copy_file(pulseaudio_src_path, pulseaudio_des_path)
|
||||
self.logger.info("Copy pulseaudio autostart file")
|
||||
else:
|
||||
self.logger.info("Pulseaudio autostart file already exist")
|
||||
|
|
|
@ -151,7 +151,7 @@ class Registration:
|
|||
self.install_and_config_ad(reg_reply)
|
||||
self.change_permissions_for_local_users()
|
||||
|
||||
self.create_ahenk_pulseaudio_desktop_file()
|
||||
# self.create_ahenk_pulseaudio_desktop_file()
|
||||
|
||||
except Exception as e:
|
||||
self.logger.error('Registration error. Error Message: {0}.'.format(str(e)))
|
||||
|
|
Loading…
Reference in a new issue