I have created the following patch file using diff -u file1 file2 | file.patch and then edited out the --- line and changed the path:ArkOS_Dev_Openbox.patch+++ ~/.config/openbox/menu.xml  2016-07-28 21:21:55.683952870 +0200@@ -5,7 +5,7 @@ <item label=Terminal><action name=Execute><execute>lxterminal</execute></action></item> <item label=Browser><action name=Execute><execute>firefox</execute></action></item> <item label=File Manager><action name=Execute><execute>spacefm</execute></action></item>-<item label=Editor><action name=Execute><execute>geany</execute></action></item>+<item label=Editor><action name=Execute><execute>gksu geany</execute></action></item> <separator/> <menu id=applications label=Applications execute=xdg_menu --format openbox3-pipe --root-menu /etc/xdg/menus/arch-applications.menu />+++ /usr/share/applications/geany.desktop.bak   2016-07-29 22:43:43.483359679 +0200@@ -130,7 +130,7 @@ Comment[vi]=Mt IDE nhanh v nh nhng dng GTK+ Comment[zh_CN]=GTK+  IDE Comment[zh_TW]= GTK+ -Exec=geany %F+Exec=gksu geany %F Icon=geany Terminal=false Categories=GTK;Development;IDE;And I try to run this patch with the following command.sudo patch -d / -p0 < ArkOS_Dev_Openbox.patchThis results in the first file not being found due to the tilde. I've tried using $HOME as well to no avail.I think I'm trying to use patches in a way what I think they're not meant for, a desktop environment instead of a package.So my question is, can I use patches this way? Should I use patches this way? If so how?If not what should I use instead?
Is it possible to get patch to patch files in $HOME and system both in one command and file?
patch
A quick check of the sources shows that GNU patch for instance does not expand tilde into home-directories.  Likely none of the other implementations do, since most —all but perhaps some closed-source Unix versions — are based on earlier versions of GNU patch (as it evolved from Larry Wall's original).You could handle this by a sed-script, e.g., something like this:sed -e s,~/,$HOME/, ArkOS_Dev_Openbox.patch | sudo patch -d / -p0Further reading:patch (background information for diffstat)patch (POSIX)