نقل قول:اریک ریموند
امین | دوشنبه ۱۸ دی ۱۳۹۶
ffmpeg -i '/path-to-sound-file/startup.mp3' '/path-to-sound-file/startup.wav' |
aplay '/usr/share/sounds/win7/startup.wav' |
sudo gedit /etc/systemd/system/shutdown-sound.service -------------------------------- [Unit] Description=Play sound before shutdown [Service] Type=oneshot RemainAfterExit=true ExecStop=/usr/local/bin/sound-shutdown [Install] WantedBy=multi-user.target |
sudo systemctl enable shutdown-sound sudo systemctl start shutdown-sound |
sudo gedit /usr/local/bin/sound-shutdown ------------------------------- #!/bin/bash aplay '/usr/share/sounds/win7/shutdown.wav' |
sudo gedit /etc/gdm/PostSession/Default ------------------------------- #!/bin/sh aplay '/usr/share/sounds/win7/logout.wav' exit 0 |
sudo gedit /usr/local/bin/sound-unlock ------------------------------- #!/bin/bash dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" | while read x; do case "$x" in *"boolean true"*) aplay '/usr/share/sounds/win7/lock.wav' ;; *"boolean false"*) aplay '/usr/share/sounds/win7/unlock.wav' ;; esac done |
1. sudo pacman -S acpid 2. sudo systemctl enable acpid 3. sudo systemctl start acpid |
sudo gedit /etc/acpi/events/lidopen ----------------------------- event=button/lid LID open action=/usr/local/bin/sound-lidopen |
#!/bin/bash #This runs so that root can run the following command under the user's environment source /home/amin/.Xdbus #play a open sound DISPLAY=:0.0 su amin -c "aplay '/usr/share/sounds/win7/lidopen.wav'" |
#!/bin/sh touch $HOME/.Xdbus chmod 600 $HOME/.Xdbus env | grep DBUS_SESSION_BUS_ADDRESS > $HOME/.Xdbus echo 'export DBUS_SESSION_BUS_ADDRESS' >> $HOME/.Xdbus exit 0 |
# automatically switch to newly-connected devices load-module module-switch-on-connect |
-------------------------------------------------------- sudo gedit /etc/systemd/system/suspend-to-hibernate.service -------------------------------------------------------- [Unit] Description=Delayed hibernation trigger Documentation=https://bbs.archlinux.org/viewtopic.php?pid=1420279#p1420279 Documentation=https://wiki.archlinux.org/index.php/Power_management Conflicts=hibernate.target hybrid-sleep.target Before=sleep.target StopWhenUnneeded=true [Service] Type=oneshot RemainAfterExit=yes Environment="WAKEALARM=/sys/class/rtc/rtc0/wakealarm" Environment="SLEEPLENGTH=+2hour" ExecStart=-/usr/bin/sh -c 'echo -n "alarm set for "; date +%%s -d$SLEEPLENGTH | tee $WAKEALARM' ExecStop=-/usr/bin/sh -c '\ alarm=$(cat $WAKEALARM); \ now=$(date +%%s); \ if [ -z "$alarm" ] || [ "$now" -ge "$alarm" ]; then \ echo "hibernate triggered"; \ systemctl hibernate; \ else \ echo "normal wakeup"; \ fi; \ echo 0 > $WAKEALARM; \ ' [Install] WantedBy=sleep.target |
1. sudo systemctl enable disable-usb-wakeup.service 2. sudo systemctl start disable-usb-wakeup.service |
-------------------------------------------------------- sudo nano /etc/systemd/system/disable-usb-wakeup.service -------------------------------------------------------- [Unit] Description=Disable USB wakeup triggers in /proc/acpi/wakeup [Service] Type=oneshot ExecStart=/bin/sh -c "echo XHC > /proc/acpi/wakeup; echo WLAN > /proc/acpi/wakeup" ExecStop=/bin/sh -c "echo XHC > /proc/acpi/wakeup; echo WLAN > /proc/acpi/wakeup" RemainAfterExit=yes [Install] WantedBy=multi-user.target |
1. sudo systemctl enable disable-usb-wakeup.service 2. sudo systemctl start disable-usb-wakeup.service |
$chmod /mnt |
$cd home |
sudo pacman -S vlc |
sudo apt install vlc |
vlc -I ncurses |
vlc -I ncurses 1.mp3 |