Skip to content

Latest commit

 

History

History
359 lines (252 loc) · 9.69 KB

sg-setup-notes.org

File metadata and controls

359 lines (252 loc) · 9.69 KB

manjaro

pros

  • less bloat

cons

  • not officially supported unity editor (works flawless either way)

install

  • git
  • git lfs
  • docker pamac build docker
  • dotnet pamac build dotnet-sdk-3.1-bin > we need 3.1 sdk for cos stuff
  • mono pamac build mono

    if you do not use arch you will need to google and follow install instructions

dotnet --list-sdks

you want 3.1 sdk

`3.1.420 [/usr/share/dotnet/sdk]`

install unity editor

  • make ssh keys, add them to gitlab
  • clone gitlab idlegame repo
  • get unity hub pamac build unityhub
  • for logging into unityhub, best is to copy the login url into google chrome.
  • if the redirect back from google to unity does not work for you (it should ask you to open with xdg-open, click yes.), consider setting the mime type like described here It probably just works though.

specific unity version

  • find the version you need
cd ~/idlegame/
cat IdleGame/ProjectSettings/ProjectVersion.txt | head -n 1 | cut  -d " " -f2
unityhub <link>
  • if unity hub mime type is setup correctly you should be able to click (I just didn’t bother with it because it’s a 1 time click)
  • Note: if install the aur package they actually set the mimetype correctly seems like. I have it working with chrome that it opens unityhub correctley when I click the unityhub link.

git lfs

  • **Important** pull after you installed git lfs (git pull should be sufficient)
cd `git rev-parse --show-toplevel`
git lfs fetch && git lfs pull

open unity with style (ditch unity hub for the most part)

sudo ln -s <unity-install-path>/Editor/Unity /usr/bin/

where unity-install-path usually is ~~/Unity/Hub/~

make a script

#!/bin/sh
Unity -projectPath <project-path>

project-path is the directory with the sln file.

Now you do not need to click in the hub ever again like some normie.

Here is the latest incarnation of me making it simple: run-unity

This is meant to be used for example with emacs async-shell-command. Say run-unity in a shell with the current dir to where the sln is placed.

unity-editor-logs

