first commit

This commit is contained in:
Steam Deck User 2023-12-03 23:09:45 +01:00
commit ccdfad78bf
9 changed files with 162 additions and 0 deletions

8
README.md Normal file
View File

@ -0,0 +1,8 @@
__Features:__
Installation script which configures gstreamer and sudoers on SteamDeck to archieve posibility to record gameplay and enable/disable additional 8GB swap space, via button in Decky bash-shortcut extension.
All of this can work only, when you have this repository in /home/deck/steamdeck-mm folder!!! So, clone it into this folder via: "cd /home/deck && git clone https://git.my-web.xyz/milan/steamdeck-mm.git"
__THE PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.__
__IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW THE AUTHOR WILL BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.__

2
deck_swap_sudoers_file Normal file
View File

@ -0,0 +1,2 @@
Cmnd_Alias SWAP_CMDS = /usr/bin/dd if=/dev/zero of=/home/swapfile2 bs=1G count=8, /usr/bin/chmod 0600 /home/swapfile2, /usr/bin/mkswap /home/swapfile2, /usr/bin/swapon /home/swapfile2, /usr/bin/swapoff /home/swapfile2, /usr/bin/rm /home/swapfile2
deck ALL=(ALL) NOPASSWD: SWAP_CMDS

6
disable-secondary-swap Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
sudo /usr/bin/swapoff /home/swapfile2
sudo /usr/bin/rm /home/swapfile2
read -p "Done, press any key to continue"

13
enable-secondary-swap Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
if [ -f /home/swapfile2 ]; then
echo "Secondary swap exists, exitting"
exit 1
fi
sudo /usr/bin/dd if=/dev/zero of=/home/swapfile2 bs=1G count=8
sudo /usr/bin/chmod 0600 /home/swapfile2
sudo /usr/bin/mkswap /home/swapfile2
sudo /usr/bin/swapon /home/swapfile2
read -p "Done, press any key to continue"

15
record Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
date_var=$(date "+%Y-%m-%d %H %M")
nice --20 gst-launch-1.0 -e \
pipewiresrc do-timestamp=True \
! queue \
! videoconvert \
! queue \
! vaapih264enc \
! h264parse \
! mux. \
pulsesrc device="alsa_output.pci-0000_04_00.5-platform-acp5x_mach.0.HiFi__hw_acp5x_1__sink.monitor" \
! queue \
! mux. \
matroskamux name=mux \
! filesink location=/home/deck/Videos/"$date_var".mkv

15
record-hdmi Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
date_var=$(date "+%Y-%m-%d %H %M")
nice --20 gst-launch-1.0 -e \
pipewiresrc do-timestamp=True \
! queue \
! videoconvert \
! queue \
! vaapih264enc \
! h264parse \
! mux. \
pulsesrc device="alsa_output.pci-0000_04_00.1.hdmi-stereo-extra2.monitor" \
! queue \
! mux. \
matroskamux name=mux \
! filesink location=/home/deck/Videos/"$date_var".mkv

3
record-stop Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
killall -2 gst-launch-1.0
read -p "Done, press any key to continue"

14
setup-deck-mm Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
steamos-readonly disable
pacman-key --init
pacman-key --populate archlinux holo
pacman -Syy
pacman -S wireguard-tools screen gstreamer-vaapi gst-plugin-pipewire gst-plugins-good mc htop gst-plugins-base --noconfirm --overwrite "*"
cp /home/deck/steamdeck-mm/deck_swap_sudoers_file /etc/sudoers.d/zzz_deck_swap
chown root:root /etc/sudoers.d/zzz_deck_swap
chmod 0400 /etc/sudoers.d/zzz_deck_swap
rsync -avrz --progress /home/deck/steamdeck-mm/shortcuts.json /home/deck/homebrew/settings/bash-shortcuts/bash-shortcuts.json
systemctl enable sshd
steamos-readonly enable
echo "Please reboot SteamDeck"

86
shortcuts.json Normal file
View File

@ -0,0 +1,86 @@
{
"shortcuts": {
"fcba1cb4-4601-45d8-b919-515d152c56ef": {
"id": "fcba1cb4-4601-45d8-b919-515d152c56ef",
"name": "Record",
"cmd": "konsole -e /home/deck/steamdeck-mm/record",
"position": 1,
"isApp": true,
"hooks": [],
"passFlags": false
},
"85efd29c-1cc6-42ae-80af-0b62585411e0": {
"id": "85efd29c-1cc6-42ae-80af-0b62585411e0",
"name": "Record-HDMI",
"cmd": "konsole -e /home/deck/steamdeck-mm/record-hdmi",
"position": 3,
"isApp": true,
"passFlags": false,
"hooks": []
},
"cd07cba2-c282-4b80-b901-597fffe4d707": {
"id": "cd07cba2-c282-4b80-b901-597fffe4d707",
"name": "Record-Stop",
"cmd": "konsole -e /home/deck/steamdeck-mm/record-stop",
"position": 5,
"isApp": true,
"hooks": [],
"passFlags": false
},
"67309e04-e481-4453-bf45-5010dd69a098": {
"id": "67309e04-e481-4453-bf45-5010dd69a098",
"name": "Konsole",
"cmd": "konsole",
"position": 8,
"isApp": true,
"hooks": [],
"passFlags": false
},
"aac7936d-d78d-4398-a8bf-1926eceb78d1": {
"id": "aac7936d-d78d-4398-a8bf-1926eceb78d1",
"name": "Discover",
"cmd": "plasma-discover",
"position": 9,
"isApp": true,
"hooks": [],
"passFlags": false
},
"b11c9c11-e323-4f6c-bdcc-5b9bb8e46a8a": {
"id": "b11c9c11-e323-4f6c-bdcc-5b9bb8e46a8a",
"name": "Dolphin",
"cmd": "dolphin",
"position": 10,
"isApp": true,
"hooks": [],
"passFlags": false
},
"97bf46d9-11a7-4af8-8186-985f97bae40b": {
"id": "97bf46d9-11a7-4af8-8186-985f97bae40b",
"name": "Clean-Videos",
"cmd": "konsole -e /home/deck/steamdeck-mm/clean-videos-folder",
"position": 13,
"isApp": true,
"hooks": [],
"passFlags": false
},
"c063b908-1ff3-4d66-a3e5-04fa16e0d9d0": {
"id": "c063b908-1ff3-4d66-a3e5-04fa16e0d9d0",
"name": "Enable-Secondary-Swap",
"cmd": "konsole -e /home/deck/steamdeck-mm/enable-secondary-swap",
"position": 15,
"isApp": true,
"passFlags": false,
"hooks": []
},
"99376e41-1f58-43ac-8ace-1028629a599f": {
"id": "99376e41-1f58-43ac-8ace-1028629a599f",
"name": "Disable-Secondary-Swap",
"cmd": "konsole -e /home/deck/steamdeck-mm/disable-secondary-swap",
"position": 16,
"isApp": true,
"passFlags": false,
"hooks": []
}
},
"webSocketPort": "5000"
}