页面“Linux 下的护眼软件”与“Awesome”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
 
 
第1行: 第1行:
热水毛巾就不错
+
==平铺式窗口管理器 == 
=Redshift=
+
什么是平铺式窗口管理器?简单来说,所谓的平铺就是之所有的窗口都不会相互重叠,而是自动的被调整大小使得它们能够刚好占满整个屏幕。这和传统的桌面环境的概念相差很大,也许你会疑问这样的环境下如何工作?
用于调整色温的Redshift工具 Redshift可以根据太阳的位置调整色温,在夜间和白天设置不同的色温。从黄昏到清晨,色温的过度非常自然,能够让你的眼睛缓慢适应。
+
事实上对于Linux这种需要大量使用命令行的操作系统来说平铺式窗口管理在很多情况下能够极大的提升你的工作效率。举个例子,很多时候你都需要打开好几个shell。在gnome底下这就意味着好几个会相互遮挡命令行窗口,大多数时候如果你想要同时看到这些窗口上面的内容就得费神费力的调整它们的位置和大小。而在平铺式窗口下面你完全不需要为这些事情烦心。
 +
另外一个可能会促使你使用平铺的理由就是,用它来调整、切换窗口几乎可以不使用鼠标。
  
 +
使用原因 xmonads 坏了 ,于是
 +
 +
==安装==
 +
<pre>
 +
sudo apt update
 +
sudo apt-get install awesome  awesome-extra feh xcompmgr xscreensaver lxrandr
 +
git clone https://github.com/evan886/awesome.git  ~/.config/awesome
 +
#git clone https://github.com/alswl/awesome.git  ~/.config
 +
cd awesome/
 +
#cp _autostart.sh autostart.sh
 +
 +
 +
#特别配置
 +
head -n 57 rc.lua #因为 它启动有点不太妥
 +
terminal = "terminator -u"
 +
 +
 +
##add to ~/.config/awesome/rc.lua
 +
 +
配置自动启程序 记住 很多在这里自启动的 2019年 01月 03日
 +
使用awesome之后之前设置的自动启动就会失效,因为Awesome启动是通过配置文件控制的,在配置文件(~/.config/awesome/rc.lua)加上如下内容可以配置自启动程序:
 +
 +
autorun = true
 +
autorunApps =
 +
{
 +
    "nm-applet &",
 +
    "kupfer --no-splash"
 +
--    "fcitx",
 +
--    "dbus-launch gnome-do",
 +
--    "synapse -s &",
 +
--    "/opt/qq2012/wineapp/qq/qq.sh",
 +
--    "dbus-launch gnome-do",
 +
 +
 +
}
 +
 +
if autorun then
 +
    for app = 1, #autorunApps do
 +
        awful.util.spawn_with_shell(autorunApps[app])
 +
    end
 +
end
 +
 +
--在autorunApps中添加要自动启动程序的命令即可在登录时启动相应的程序
 +
 +
 +
 +
 +
 +
# 托盘 trayer
 +
trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype pixel --width 128 --transparent true --alpha 0 --tint 0x000000 --height 26 &
 +
 +
 +
 +
# on xmonad
 +
#  apt install trayer  Set up an icon tray
 +
trayer --edge top --align right --SetDockType true --SetPartialStrut true \
 +
      --expand true --width 6 --transparent true --tint 0x191970 --height 26 &
 +
 +
#trayer --edge top --align right --SetDockType true --SetPartialStrut true \
 +
#    --expand true --width 9 --transparent true --tint 0x191970 --height 26 &
 +
# Empathy chat client (-h: start hidden, -n: don't connect on launch)
 +
 +
 +
 +
默认配置文件
 +
/etc/xdg/awesome/rc.lua
 +
 +
 +
作好更改后,检查配置文件是否有错误是非常有用的:
 +
 +
user $awesome -k
 +
✔ Configuration file syntax OK
 +
 +
美化
 +
 +
git clone git://github.com/mikar/awesome-themes.git ~/.config/awesome/themes
 +
</pre>
 +
 +
===锁屏===
 +
====i3lock ====
 
<pre>
 
<pre>
apt install redshift redshift-gtk
+
Before starting  前提  安装这两个软件先
redshift  & #或者用启动器
+
... make sure you have xautolock and i3lock installed.
  
 +
or  xautolock  installed.
  
 +
apt install i3lock  xautolock  -y
  
cat ~/.config/redshift.conf
+
添加在awesome 自启动列表中
[redshift]
+
"xautolock -time 19 -locker 'i3lock -i /home/evan/wallpaper/sj.png' ",
; 设置白天和晚上的屏幕温度(中性为6500k)
 
; 在2700K/6300K色温下更容易造成视疲劳
 
temp-day=5800
 
temp-night=4500
 
  
; 逐渐增强或降低屏幕的温度,平滑过渡
+
#配置快捷键
transition=1
+
vim .config/awesome/rc.lua
 +
-- ln 327
 +
-- Ctrl + Atl + l 锁屏:
 +
-- 因为 Windows 中是 Win + L ,但在 awesome 中 Win + L 已经被用来干其他事情screensaver-command -lock')
 +
    awful.key({ modkey, "Control" }, "l", function () awful.spawn("i3lock  -b  -i '/home/evan/wallpaper/sj.png'") end,
 +
              {description = "lock ", group = "launcher"}),
  
; 设置位置提供者为manual
 
location-provider=manual
 
  
; 设置randr调整方法
 
adjustment-method=randr
 
  
[manual]
+
#这个 自启动不规范 不要了
; 广州的经纬度
+
cat .xinitrc
lon=113.47
+
#!/bin/bash
lat=23
+
#success if u run xmonad  must open it
 +
#/home/evan/.xmonad/autostart.sh
 +
#放到 awesome的自启动中会比较 规范一点点呢
 +
xautolock -time 10 -locker "i3lock -i '/home/evan/wallpaper/2020-02-04_14-46.png'" &
  
; 调整屏幕'0',从0开始
 
[randr]
 
screen=0
 
  
 +
</pre>
 +
[http://rabexc.org/posts/awesome-xautolock-battery rabexc.org  awesome-xautolock-battery]
  
 +
====save ====
 +
<pre>
  
 
</pre>
 
</pre>
 +
====gnome-screensaver ====
 +
<pre>
 +
sudo apt install  gnome-screensaver
  
http://jonls.dk/redshift/
+
要先设置 自启动
  
=f.lux=
 
  
https://github.com/xflux-gui/fluxgui
+
vim  ~/.config/awesome/rc.lua
  
 +
-- autorun app by evan
 +
autorun = true
 +
autorunApps =
 +
{
 +
    "nm-applet &",
 +
    "xscreensaver -no-splash &",
 +
 +
    awful.key({ modkey, "Control" }, "l", function () awful.spawn("xscreenaver-commadn --lock") end,
 +
              {description = "lock ", group = "launcher"}),
 +
 +
 +
 +
-- is good 运行
 +
awful.util.spawn_with_shell("/usr/bin/gnome-screensaver")
 +
-- Ctrl + Atl + l 锁屏:
 +
-- 因为 Windows 中是 Win + L ,但在 awesome 中 Win + L 已经被用来干其他事情了
 +
awful.key({"Mod1", "Control"}, "l", function ()
 +
    awful.util.spawn("gnome-screensaver-command --lock")
 +
end)
 +
 +
 +
-- oldCtrl + Atl + l 锁屏:
 +
-- 因为 Windows 中是 Win + L ,但在 awesome 中 Win + L 已经被用来干其他事情了
 +
awful.key({"Mod1", "Control"}, "l", function ()
 +
    awful.util.spawn('xscreensaver-command -lock')
 +
end)
 +
 +
发现的问题 直接运行  gnome-screensaver-command --lock 可以 用快捷键居然不行呀 
 +
</pre>
 +
 +
[http://www.chengweiyang.cn/2016/02/16/how-to-lock-screen-in-awesome-wm/ 在 Awesome 开启锁屏快捷键]
 +
 +
==主题和壁纸==
 
<pre>
 
<pre>
fluxgui #启动 报错
+
1 修改默认的主题配置文件
ImportError: No module named gconf
+
sudo vim /usr/share/awesome/themes/default/theme.lua
sudo apt-get install python-gconf </pre>
+
theme.wallpaper = "/home/evan/images/sonnenaufgang.jpg"
 +
--theme.wallpaper = "/usr/share/awesome/themes/default/background.png"
  
 +
2.或者选择不同的themes
 +
vim  ~/.config/awesome/rc.lua # 打开然后分别添加或者edit
 +
-- {{{ Variable definitions
 +
-- Themes define colours, icons, font and wallpapers.
 +
--beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua") --这个是原来默认的
 +
--beautiful.init("~/.config/awesome/themes/multicolor/theme.lua")
 +
--him  cool-blue  rainbow wombat  foo    niceandclean    elric  tree  strict  dremora  dust sunjack  byte grey-new  matrix  multicolor
 +
beautiful.init("~/.config/awesome/themes/tree/theme.lua")
  
[https://blog.csdn.net/gatieme/article/details/62922164 Ubuntu(护眼设置)安装屏幕色温调节软件F.lux]
 
  
win 下载
+
beautiful.init("~/.config/awesome/themes/snow/theme.lua")
https://justgetflux.com/
+
--beautiful.init("~/.config/awesome/themes/blue/theme.lua")
  
= Workrave=
+
例如主题是 tree
[https://www.jianshu.com/p/0348b52848c4 linux下保护视力、定时强制锁定软件: Workrave]
+
那么就选择一个你要的相片并改名为 background.jpg or  background.png 放到
 +
/home/evan/.config/awesome/themes/tree/
 +
</pre>
 +
== 美化==
 +
* 用了lxappearance什么后 icon变得很好看
 +
 
 +
默认的 gtk 界面在 XMonad 下相当地丑, 可以安装lxappearance来调整 GTK 的主题.
 +
==电池显示==
 +
[https://zhuanlan.zhihu.com/p/58254611 Awesome WM主题设置分享]
 +
 
 +
==常用快捷键==
 +
<pre>
 +
Super+S键可以显示已经设置在awesome配置中的快捷方式
 +
 
 +
使用 前面这几个比较常用
 +
配置完成后注销使用Awesome会话登录,Awesome使用Win键作为主键,几个常用的为:
 +
 
 +
Win+ Shift + q:退出awesome
 +
 
 +
Win+num 可以在多个桌面切换
 +
Win+Ctrl+r reload(重启)Awesome,
 +
Win+k/j可以切换窗口(类Vim操作),
 +
 
 +
Win+m/n    最大/小化窗口, ##
 +
 
 +
Win+Shift+num 可以将当前窗口发送到其他桌面.
 +
Win+Shift+C可以关闭当前窗口,
 +
Win+Space可以切换布局,Awesome有多种布局,这里不作介绍,大家可以自己稍作尝试
 +
 
 +
 
 +
 
 +
首先把修饰键设置为 Win 键,这样不会和其它的快捷键冲突。附件里有配置文件,可以直接使用。
 +
 
 +
Win+数字键 切换工作区
 +
Win+Space 切换窗口布局比如水平布局下,新开窗口与原窗口水平分割桌面。布局有下面几种:
 +
水平布局与垂直布局各两种,区别在于新开窗口的位置。它们是最常用的布局
 +
全屏布局。这个不实用,可以用 Win+m 最大化/还原当前窗口
 +
螺旋布局。似乎也不太实用,反正我很少用
 +
逐渐减小布局。和上面的那个差不多
 +
浮动布局。类似传统窗口管理器的布局。对于不规则的窗口,像 GIMP、mplayer 等,无论在任何布局下窗口都是浮动的。可以在配置文件里设定哪些程序使用浮动窗口。调整浮动窗口的位置时,按下 Win 键,用鼠标拖动就可以了。
 +
Win+Enter 开启预设的终端
 +
Win+Shift+C 关闭当前窗口
 +
Win+Shift+数字键 把当前窗口发送到其它工作区
 +
Win+j Win+k 切换到其它窗口
 +
 
 +
Win+h Win+l 调整当前窗口大小这一组快捷键是VI风格的。
 +
 
 +
Mod4 + Shift + j:当前窗口和前一个窗口互换位置
 +
Mod4 + Shift + k:当前窗口和后一个窗口互换位置
 +
 
 +
 
 +
Mod4 + Left:查看前一个tag
 +
Mod4 + Right:查看后一个tag
 +
 
 +
 
 +
Mod4 + space:把当前tag更换为下一种布局
 +
Mod4 + Shift + space:把当前tag更换为前一种布局
 +
 
 +
Mod4 + Control + space:切换当前窗口是否为浮动的
 +
 
 +
 
 +
 
 +
 
 +
 
 +
Mod4 + t :标记窗口(可标记多个)
 +
Mod4 + Shift + F1~F9:把标记的窗口移动到第一~第九桌面上
 +
Ctrl + Mod4 + 1~9:把当前桌面和1~9桌面同时显示
 +
Mod4 + 1~9:恢复
 +
Mod4 + Esc:快速切换到上一个桌面
 +
 
 +
#这些没怎么用过 后来用了双屏后 天天用呢
 +
Mod4 + Control + j:切换到下一个屏幕
 +
Mod4 + Control + k:切换到前一个屏幕
 +
 
 +
Mod4 + Shift + h:增加主区域窗口的数量
 +
Mod4 + Shift + l:减少主区域窗口的数量
 +
Mod4 + Control + h:增加非主区域窗口的数量
 +
Mod4 + Control + l:减少非主区域窗口的数量
 +
Mod4+f will make your current window fullscreen.
 +
 
 +
Also try Mod4+h, Mod4+l, Mod4+Shift+h and Mod4+Shift+l to resize windows. You can also resize with Mod4+Button3 (right click).
 +
 
 +
For an overview of all key bindings, press Mod4+s. Pressing any key closes this overview again.
 +
 
 +
Mod4 + Shift + i:显示当前窗口的class和instance。这在写脚本的时候尤其有用
 +
Mod4 + Shift + r: 重绘当前窗口
 +
 
 +
Win+F2 运行程序
 +
</pre>
 +
 
 +
==布局 Layout==
 +
平铺 Tiled
 +
平铺模式下屏幕被分为master和stacking两个区域。master中的窗口包含了需要最多关注的窗口(通常这表示master中的窗口会占据更大的屏幕空间),而stacking区域中包含了其它窗口。如果你想的话master区域可以被划分为多行和多列
 +
 
 +
浮动 Floating
 +
每个窗口都可以自由的移动和调整大小,就好像普通的窗口管理器一样。无论当前是什么布局,对话框窗口总是处在浮动状态
 +
== 启动器==
 +
[[Kali初始化#launcher|#launcher]]
 +
===rofi on awesome===
 +
<pre>
 +
pkg install rofi
 +
 
 +
 
 +
#配置
 +
cd ~/.config/rofi/, 使用 rofi -dump-Xresources > config #生成配置文件
 +
rofi-theme-selector #选择你想要的主题即可
 +
 
 +
vim ~/.config/rofi/config
 +
configuration {
 +
    /* 配置显示类型 */
 +
    modi: "window,run,ssh,drun";
 +
    /* 配置是否支持icon以及icon主题 */
 +
    show-icons: true;  !应用的图标 这个注释可能是不对的哦 要注意
 +
    icon-theme: "Numix";
 +
    drun-icon-theme: "Numix";
 +
 
 +
 
 +
#bind  is  win +d  不加主题的也是不错的呢
 +
vi .config/awesome/rc.lua
 +
--rofi 2020 ln 299
 +
    awful.key({ modkey,          }, "d",
 +
              function ()
 +
                  commandPrompter          = "rofi -show drun "
 +
 
 +
                  commandPrompter          = "rofi -show drun -theme fancy"
 +
                  awful.spawn(commandPrompter)
 +
          end,
 +
              {description = "rofi", group = "launcher"}),
 +
 
 +
PS 几个不错的 rofi  theme
 +
rofi -show drun -theme dmenu
 +
rofi -show drun -theme  Adapta-Nokto
 +
rofi -show drun -theme  Arc-Dark
 +
rofi -show drun -theme  solarized
 +
rofi -show drun -theme  solarized_alternate
 +
 
 +
#自启动
 +
cat  .bashrc
 +
#evan
 +
xautolock -time 10 -locker "i3lock  -b  -i '/home/evan/wallpaper/sj.png'" &
 +
 
 +
#freebsd
 +
#这个一般不是 gdm什么的登录用的
 +
cat .xinitrc
 +
#!/bin/bash
 +
#on freebsd success if u run xmonad  must open it
 +
#/home/evan/.xmonad/autostart.sh
 +
 
 +
#xautolock -time 10 -locker "i3lock  -b  -i '/home/evan/wallpaper/2020-02-04_14-46.png'" &
 +
xautolock -time 30 -locker "i3lock  -b  -i '/home/evan/wallpaper/sj.png'" &
 +
 
 +
 
 +
</pre>
 +
 
 +
https://github.com/davatorium/rofi-themes
 +
 
 +
https://stackoverflow.com/questions/41534987/how-to-toggle-the-titlebar-in-awesomewm
 +
 
 +
[https://www.jianshu.com/p/f25465ca5e73 自己折腾个rofi配置]
 +
 
 +
https://blog.wizardsoftheweb.pro/rofi-useful-options-i/
 +
 
 +
==battery==
 +
<pre>
 +
 
 +
</pre>
 +
 
 +
==Network Manager==
 +
<pre>
 +
cat .xinitrc
 +
#!/bin/bash
 +
sudo  /usr/local/bin/networkmgr &
 +
</pre>
 +
 
 +
== 自启动==
 +
<pre>
 +
autorun = true
 +
 
 +
autorunApps =
 +
{
 +
    "nm-applet &",
 +
    "/usr/bin/redshift-gtk",
 +
    "xfce4-power-manager",
 +
-- at the end  must be  has a  ,
 +
--    "kupfer --no-splash"
 +
    "fcitx",
 +
    "/usr/bin/telegram-desktop -startintray",
 +
    "xautolock -time 19 -locker 'i3lock -i /home/evan/wallpaper/sj.png' ",
 +
--    "dbus-launch gnome-do",
 +
--    "synapse -s &",
 +
--    "/opt/qq2012/wineapp/qq/qq.sh",
 +
--    "dbus-launch gnome-do",
 +
 
 +
 
 +
}
 +
 
 +
 
 +
 
 +
if autorun then
 +
    for app = 1, #autorunApps do
 +
        awful.util.spawn_with_shell(autorunApps[app])
 +
    end
 +
end
 +
 
 +
</pre>
 +
 
 +
== 双屏==
 +
<pre>
 +
#xps13  on lxtx
 +
 
 +
modkey + o 快捷键可以发送 window 到另一个 screen。
 +
 
 +
modkey+ctrl+j ,    modkey+ctrl+k    切换不同的screen #也就是在 本本显示器 和外置显示器之间切换
 +
 
 +
modkey+left    ,    modkey+right    切换不同的虚拟桌面 在同一个显示器中
 +
xrandr --output DP-1    --mode 1920x1080  --right-of    eDP-1 --auto
 +
 
 +
#VGA
 +
# at lxtx April 30 2020
 +
#外接显示器DP-1作为主屏幕,eDP-1是本本          打开外接显示器(--auto:最高分辨率),设置为左侧扩展屏幕
 +
#外接显示器DP-1作为主屏幕,eDP-1是本本
 +
xrandr --output DP-1    --mode 1920x1080  --right-of    eDP-1 --auto
 +
#xrandr --output DP-1      --right-of    eDP-1 --auto
 +
 
 +
or  下面是参考
 +
xrandr --output  eDP-1  --left-of  DP-1    --auto
 +
 
 +
#右扩展
 +
#xrandr --output DP-1    --right-of    eDP-1 --auto
 +
 
 +
#xrandr --output  eDP-1  --mode 1920x1080  --right-of  DP-1    --auto
 +
#xrandr --output DP2 --same-as  eDP1  --mode 1366x768  --output DP2 --mode 1920x1080
 +
 
 +
#if hdmi on home
 +
xrandr --output HDMI-1 --same-as  LVDS-1  --mode 1366x768  --output HDMI-1 --mode 1920x1080
 +
 
 +
</pre>
 +
 
 +
 
 +
[https://www.chengweiyang.cn/2018/04/24/awesome-multi-monitor-1/ 在 awesome wm 下使用两个显示器]
 +
 
 +
[https://www.chengweiyang.cn/2018/04/28/awesome-multi-monitor-2/ 在 awesome wm 下使用两个显示器(续]
 +
 
 +
[https://www.cnblogs.com/pylemon/archive/2012/02/06/2340556.html  让 awesome 支持双屏 ]
 +
 
 +
[https://unix.stackexchange.com/questions/389465/switch-between-monitors-with-dual-display-state-awesome-wm Switch between monitors with dual display state [awesome wm<nowiki>]</nowiki>]
 +
 
 +
https://bbs.archlinuxcn.org/viewtopic.php?id=1811
 +
 
 +
 
 +
[https://stackoverflow.com/questions/55983407/awesome-wm-wonky-multi-monitor-setup Awesome WM wonky multi-monitor setup]
 +
 
 +
=优化2020=
 +
有空注释掉不要的 layouts
 +
 
 +
[https://blog.csdn.net/minghe_uestc/article/details/7489157 awesome使用与配置]
 +
 
 +
从这里开始看官方文档
 +
https://awesomewm.org/apidoc/index.html
 +
 
 +
https://github.com/wzpan/awesome-config
 +
 
 +
官方文档 要过一下  找一下像i3一样的官方过程过一下才行 
 +
https://awesomewm.org/apidoc/core_components/tag.html
 +
 
 +
https://awesomewm.org/apidoc/sample%20files/rc.lua.html
 +
 
 +
https://github.com/4ban/awesome-ban
 +
 
 +
 
 +
[https://zhuanlan.zhihu.com/p/58254611 Awesome WM主题设置分享]
 +
 
 +
==声音控制==
 +
 
 +
https://wiki.archlinux.org/index.php/PulseAudio
 +
 
 +
https://wiki.debian.org/PulseAudio
 +
 
 +
==问题==
 +
好消息现在又回来了
 +
安装不上的原因
 +
[2017-09-19] awesome 4.0-1 removed from kali-rolling (Kali Repository)
 +
 
 +
http://pkg.kali.org/pkg/awesome#
 +
 
 +
==参考==
 +
 
 +
[https://awesomewm.org/recipes/ 官方配置教程 recipes]
 +
 
 +
https://awesomewm.org/apidoc/documentation/07-my-first-awesome.md.html#
 +
 
 +
[https://awesomewm.org/apidoc/documentation/17-porting-tips.md.html#v4 官方文档]
 +
 
 +
[https://wiki.archlinux.org/index.php/Awesome_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87) awesome (简体中文)]
 +
 
 +
 
 +
[https://github.com/evan886/awesome  my awesome github]
 +
 
 +
[https://i.linuxtoy.org/docs/guide/ch38.html linuxtoy awesome]
 +
 
 +
[https://awesomewm.org/index.html 官网]
 +
 
 +
[https://blog.csdn.net/minghe_uestc/article/details/7489157 awesome使用与配置]
 +
 
 +
[https://github.com/alswl/awesome/blob/master/README.md 主要配置参考 ]
 +
 
 +
[http://www.hahack.com/tools/awesome/# 平铺式窗口管理器-Awesome]
 +
 
 +
[http://wiki.ubuntu.org.cn/Awesome#.E4.BB.80.E4.B9.88.E6.98.AF.E5.B9.B3.E9.93.BA.E5.BC.8F.E7.AA.97.E5.8F.A3.E7.AE.A1.E7.90.86.EF.BC.9F Awesome ubuntu wiki]
 +
 +
[https://wiki.gentoo.org/wiki/Awesome/zh-cn gentoo awesome]
 +
 
 +
[http://forum.ubuntu.com.cn/viewtopic.php?f=155&t=290865&p=2036789 神奇的awesome,彻底败给它了wallpaper]
 +
 
 +
[https://www.linuxzen.com/awesometmuxgnomedoda-zao-gao-xiao-linuxzhuo-mian-huan-jing.html Awesome+tmux+gnomeDo打造高效Linux桌面环境]
 +
 
 +
[http://epsi-rns.github.io/desktop/2016/06/30/awesome-install-debian.html Install Awesome WM in Debian]
 +
 
 +
[http://blog.51cto.com/darksun/1391074 Awesome window manager使用初探]
 +
 
 +
[https://forum.suse.org.cn/t/awesome/2047 Awesome 入门安装、配置、使用(纯入门实用主义)]
 +
 
 +
[http://tieba.baidu.com/p/3311663190?traceid= 花式晒桌面之awesome折腾手记]
 +
 
 +
[http://www.chengweiyang.cn/2016/02/16/how-to-lock-screen-in-awesome-wm/ 在 Awesome 窗口管理器中开启锁屏快捷键]
 +
 
 +
 
 +
[https://github.com/stefano-m/awesome-connman_widget A widget for the Awesome Window Manager to monitor the network with Connman]
 +
 
 +
==多显示器==
 +
[http://www.chengweiyang.cn/2018/04/24/awesome-multi-monitor-1/ 在 awesome wm 下使用两个显示器]
 +
 
 +
[http://www.chengweiyang.cn/2018/04/28/awesome-multi-monitor-2/ 在 awesome wm 下使用两个显示器(续)]
 +
 
 +
[https://www.cnblogs.com/pylemon/archive/2012/02/06/2340556.html 让 awesome 支持双屏]
 +
 
 +
[https://zhuanlan.zhihu.com/p/58254611 Awesome WM主题设置分享]
 +
 
 +
Awesome简单配置
 +
http://www.jianshu.com/p/2d1e138a60d3
 +
 
 +
Awesome 配置笔记
 +
https://segmentfault.com/a/1190000000366665
  
 
=see also=
 
=see also=
 +
[https://www.hahack.com/tools/awesome/# 平铺式窗口管理器-Awesome]
 +
 +
 +
第 38 章 awesome
 +
http://i.linuxtoy.org/docs/guide/ch38s05.html#id3160077
 +
 +
https://linuxtoy.org/archives/awesome.html
 +
 +
 +
 +
以Awesome为基础打造一个强大桌面系统
 +
http://sillydong.com/mysa/mylinux/awesome-desktop.html
 +
 +
 +
 +
轻量组件
 +
http://wiki.ubuntu.org.cn/%E8%BD%BB%E9%87%8F%E7%BB%84%E4%BB%B6
  
  
[https://blog.csdn.net/u012814856/article/details/80211149  意外的惊喜:f.lux, 一款真的很强大的护眼软件]
+
开源世界旅行手册
 +
http://i.linuxtoy.org/docs/guide/index.html
  
[https://www.cnblogs.com/haohao77/p/8177920.html RedShift护眼软件的配置]
+
Display manager
[https://www.jianshu.com/p/9be53965ed2f 四个 Linux 下的“护眼”软件]
+
https://wiki.archlinux.org/index.php/Display_manager_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
  
[https://cloud.tencent.com/developer/article/1578675 Linux 开启护眼模式,降低蓝光伤害]
 
  
[https://wiki.archlinux.org/index.php/Redshift_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87) Redshift (简体中文)]
+
Tencent QQ (简体中文)
 +
https://wiki.archlinux.org/index.php/Tencent_QQ_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#.E5.9F.BA.E4.BA.8E_WebQQ
  
[https://blog.csdn.net/songchuwang1868/article/details/104406574  Linux高效护眼——怎样将redshift设置成全天高效护眼]
+
[[category:Desktop]]

2021年2月5日 (五) 14:02的版本

平铺式窗口管理器

什么是平铺式窗口管理器?简单来说,所谓的平铺就是之所有的窗口都不会相互重叠,而是自动的被调整大小使得它们能够刚好占满整个屏幕。这和传统的桌面环境的概念相差很大,也许你会疑问这样的环境下如何工作? 事实上对于Linux这种需要大量使用命令行的操作系统来说平铺式窗口管理在很多情况下能够极大的提升你的工作效率。举个例子,很多时候你都需要打开好几个shell。在gnome底下这就意味着好几个会相互遮挡命令行窗口,大多数时候如果你想要同时看到这些窗口上面的内容就得费神费力的调整它们的位置和大小。而在平铺式窗口下面你完全不需要为这些事情烦心。 另外一个可能会促使你使用平铺的理由就是,用它来调整、切换窗口几乎可以不使用鼠标。

使用原因 xmonads 坏了 ,于是

安装

sudo apt update
sudo apt-get install awesome  awesome-extra feh xcompmgr xscreensaver lxrandr
git clone https://github.com/evan886/awesome.git  ~/.config/awesome
#git clone https://github.com/alswl/awesome.git  ~/.config
cd awesome/
#cp _autostart.sh autostart.sh


#特别配置 
 head -n 57 rc.lua #因为 它启动有点不太妥
terminal = "terminator -u"


##add to ~/.config/awesome/rc.lua

配置自动启程序 记住 很多在这里自启动的 2019年 01月 03日
使用awesome之后之前设置的自动启动就会失效,因为Awesome启动是通过配置文件控制的,在配置文件(~/.config/awesome/rc.lua)加上如下内容可以配置自启动程序:

autorun = true
autorunApps = 
{ 
    "nm-applet &",
    "kupfer --no-splash"
--    "fcitx",
--    "dbus-launch gnome-do",
--    "synapse -s &",
--    "/opt/qq2012/wineapp/qq/qq.sh",
--    "dbus-launch gnome-do",


}

if autorun then
    for app = 1, #autorunApps do
        awful.util.spawn_with_shell(autorunApps[app])
    end
end

--在autorunApps中添加要自动启动程序的命令即可在登录时启动相应的程序





# 托盘 trayer
trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype pixel --width 128 --transparent true --alpha 0 --tint 0x000000 --height 26 &



# on xmonad
 #  apt install trayer  Set up an icon tray
 trayer --edge top --align right --SetDockType true --SetPartialStrut true \
      --expand true --width 6 --transparent true --tint 0x191970 --height 26 &

 #trayer --edge top --align right --SetDockType true --SetPartialStrut true \
 #     --expand true --width 9 --transparent true --tint 0x191970 --height 26 &
# Empathy chat client (-h: start hidden, -n: don't connect on launch)



默认配置文件 
/etc/xdg/awesome/rc.lua


作好更改后,检查配置文件是否有错误是非常有用的:

user $awesome -k
✔ Configuration file syntax OK

美化

git clone git://github.com/mikar/awesome-themes.git ~/.config/awesome/themes

锁屏

i3lock

Before starting  前提  安装这两个软件先
... make sure you have xautolock and i3lock installed.

or  xautolock  installed.

apt install i3lock  xautolock  -y

添加在awesome 自启动列表中
 "xautolock -time 19 -locker 'i3lock -i /home/evan/wallpaper/sj.png' ",

#配置快捷键
vim .config/awesome/rc.lua
-- ln 327 
-- Ctrl + Atl + l 锁屏:
-- 因为 Windows 中是 Win + L ,但在 awesome 中 Win + L 已经被用来干其他事情screensaver-command -lock')
    awful.key({ modkey, "Control" }, "l", function () awful.spawn("i3lock  -b  -i '/home/evan/wallpaper/sj.png'") end,
              {description = "lock ", group = "launcher"}),



#这个 自启动不规范 不要了 
cat .xinitrc
#!/bin/bash
#success if u run xmonad  must open it 
#/home/evan/.xmonad/autostart.sh
#放到 awesome的自启动中会比较 规范一点点呢 
xautolock -time 10 -locker "i3lock -i '/home/evan/wallpaper/2020-02-04_14-46.png'" &


rabexc.org awesome-xautolock-battery

save


gnome-screensaver

 sudo apt install  gnome-screensaver 

要先设置 自启动 


vim  ~/.config/awesome/rc.lua

-- autorun app by evan
autorun = true
autorunApps = 
{ 
    "nm-applet &",
    "xscreensaver -no-splash &",

    awful.key({ modkey, "Control" }, "l", function () awful.spawn("xscreenaver-commadn --lock") end,
              {description = "lock ", group = "launcher"}),



-- is good 运行
awful.util.spawn_with_shell("/usr/bin/gnome-screensaver")
-- Ctrl + Atl + l 锁屏:
-- 因为 Windows 中是 Win + L ,但在 awesome 中 Win + L 已经被用来干其他事情了
awful.key({"Mod1", "Control"}, "l", function ()
    awful.util.spawn("gnome-screensaver-command --lock") 
end)


-- oldCtrl + Atl + l 锁屏:
-- 因为 Windows 中是 Win + L ,但在 awesome 中 Win + L 已经被用来干其他事情了
awful.key({"Mod1", "Control"}, "l", function ()
    awful.util.spawn('xscreensaver-command -lock')
end)

发现的问题 直接运行  gnome-screensaver-command --lock 可以 用快捷键居然不行呀 

在 Awesome 开启锁屏快捷键

主题和壁纸

1 修改默认的主题配置文件
sudo vim /usr/share/awesome/themes/default/theme.lua
theme.wallpaper = "/home/evan/images/sonnenaufgang.jpg"
--theme.wallpaper = "/usr/share/awesome/themes/default/background.png"

2.或者选择不同的themes
vim  ~/.config/awesome/rc.lua # 打开然后分别添加或者edit
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
--beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua") --这个是原来默认的
--beautiful.init("~/.config/awesome/themes/multicolor/theme.lua")
--him  cool-blue  rainbow wombat  foo    niceandclean    elric   tree   strict   dremora  dust sunjack   byte grey-new   matrix   multicolor
beautiful.init("~/.config/awesome/themes/tree/theme.lua")


beautiful.init("~/.config/awesome/themes/snow/theme.lua")
--beautiful.init("~/.config/awesome/themes/blue/theme.lua")

例如主题是 tree 
那么就选择一个你要的相片并改名为 background.jpg or  background.png 放到
/home/evan/.config/awesome/themes/tree/

美化

  • 用了lxappearance什么后 icon变得很好看

默认的 gtk 界面在 XMonad 下相当地丑, 可以安装lxappearance来调整 GTK 的主题.

电池显示

Awesome WM主题设置分享

常用快捷键

Super+S键可以显示已经设置在awesome配置中的快捷方式

使用 前面这几个比较常用
配置完成后注销使用Awesome会话登录,Awesome使用Win键作为主键,几个常用的为:

Win+ Shift + q:退出awesome

Win+num 可以在多个桌面切换
Win+Ctrl+r reload(重启)Awesome,
Win+k/j可以切换窗口(类Vim操作),

Win+m/n     最大/小化窗口, ##

Win+Shift+num 可以将当前窗口发送到其他桌面.
Win+Shift+C可以关闭当前窗口,
Win+Space可以切换布局,Awesome有多种布局,这里不作介绍,大家可以自己稍作尝试



首先把修饰键设置为 Win 键,这样不会和其它的快捷键冲突。附件里有配置文件,可以直接使用。

Win+数字键 切换工作区
Win+Space 切换窗口布局比如水平布局下,新开窗口与原窗口水平分割桌面。布局有下面几种:
水平布局与垂直布局各两种,区别在于新开窗口的位置。它们是最常用的布局
全屏布局。这个不实用,可以用 Win+m 最大化/还原当前窗口
螺旋布局。似乎也不太实用,反正我很少用
逐渐减小布局。和上面的那个差不多
浮动布局。类似传统窗口管理器的布局。对于不规则的窗口,像 GIMP、mplayer 等,无论在任何布局下窗口都是浮动的。可以在配置文件里设定哪些程序使用浮动窗口。调整浮动窗口的位置时,按下 Win 键,用鼠标拖动就可以了。
Win+Enter 开启预设的终端
Win+Shift+C 关闭当前窗口
Win+Shift+数字键 把当前窗口发送到其它工作区
Win+j Win+k 切换到其它窗口

Win+h Win+l 调整当前窗口大小这一组快捷键是VI风格的。

Mod4 + Shift + j:当前窗口和前一个窗口互换位置
Mod4 + Shift + k:当前窗口和后一个窗口互换位置


Mod4 + Left:查看前一个tag
Mod4 + Right:查看后一个tag


Mod4 + space:把当前tag更换为下一种布局
Mod4 + Shift + space:把当前tag更换为前一种布局

Mod4 + Control + space:切换当前窗口是否为浮动的





Mod4 + t :标记窗口(可标记多个)
Mod4 + Shift + F1~F9:把标记的窗口移动到第一~第九桌面上
Ctrl + Mod4 + 1~9:把当前桌面和1~9桌面同时显示
Mod4 + 1~9:恢复
Mod4 + Esc:快速切换到上一个桌面

#这些没怎么用过 后来用了双屏后 天天用呢 
Mod4 + Control + j:切换到下一个屏幕
Mod4 + Control + k:切换到前一个屏幕

Mod4 + Shift + h:增加主区域窗口的数量
Mod4 + Shift + l:减少主区域窗口的数量
Mod4 + Control + h:增加非主区域窗口的数量
Mod4 + Control + l:减少非主区域窗口的数量
Mod4+f will make your current window fullscreen.

Also try Mod4+h, Mod4+l, Mod4+Shift+h and Mod4+Shift+l to resize windows. You can also resize with Mod4+Button3 (right click). 

For an overview of all key bindings, press Mod4+s. Pressing any key closes this overview again.

Mod4 + Shift + i:显示当前窗口的class和instance。这在写脚本的时候尤其有用
Mod4 + Shift + r: 重绘当前窗口

Win+F2 运行程序

布局 Layout

平铺 Tiled 平铺模式下屏幕被分为master和stacking两个区域。master中的窗口包含了需要最多关注的窗口(通常这表示master中的窗口会占据更大的屏幕空间),而stacking区域中包含了其它窗口。如果你想的话master区域可以被划分为多行和多列

浮动 Floating 每个窗口都可以自由的移动和调整大小,就好像普通的窗口管理器一样。无论当前是什么布局,对话框窗口总是处在浮动状态

启动器

#launcher

rofi on awesome

pkg install rofi


#配置
cd ~/.config/rofi/, 使用 rofi -dump-Xresources > config #生成配置文件
rofi-theme-selector #选择你想要的主题即可

vim ~/.config/rofi/config
configuration {
    /* 配置显示类型 */
    modi: "window,run,ssh,drun";
    /* 配置是否支持icon以及icon主题 */
    show-icons: true;  !应用的图标 这个注释可能是不对的哦 要注意 
    icon-theme: "Numix";
    drun-icon-theme: "Numix";


#bind   is  win +d   不加主题的也是不错的呢
vi .config/awesome/rc.lua
--rofi 2020 ln 299
    awful.key({ modkey,           }, "d",
               function ()
                   commandPrompter          = "rofi -show drun "

                   commandPrompter          = "rofi -show drun -theme fancy"
                   awful.spawn(commandPrompter)
           end,
              {description = "rofi", group = "launcher"}),

PS 几个不错的 rofi  theme 
rofi -show drun -theme dmenu
rofi -show drun -theme  Adapta-Nokto
rofi -show drun -theme   Arc-Dark
rofi -show drun -theme  solarized
rofi -show drun -theme  solarized_alternate

#自启动 
cat  .bashrc 
#evan 
xautolock -time 10 -locker "i3lock  -b  -i '/home/evan/wallpaper/sj.png'" &

#freebsd
#这个一般不是 gdm什么的登录用的
cat .xinitrc
#!/bin/bash
#on freebsd success if u run xmonad  must open it 
#/home/evan/.xmonad/autostart.sh

#xautolock -time 10 -locker "i3lock  -b  -i '/home/evan/wallpaper/2020-02-04_14-46.png'" &
xautolock -time 30 -locker "i3lock  -b  -i '/home/evan/wallpaper/sj.png'" &


https://github.com/davatorium/rofi-themes

https://stackoverflow.com/questions/41534987/how-to-toggle-the-titlebar-in-awesomewm

自己折腾个rofi配置

https://blog.wizardsoftheweb.pro/rofi-useful-options-i/

battery


Network Manager

cat .xinitrc
#!/bin/bash
sudo  /usr/local/bin/networkmgr &

自启动

autorun = true

autorunApps = 
{ 
    "nm-applet &",
    "/usr/bin/redshift-gtk",
    "xfce4-power-manager",
-- at the end  must be  has a  , 
--    "kupfer --no-splash"
    "fcitx",
    "/usr/bin/telegram-desktop -startintray",
    "xautolock -time 19 -locker 'i3lock -i /home/evan/wallpaper/sj.png' ",
--    "dbus-launch gnome-do",
--    "synapse -s &",
--    "/opt/qq2012/wineapp/qq/qq.sh",
--    "dbus-launch gnome-do",


}



if autorun then
    for app = 1, #autorunApps do
        awful.util.spawn_with_shell(autorunApps[app])
    end
end

双屏

#xps13  on lxtx 

 modkey + o 快捷键可以发送 window 到另一个 screen。

modkey+ctrl+j ,     modkey+ctrl+k    切换不同的screen #也就是在 本本显示器 和外置显示器之间切换

modkey+left    ,     modkey+right     切换不同的虚拟桌面 在同一个显示器中 
xrandr --output DP-1    --mode 1920x1080   --right-of     eDP-1 --auto

#VGA
# at lxtx April 30 2020
#外接显示器DP-1作为主屏幕,eDP-1是本本           打开外接显示器(--auto:最高分辨率),设置为左侧扩展屏幕
#外接显示器DP-1作为主屏幕,eDP-1是本本 
xrandr --output DP-1    --mode 1920x1080   --right-of     eDP-1 --auto
#xrandr --output DP-1      --right-of     eDP-1 --auto

or  下面是参考 
xrandr --output   eDP-1   --left-of  DP-1    --auto

#右扩展
#xrandr --output DP-1     --right-of     eDP-1 --auto

#xrandr --output   eDP-1   --mode 1920x1080   --right-of  DP-1     --auto
#xrandr --output DP2 --same-as   eDP1  --mode 1366x768  --output DP2 --mode 1920x1080

#if hdmi on home
xrandr --output HDMI-1 --same-as   LVDS-1  --mode 1366x768  --output HDMI-1 --mode 1920x1080


在 awesome wm 下使用两个显示器

在 awesome wm 下使用两个显示器(续

让 awesome 支持双屏

Switch between monitors with dual display state [awesome wm]

https://bbs.archlinuxcn.org/viewtopic.php?id=1811


Awesome WM wonky multi-monitor setup

优化2020

有空注释掉不要的 layouts

awesome使用与配置

从这里开始看官方文档 https://awesomewm.org/apidoc/index.html

https://github.com/wzpan/awesome-config

官方文档 要过一下 找一下像i3一样的官方过程过一下才行 https://awesomewm.org/apidoc/core_components/tag.html

https://awesomewm.org/apidoc/sample%20files/rc.lua.html

https://github.com/4ban/awesome-ban


Awesome WM主题设置分享

声音控制

https://wiki.archlinux.org/index.php/PulseAudio

https://wiki.debian.org/PulseAudio

问题

好消息现在又回来了 安装不上的原因 [2017-09-19] awesome 4.0-1 removed from kali-rolling (Kali Repository)

http://pkg.kali.org/pkg/awesome#

参考

官方配置教程 recipes

https://awesomewm.org/apidoc/documentation/07-my-first-awesome.md.html#

官方文档

awesome (简体中文)


my awesome github

linuxtoy awesome

官网

awesome使用与配置

主要配置参考

平铺式窗口管理器-Awesome

Awesome ubuntu wiki

gentoo awesome

神奇的awesome,彻底败给它了wallpaper

Awesome+tmux+gnomeDo打造高效Linux桌面环境

Install Awesome WM in Debian

Awesome window manager使用初探

Awesome 入门安装、配置、使用(纯入门实用主义)

花式晒桌面之awesome折腾手记

在 Awesome 窗口管理器中开启锁屏快捷键


A widget for the Awesome Window Manager to monitor the network with Connman

多显示器

在 awesome wm 下使用两个显示器

在 awesome wm 下使用两个显示器(续)

让 awesome 支持双屏

Awesome WM主题设置分享

Awesome简单配置 http://www.jianshu.com/p/2d1e138a60d3

Awesome 配置笔记 https://segmentfault.com/a/1190000000366665

see also

平铺式窗口管理器-Awesome


第 38 章 awesome http://i.linuxtoy.org/docs/guide/ch38s05.html#id3160077

https://linuxtoy.org/archives/awesome.html


以Awesome为基础打造一个强大桌面系统 http://sillydong.com/mysa/mylinux/awesome-desktop.html


轻量组件 http://wiki.ubuntu.org.cn/%E8%BD%BB%E9%87%8F%E7%BB%84%E4%BB%B6


开源世界旅行手册 http://i.linuxtoy.org/docs/guide/index.html

Display manager https://wiki.archlinux.org/index.php/Display_manager_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)


Tencent QQ (简体中文) https://wiki.archlinux.org/index.php/Tencent_QQ_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#.E5.9F.BA.E4.BA.8E_WebQQ