소스 검색

remove game launchers, update shift-jis uz, waybar, and disable
automatic updates

Casey DeLorme 1 년 전
부모
커밋
0b7b92dc53
7개의 변경된 파일57개의 추가작업 그리고 91개의 파일을 삭제
  1. 1 1
      arch.sh
  2. 1 0
      install/etc/skel/.config/waybar/config
  3. 0 13
      install/usr/local/bin/genshin-impact
  4. 0 50
      install/usr/local/bin/mh
  5. 0 2
      install/usr/local/bin/mhrise
  6. 53 25
      install/usr/local/bin/uz
  7. 2 0
      notes/games/vr/valve-index.md

+ 1 - 1
arch.sh

@@ -240,7 +240,7 @@ if [ ! -f "/etc/systemd/system/transmission.service.d/local.conf" ]; then
 fi
 
 # symlink shceduled maintenance tasks
-ln -sf /usr/local/bin/system-updates /etc/cron.daily/system-updates
+#ln -sf /usr/local/bin/system-updates /etc/cron.daily/system-updates
 ln -sf /usr/local/bin/disk-maintenance /etc/cron.weekly/disk-maintenance
 
 # symlink override vi to vim

+ 1 - 0
install/etc/skel/.config/waybar/config

@@ -49,6 +49,7 @@
         "format": "{ipaddr}/{cidr}",
         "tooltip-format": "{ifname} via {gwaddr}",
         "format-disconnected": "Disconnected ⚠",
+        "on-click": "cmst"
     },
     "clock": {
         "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",

+ 0 - 13
install/usr/local/bin/genshin-impact

@@ -1,13 +0,0 @@
-#!/bin/bash -xa
-# @note: assumes lutris wine 6.14-3 has been installed, feel free to edit as needed
-export PATH="/home/cdelorme/.local/share/lutris/runners/wine/lutris-6.14-3-x86_64/bin:$PATH"
-export WINEPREFIX="${HOME}/games/pc/genshin-impact/lutris"
-export GAMEPATH="${WINEPREFIX}/drive_c/Program Files/Genshin Impact/Genshin Impact game"
-export WINEDEBUG=-all
-#export DXVK_HUD=fps
-export MANGOHUD=1
-
-if [ "$1" != "env" ]; then
-	cd "$GAMEPATH"
-	wine explorer /desktop=gi,1920x1080 cmd /c launcher.bat
-fi

+ 0 - 50
install/usr/local/bin/mh

@@ -1,50 +0,0 @@
-#!/bin/bash
-#
-# mh command for simplified operations
-#
-# mh save
-# mh restore
-# mh kill
-#
-# can utilize save/restore to save-scum decoration farming
-# can utilize kill to stop processes when failed to cease
-#
-# save includes timestamps to avoid potential
-#
-# current implementation uses hard-coded user id; not portable
-# future implementations should either save/restore for all ids, or ask/compute
-
-export steam_game_id="582010"
-export save_path="${HOME}/games/mhworld/saves"
-export steam_user_id="48081292"
-export full_path="${HOME}/.local/share/Steam/userdata/${steam_user_id}/${steam_game_id}/remote/SAVEDATA1000"
-
-mhsave() {
-	mkdir -p "$save_path"
-	local save_file="${save_path}/$(date +%Y%m%d%H%M%S)"
-	cp "$full_path" "$save_file"
-	ln -sf "$save_file" "${save_path}/latest"
-}
-
-mhrestore() {
-	[ ! -f "${save_path}/latest" ] && return
-	cp -L "${save_path}/latest" "$full_path"
-}
-
-case "$1" in
-	run)
-		steam "steam://rungameid/${steam_game_id}" &> /dev/null &
-		;;
-	save)
-		mhsave
-		;;
-	restore)
-		mhrestore
-		;;
-	kill)
-		ps aux | grep -i monster | awk '{print $2}' | xargs kill -9 &> /dev/null
-		;;
-	*)
-		echo "unable to process command..."
-		;;
-esac

+ 0 - 2
install/usr/local/bin/mhrise

@@ -1,2 +0,0 @@
-#!/bin/bash
-steam steam://run/1446780

+ 53 - 25
install/usr/local/bin/uz

@@ -1,32 +1,60 @@
 #!/usr/bin/env python
 
-import sys
+# Extracts a zip archive while converting file names from Shift-JIS encoding to UTF-8.
+#
+# Example:
+#   python unzip-jp.py archive.zip
+#
+#       Creates a directory `archive` and extracts the archive there.
+#
 import zipfile
-import argparse
+import sys
+import os
+import codecs
 
-parser = argparse.ArgumentParser(description="accept to and from encodings")
-parser.add_argument('-O', metavar='decode', default="shift-jis")
-parser.add_argument('-I', metavar='encode', default="cp437")
-args, files = parser.parse_known_args();
+if len(sys.argv) < 2:
+    print('No archive name.')
+    print('')
+    print('Usage: unzip-jp archive [password]')
+    exit(1)
 
-def unzip(filename, encode, decode):
-    code = 0
-    with zipfile.ZipFile(filename) as myzip:
-        for info in myzip.infolist():
-            try:
-                info.filename = info.filename.encode(encode, 'strict').decode(decode, 'strict')
-                myzip.extract(info)
-            except Exception as e:
-                code = 1
-                print("failed to extract {0}: {1}".format(info.filename, e))
-    return code
+name = sys.argv[1]
 
-def main(files, encode, decode):
-    code = 0
-    for file in files:
-        if unzip(file, encode, decode) == 1:
-            code = 1
-    return code
+if len(sys.argv) > 2:
+    password = sys.argv[2]
+else:
+    password = None
 
-if __name__ == '__main__':
-    sys.exit(main(files, args.I, args.O))
+directory = os.path.splitext(os.path.basename(name))[0]
+
+if not os.path.exists(directory):
+    os.makedirs(directory)
+
+with zipfile.ZipFile(name, 'r') as z:
+    if password:
+        z.setpassword(password.encode('cp850','replace'))
+    for f in z.infolist():
+        bad_filename = f.filename
+        if bytes != str:
+            # Python 3 - decode filename into bytes
+            # assume CP437 - these zip files were from Windows anyway
+            bad_filename = bytes(bad_filename, 'cp437')
+        try:
+            uf = codecs.decode(bad_filename, 'sjis')
+        except:
+            uf = codecs.decode(bad_filename, 'shift_jisx0213')
+        # need to print repr in Python 2 as we may encounter UnicodeEncodeError
+        # when printing to a Windows console
+        print(repr(uf))
+        filename=os.path.join(directory, uf)
+        # create directories if necessary
+        if not os.path.exists(os.path.dirname(filename)):
+            try:
+                os.makedirs(os.path.dirname(filename))
+            except OSError as exc: # Guard against race condition
+                if exc.errno != errno.EEXIST:
+                    raise
+        # don't try to write to directories
+        if not filename.endswith('/'):
+            with open(filename, 'wb') as dest:
+                dest.write(z.read(f))

+ 2 - 0
notes/games/vr/valve-index.md

@@ -73,6 +73,8 @@ These are some scripts and utilities that can be used to provide some missing fu
 - [steamvr utils](https://github.com/DavidRisch/steamvr_utils)
 - [paToggle](https://gist.github.com/frostworx/2a1a84ea8098ddc207cc9f54793f5446)
 - [lh.py; superseded by steamvr_utils](https://gist.github.com/prefiks/e614116fc3983a8e7e5fe326800dc101)
+- [VR-on-Linux](https://gitlab.com/vr-on-linux/VR-on-Linux)
+- [vr-video-player](https://git.dec05eba.com/vr-video-player/about/)
 
 _The `steamvr_utils` package can be installed and easily hooked to the launch configuration of SteamVR._