Skip to content

Commit

Permalink
Move shortcuts and tweak files to chimera data (#181)
Browse files Browse the repository at this point in the history
* Move shortcuts to chimera data

Move all shortcut files to `~/.local/share/chimera/shortctus`
Remove stativ directory for shortcuts as is not used.

* Minor reordering fix

* Move steam-tweaks static file to chimera data directory
  • Loading branch information
Samsagax authored Jul 20, 2021
1 parent 1f4dc23 commit 202b75b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
7 changes: 2 additions & 5 deletions chimera_app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ def __get_compat_data_file(self):
return self.CACHE_HOME + '/steam-shortcuts-compat.yaml'

def __get_shortcut_dirs(self):
shortcut_dirs = [self.DATA_HOME + '/steam-shortcuts']
if os.path.isdir('/usr/share/steam-shortcuts'):
shortcut_dirs.append('/usr/share/steam-shortcuts')
return shortcut_dirs
return self.DATA_HOME + '/chimera/shortcuts'

def __get_steam_dir(self):
return self.DATA_HOME + '/Steam'
Expand All @@ -109,4 +106,4 @@ def __get_local_tweaks_file(self):
return self.CONFIG_HOME + '/steam-tweaks.yaml'

def __get_static_tweaks_file(self):
return '/usr/share/steam-tweaks/steam-tweaks.yaml'
return '/usr/share/chimera/steam-tweaks.yaml'
25 changes: 13 additions & 12 deletions migrate-to-chimera
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi

if ! [ -d $HOME/.config/steam-buddy ] && \
! [ -d $HOME/.local/share/steam-buddy ] && \
! [ -d $HOME/.local/share/steam-shortcuts ] && \
! [ -d $HOME/.cache/steam-buddy ] ;
then
# Nothing to migrate, we can exit
Expand Down Expand Up @@ -39,6 +40,7 @@ if [ -f $HOME/.local/share/steam-buddy/settings/settings.json ]; then
sed -i 's|/steam-buddy/|/chimera/|g' settings.json
fi

# Migrate shortcuts and
# Check if there are platform specific yaml files
platforms=('32x'
'3do'
Expand Down Expand Up @@ -67,23 +69,21 @@ platforms=('32x'
'snes'
'tg-16')
if [ -d $HOME/.local/share/steam-shortcuts ] ; then
cd $HOME/.local/share/steam-shortcuts
if ! [ -d $HOME/.local/share/chimera ] ; then
mkdir -p $HOME/.local/share/chimera
fi
mv -Tbv $HOME/.local/share/steam-shortcuts $HOME/.local/share/chimera/shortcuts
cd $HOME/.local/share/chimera/shortcuts
for p in ${platforms[@]} ; do
if [ -f "steam-buddy.${p}.yaml" ] ; then
cp -bv "steam-buddy.${p}.yaml" "chimera.${p}.yaml"
rm -v "steam-buddy.${p}.yaml"
echo "Renamed steam-buddy.${p}.yaml to chimera.${p}.yaml"
echo "Renaming steam-buddy.${p}.yaml to chimera.${p}.yaml"
mv -Tbv "steam-buddy.${p}.yaml" "chimera.${p}.yaml"
echo "Renamig paths inside chimera.${p}.yaml"
sed -i 'si|/steam-buddy/|/chimera/|g' "chimera.${p}.yaml"
fi
done
fi

# Go to shortcuts and replace paths
if [ -d $HOME/.local/share/steam-shortcuts ]; then
cd $HOME/.local/share/steam-shortcuts
echo "Renamig relevant paths inside shortcuts files"
find . -type f -name "*.yaml" -exec sed -i 's/steam-buddy/chimera/g' {} \; -print
fi

# Go to steam-grid symlinks and relink them
cd $HOME/.local/share/Steam/userdata
for u in * ; do
Expand Down Expand Up @@ -115,7 +115,8 @@ fi
# Migrate user data directories and files from steam-buddy
if [ -d $HOME/.local/share/steam-buddy ] ; then
echo "Moving data directory"
mv -Tbv $HOME/.local/share/steam-buddy $HOME/.local/share/chimera
mv -bv $HOME/.local/share/steam-buddy/* $HOME/.local/share/chimera/.
rm -rv $HOME/.local/share/steam-buddy
fi

# Logout the session since we need to restart everything in ChimeraOS
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
('share/chimera/config', glob('config/*.conf')),
('share/chimera/bin', glob('bin/*')),
('bin', glob('launchers/*')),
('share/steam-tweaks', ['steam-tweaks.yaml']),
('share/chimera', ['steam-tweaks.yaml']),
('share/steam-tweaks', ['steam-compat-tool-stub.tpl']),
('share/doc/chimera', ['README.md']),
('share/doc/chimera', ['LICENSE']),
Expand Down

0 comments on commit 202b75b

Please sign in to comment.