我开始使用 emacs 进行编程和 LaTeX,我希望在我的背景上有它的基本命令,这样我就可以轻松地使用快捷方式“显示我的桌面”...查看我的背景以查看命令并返回我的 emacs 窗口可以继续工作。我认为对于许多喜欢编程的用户,尤其是尚未习惯 emacs 命令的用户来说,这将是一个有用的自定义。
我能想到的最好的办法是在我的桌面图像上有一些基本命令和一些快捷键来将图像更改为更具体的图像(对于C ++语言,对于乳胶等)
我可以使用乳胶和操作系统的原始背景创建图像。
Ctrl我的问题是,是否以及如何通过按+ Alt+H或类似的按钮使这些图像显示为背景。
答案1
我们可以找到我们使用的图像
/usr/share/desktop-base/softwaves-theme/wallpaper/contents/images
(我认为这是默认图像)。cd /usr/share/desktop-base/softwaves-theme/wallpaper/contents/images
我们可以通过命令找到我们正在使用的图像:
gsettings 获取 org.gnome.desktop.background 图片-uri
我们将需要的文件(或者全部,如果我们不知道使用哪个)复制到一个文件夹中:假设在
~/bg_images/
.mkdir ~/bg_images/
cp *.* ~/bg_images/
cd ~/bg_images
我们打开要使用 GIMP 的图像并导出为 png。
Gimp->导出为->选择png文件->将压缩设置为0->输入
假设这是图像 1280x720.svg,我们创建了 1280x720.png。
我们打开文件 image1.tex (在同一文件夹中)并添加代码:
\documentclass[10pt]{standalone} \usepackage{graphicx} \usepackage{tikz} \usepackage{array} \usepackage{parskip} \setlength\parindent{25pt} \def\bll{\boldmath$<$} \def\blg{\boldmath$>$} \begin{document} \begin{tikzpicture} \node at (0,0) {\includegraphics{1280x720.png}}; \node at (1.2,0) { \begin{minipage}{310pt} \begin{center} {\Huge \bfseries emacs controls:} \end{center}\vspace{5pt} \noindent{\Large\bfseries Navigation}\vspace{5pt} \begin{tabular}{>{\bfseries}r l} C-v:& Goes to next page.\\ M-v:& Goes to previous page.\\ C-l:& Moves the screen around the cursor's line.\\ &(once $->$ center,\\ &twice $->$ top,\\ &three times $->$ bottom).\\ C-n:& Next line.\\ C-p:& Previous line.\\ C-b:& Previous character (Backward).\\ C-f:& Next character (Forward).\\ C-a:& Beginning of line.\\ C-e:& End of line.\\ M-f:& Forward a word.\\ M-b:& Backward a word.\\ M-a:& Back to beginning of sentence.\\ M-e:& Forward to end of sentence.\\ M-\blg:& Move to End of file.\\ M-\bll:& Move to Beginning of file.\\ \end{tabular}\vspace{10pt} \noindent{\Large\bfseries Numerical arguments in commands}\vspace{5pt} \begin{tabular}{>{\bfseries}l l} C-u \bll Num\blg \bll command\blg :& Repeats $<$comand$>$ \\ &Num times.\\ Exceptions: & {\bfseries C-v} and {\bfseries M-v}\\ & scrolls Num lines.\\ \end{tabular}\vspace{10pt} \noindent{\Large\bfseries Cancel non-responding or incomplete command}\vspace{5pt} \begin{tabular}{c} {\bfseries C-g}\\ \end{tabular}\vspace{10pt} \noindent{\Large\bfseries Change buffer etc}\vspace{5pt} \begin{tabular}{>{\bfseries}rl} C-x b: & Select buffer \\ & Default [Enter]\\ & [tab] show possible.\\ C-x 1: & kill all buffers\\ & but cursor's current.\\ & [it is digit one]\\ C-x 2:& Splits current window in two.\\ C-x o:& moves cursor to other window.\\ C-M-v:& Scrolls other window. \end{tabular} \end{minipage}\hspace*{45pt} \begin{minipage}{300pt} \noindent{\Large\bfseries Mark from}\vspace{5pt} \begin{tabular}{>{\bfseries}l} C-\bll SPC\blg\\ \end{tabular}\vspace{10pt} \noindent{\Large\bfseries Delete and kill}\vspace{5pt} \begin{tabular}{>{\bfseries}r l} \bll DEL\blg & Delete char just before cursor.\\ C-d: & Delete char just after cursor.\\ M-\bll DEL\blg: & Kill word just before cursor.\\ M-d: & Kill word just after cursor.\\ C-k: & Kill from cursor to end of line.\\ M-k: & Kill from cursor to end of sentence.\\ C-w: & Kill from mark point to cursor. \end{tabular}\vspace{10pt} \noindent{\Large\bfseries Restore killed text ``Yanking''}\vspace{5pt} \begin{tabular}{>{\bfseries}l l} C-y: & Restore last killed or last row killed text.\\ M-y: & Restore previous killed text. \end{tabular}\vspace{10pt} \noindent{\Large\bfseries Undo}\vspace{5pt} \begin{tabular}{>{\bfseries}l} C-/\\ C-x u\\ C-\_\\ \end{tabular} \noindent{\Large\bfseries Files \& Buffers}\vspace{5pt} \begin{tabular}{>{\bfseries}rl} C-x C-f: & Find a file.\\ C-x C-s: & Save active file.\\ C-x C-b: & List buffers.\\ C-x b \bll BufferName\blg:& Visit buffer.\\ C-x s: & Save some buffers.\\ C-x C-c:& Exit emacs.\\ C-z:& Suspend emacs\\ & return with \%emacs or 'fg'\\ \end{tabular}\vspace{10pt} \noindent{\Large\bfseries Search}\vspace{5pt} \begin{tabular}{>{\bfseries}rl} C-s:& Forward search \\ & (repeat C-s for next)\\ C-r:& Backward search\\ & Both navigate back and forth. \end{tabular} \end{minipage}\hspace{5pt} \begin{minipage}{290pt} \noindent{\Large\bfseries More Useful Commands}\vspace{5pt} \begin{tabular}{>{\bfseries}r l} M-x replace-string:& Replace string after cursor.\\ &(First letters and TAB \\ & are enough to show it.)\\ M-x recover-file: & Restores file.\\ M-x auto-fill-mode: & Automatic breaks lines.\\ M-x text-mode: & Human text.\\ C-x f \bll NumChars\blg : & Chars in line.\\ M-q: &Fix chars in paragraph.\\ C-u 70 C-x f: & 70 chars per line.\\ C-h c \bll comand\blg:& Basic help on command.\\ C-h k \bll command \blg:& Extended help on command.\\ C-h f \bll function \blg:& Help about function.\\ C-x i:& Read included manuals. \end{tabular}\vspace{10pt} \end{minipage} }; \end{tikzpicture} \end{document}
我们使用 pdflatex image1.tex 进行编译,得到文件 image1.pdf。
pdflatex image1.tex
然后我们有一个 image1.pdf 文件,我们使用 texlive Convert 命令将其转换为 svg:
转换 image1.pdf image1.svg
我们可以避免执行接下来的步骤,直到第 13 步,只需在创建快捷命令时使用脚本中的代码即可
我们在主文件夹中创建一个目录“bin”(如果我们还没有)
mkdir ~/bin
cd ~/bin
我们打开文件“change_background.sh”
纳米变化_背景.sh
我们复制粘贴代码:
#!/bin/bash
文件路径=$1
if [ "x$file_path" != "x" ];
然后 gsettings 设置 org.gnome.desktop.background picture-uri file://"$file_path" fi
保存并关闭
chmod +xchange_background.sh
然后我们从右上角打开设置:
所有设置->键盘->向下滚动到底部->按“+”
我们使用以下命令创建一个自定义快捷方式(假设为 show_emacs_help)
bash /home/用户名/bin/change_background.sh /home/用户名/bg_images/image1.svg
其中“userName”是我们的用户名
我们选择了快捷键(比如说Ctrl+ Alt+ H)
我们可以用同样的方式添加一个新的快捷方式来重新加载默认背景图像。
PS:脚本来源:https://askubuntu.com/questions/858663/how-to-change-background-with-keyboard-shortcut由@SergiyKolodyazhny 选择的答案。
结果图像: