Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
menu cached hack
#!/bin/bash
# mc_hack.sh Version 0.0.1
#
# This program addresses the Bodhi Linux forum issue:
# Excessive CPU useage by menu_cached process: http://bit.ly/2eD3FFe
#
# USE AT YOUR OWN RISK!!!
#
# Bodhi Linux (c) 2017
# Author : rbt y-lee <ylee@bodhilinux.com>
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
set -e
mkdir -p ~/.local/share/applications
cd ~/.local/share/applications
[ -e menu_cache.desktop ] && rm menu_cache.desktop
wget https://www.dropbox.com/s/a397pxxzgy7f5rq/menu_cache.desktop
line=$(head -1 menu_cache.desktop)
if [[ "$line" != "[Desktop Entry]" ]]
then
echo "Desktop file no longer exists"
rm menu_cache.desktop
exit 1
fi
sed -i "s/bodhi/${USER}/g" menu_cache.desktop
touch ~/.e/e/applications/startup/.order
if ! grep "menu_cache.desktop" ~/.e/e/applications/startup/.order > /dev/null
then
echo 'menu_cache.desktop' >> ~/.e/e/applications/startup/.order
fi
touch ~/.e/e/applications/restart/.order
if ! grep "menu_cache.desktop" ~/.e/e/applications/restart/.order> /dev/null
then
echo 'menu_cache.desktop' >> ~/.e/e/applications/restart/.order
fi
enlightenment_remote -restart
exit 0
# All wrongs reserved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment