HTML 令人敬畏的代码语法突出显示变得简单
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTML 令人敬畏的代码语法突出显示变得简单相关的知识,希望对你有一定的参考价值。
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'></script>
<script language='javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script>
令人敬畏的cm temp小部件
我最近开始使用awesome wm 4.2版,非常喜欢它;大大改善了我的工作流程。我尝试了一些主题,如模仿和其他,但他们太喜欢我了。我喜欢默认配置,并在这里阅读:https://awesomewm.org/apidoc/index.html以及来自copycats和其他人的rc.lua和theme.lua文件,并实现了其中一些;键绑定,布局操作,启动程序。我想创建一个显示cpu temp的小部件,我按照这里的https://awesomewm.org/apidoc/classes/awful.widget.watch.html跟随这些内容:
wibox.widget.textbox(' | '),
awful.widget.watch(
'bash -c "cat/sys/class/hwmon/hwmon0/device/temp1_input"', 15),
wibox.widget.textbox(' | '),
awful.widget.watch(
'bash -c "cat /sys/class/hwmon/hwmon0/device/temp3_input"', 15),
它有效,但它显示大数字,即43000而不是43.我怎么能改变它?如果可能的话,温度为43°C。
答案
如果你得到正确的数字,只想将它除以1000,你可以使用optional callback:
awful.widget.watch('bash -c "cat /sys/class/hwmon/hwmon0/device/temp1_input"', 15,
function(widget, s) widget:set_text(tonumber(s)/1000) end)
以上是关于HTML 令人敬畏的代码语法突出显示变得简单的主要内容,如果未能解决你的问题,请参考以下文章
scss 代码修订1 Sass:语法上令人敬畏的样式表
scss 代码修订1 Sass:语法上令人敬畏的样式表
scss 代码修订1 Sass:语法上令人敬畏的样式表
scss 代码修订1 Sass:语法上令人敬畏的样式表
scss 代码修订1 Sass:语法上令人敬畏的样式表
令人敬畏的cm temp小部件