ditch console pro. Imagine you want to fuzzy find With this script I can get the logs as a emacs buffer. Example:

 (let ((default-directory (expand-file-name "~/idlegame/"))
	(shell-command-buffer-name-async (format "%s-%s" 'async-shell-command "unity-editor-logs")))
   (async-shell-command "unity-editor-logs"))

Fix the paths or it doesn’t work.

unity project symlinks (if you want 2 unities)

man ln

IMPROTANT csc patch (without it you get compile errs)

!! without this you cannot compile unity !!

use

`IdleGame/patch_csc_linux.sh`

with 1 arg, the “Data” dir in your unity install. For example `/opt/unity/2019.4.16f1/Editor/Data`

probably something like /home/your-user/unityhub/2019.4.16f1/Editor/Data if you have some default install.

Hint: check in unityhub for installs to get your install path.

uri scheme for connecting to twitch

you need this if you want to connect to twitch with browser flow

  • script idlegame-auth-handler in your path

> Important make sure idlegame-auth-handler is executable

#!/bin/sh
[ "$1" = "-v" ] && echo idlegame-auth-handler version 0.1 && exit 0

echo "$@" >> /tmp/auth-handler-res

mkdir -p /tmp/cos_redirect/ && echo "$@" >> /tmp/cos_redirect/url.txt
notifiy-send "auth handler success."
idlegame-auth-handler foo

this should show a window saying foo

  • install a .desktop file in `~/.local/share/applications`
cat << EOF > ~/.local/share/applications/cos-handler.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
NoDisplay=true
Exec=idlegame-auth-handler %u
TryExec=idlegame-auth-handler
Name=idlegame auth handler
Terminal=false
StartupNotify=false
MimeType=x-scheme-handler/clashofstreamers
EOF
  • add an entry here ~/.config/mimeapps.list
  • to [Default Applications].
x-scheme-handler/clashofstreamers=cos-handler.desktop

Note that this is defined in game code

IdleGame/Assets/#/Sources/Network/Endpoint/UriScheme.cs:6:    public const string CLASHOFSTREAMERS = "clashofstreamers";

The mimeapps list makes xdg-open look up the desktop file, which says what program to run.

If it works this should call our script with the url as data.

xdg-open clashofstreamers://fooo

troubleshoot

you might need to run

update-desktop-database $HOME/.local/share/applications

editor

choose

  • pycharm (recommended for beginners if you code python)
  • doom emacs (good for python, used by some people already, vim bindings)
  • spacemacs (vim bindings, similar to doom, more features and more users, less minimalistic)
  • vscode, intellij (works out of the box)
  • https://github.com/SystemCrafters/rational-emacs similar style to doom but more bare bones to default emacs (which is good)
  • mememacs - ascend with me into space. A config not made to be among the stars, but to touch them. By being simple, powerful and focused.

other software

  • gnu stow for dotfile management
  • vim as fallback editor
  • qutebrowser for a keyboard driven browser
  • flameshot for screenshots
  • todo: screencast software
  • there is cli tools for creating jira tickets, might be a sick booster for testers jirazzz

tips

  • do not install program python packages on your system level,

use pyenv for that (pycharm does it auto)

  • pamac bulid `python-package-name` for stuff you need on your system only

cos attachments s3 bucket share (“sharex” bucket)

  • install aws cli pamac build aws-cli-v2

1 script to upload to s3

upload-file

check scripts/.local/bin/scripts/cos-s3-upload-latest

screen capture

scripts/.local/bin/scripts/video-selected

  • depends on `slop`
pamac build slop-git

modify to your desire.

walkthrough make video selected (screen capture)

  • bind `video-selected` to a keybind, probably with your wm (eg. KDE plasma) (just in i3 config of course)
  • hello I selected (see vid) (showcase)
  • second invoke of the script finishes the current recording https://s3.eu-central-1.amazonaws.com/cos-dev-attachments/ShareX/ben/6219cca7-6358-45ac-877a-7e4c9aa6b153-box-220708-1137-33.mp4
  • invoke the script `s3-cos-attch-upload` on the file
  • you can of course make a version that does that auto
  • I use /tmp/recordingpid to show “recording” in my wms modeline. as long as /tmp/recordingpid exists, you are recording

    actually I think you want some kind of feedback like this

    `killall ffmpeg` also works to kill anything running

aws profile

you can pass –profile to the aws cli. Less secure because you have permanent tokens on a plain file on your system.

  • in ~/.aws/config
[sharex]
region = eu-central-1
  • in ~/.aws/credentials
[sharex]
aws_access_key_id=UUUUUUUUUUUUUUUUUUUU
aws_secret_access_key=uuuuUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

troubleshoot

unity hub closes instant

  • invoke unity hub via the command line to get the errors (general tip anyway)
  • There is some bug when it tries to update, update or reinstall with pacman (or pamac)

“connection interrupted” in your browser

caused by docker maybe this helps https://success.mirantis.com/article/how-do-i-configure-the-default-bridge-docker0-network-for-docker-engine-to-a-different-subnet

notes

at the time of writing I did not make airtest recording work

honestly don’t really know why you want it code your airtest with the repl running instead to have instant feedback, ask Ben to set it up

prefab merge tool (only if you work with prefabs)

[mergetool “unityyamlmerge”] trustExitCode = false cmd = <unity-install-path>Unity-2019.2.8f1/Editor/Data/Tools/UnityYAMLMerge merge -h -p “$BASE” “$REMOTE” “$LOCAL” “$MERGED”

xsessions

https://wiki.archlinux.org/title/Display_manager#Session_configuration

usr/share/xsessions

To add/remove entries to your display manager’s session list; create/remove the .desktop files in usr/share/xsessions as desired.

For context your display manager is the login screen.

ctrl + alt + f1…f8 : switch to another tty 7 is usually the “graphical one”

You can also switch to another tty and start your window manager from there (for trying out). You login and it starts xterm, then you can startx (if not already running somewhere).

what I do is I use this: https://aur.archlinux.org/packages/xinit-xsession

and I start stumpwm in my ~/.xinitrc This way the only thing I need to worry about is ~/.xinitrc.

It is easy to make a mistake and your window manager wont start. Do not panic. Go to another tty and fix the files with a terminal editor. Common mistakes

  • some path is wrong and the program does not exist
  • you accidentally do not start a window manager
  • you have a script that starts you window manager and it is not executable

Follow the documentation of the wm you like to try + the above linked arch wiki page.