diff --git a/actions.py b/actions.py --- a/actions.py +++ b/actions.py @@ -4,16 +4,18 @@ from pisi.actionsapi import get - def install(): def do_chmod(path, mode): - path = "%s/%s" %(get.installDIR(), path) + path = "%s/%s" % (get.installDIR(), path) shelltools.chmod(path, mode=mode) # Install everything pisitools.insinto("/", "root/*") - for dire in ["/tmp", "/var/tmp", "/dev", "/usr/lib64", "/lib64", "/proc", "/sys", "/run/lock", "/root", "/home", "/run", "/media"]: + for dire in [ + "/tmp", "/var/tmp", "/dev", "/usr/lib64", "/lib64", "/proc", + "/sys", "/run/lock", "/root", "/home", "/run", "/media" + ]: pisitools.dodir(dire) # Adjust permissions @@ -35,9 +37,12 @@ pisitools.dosym("/proc/self/mounts", "/etc/mtab") # Write out a default .profile.. temporary - shelltools.echo("%s/etc/skel/.profile" % get.installDIR(), "source /usr/share/defaults/etc/profile") - shelltools.echo("%s/etc/skel/.bashrc" % get.installDIR(), "source /usr/share/defaults/etc/profile") - shelltools.echo("%s/etc/nsswitch.conf" % get.installDIR(), "hosts: files dns") + shelltools.echo("%s/etc/skel/.profile" % get.installDIR(), + "source /usr/share/defaults/etc/profile") + shelltools.echo("%s/etc/skel/.bashrc" % get.installDIR(), + "source /usr/share/defaults/etc/profile") + shelltools.echo("%s/etc/nsswitch.conf" % get.installDIR(), + "hosts: files dns") # Remove legacy boot link pisitools.remove("/boot/boot") diff --git a/files/system-xprofile b/files/system-xprofile new file mode 100644 --- /dev/null +++ b/files/system-xprofile @@ -0,0 +1,39 @@ +#!/bin/sh + +# A sample xprofile for setting up X user session. + +# NB: Loading xkbmap and xmodmap files does not take effect on Budgie and GNOME desktop environments +# since gnome-session overwrites user's keymaps later. A workaround is to create a setkeymaps.desktop +# file in ~/.config/autostart to load these files after X session starts. The following is a sample of +# setkeymaps.dekstop: +# +# [Desktop Entry] +# Type=Application +# Name=setkeymaps +# Description=Setting up keymaps for X session +# Exec=bash -c "/usr/bin/xmodmap ~/.Xmodmap" + +# Load keymaps +if command -v setxkbmap >/dev/null 2>&1; then + for file in "/etc/X11/Xkbmap" "$HOME/.Xkbmap"; do + if [ -f "$file" ]; then + echo "Loading keymap: $file" + setxkbmap $(cat "$file") + XKB_IN_USE=yes + fi + done + unset file +fi + +# Load xmodmap if not using XKB +if [ -z "$XKB_IN_USE" ] && command -v xmodmap >/dev/null 2>&1; then + for file in "/etc/X11/Xmodmap" "$HOME/.Xmodmap"; do + if [ -f "$file" ]; then + echo "Loading modmap: $file" + xmodmap "$file" + fi + done + unset file +fi + +unset XKB_IN_USE diff --git a/files/user-xprofile b/files/user-xprofile new file mode 100644 --- /dev/null +++ b/files/user-xprofile @@ -0,0 +1,3 @@ +#!/bin/sh + +# This file is sourced by display managers before the X user session starts. diff --git a/pspec.xml b/pspec.xml --- a/pspec.xml +++ b/pspec.xml @@ -45,6 +45,8 @@ services protocols nsswitch.conf + system-xprofile + user-xprofile System.Package @@ -53,6 +55,14 @@ + + 06-04-2020 + 1.8.0 + Package bump + Longwu Ou + xulongwu4@gmail.com + + 01-24-2020 1.8.0 @@ -548,4 +558,4 @@ ikey@solusos.com - \ No newline at end of file +