“Awesome”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
第335行: 第335行:
 
#bind  is  win +d  不加主题的也是不错的呢
 
#bind  is  win +d  不加主题的也是不错的呢
 
vi .config/awesome/rc.lua
 
vi .config/awesome/rc.lua
 +
-- Standard program
 
--rofi 2020 ln 299
 
--rofi 2020 ln 299
 
     awful.key({ modkey,          }, "d",
 
     awful.key({ modkey,          }, "d",

2022年8月9日 (二) 14:36的版本

平铺式窗口管理器

什么是平铺式窗口管理器?简单来说,所谓的平铺就是之所有的窗口都不会相互重叠,而是自动的被调整大小使得它们能够刚好占满整个屏幕。这和传统的桌面环境的概念相差很大,也许你会疑问这样的环境下如何工作? 事实上对于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

on openbsd7

evanbsd# pkg_add awesome     
quirks-4.53 signed on 2021-09-27T20:36:58Z
awesome-4.3p3:lua-5.3.6: ok
awesome-4.3p3:lua53-lgi-0.9.1p1: ok
awesome-4.3p3:libxdg-basedir-1.2.0p2: ok
awesome-4.3p3:rlwrap-0.43p0: ok
awesome-4.3p3: ok
--- +awesome-4.3p3 -------------------
Before running awesome, a configuration file needs to be created.
Copy the provided /usr/local/share/examples/awesome/rc.lua to
~/.config/awesome/rc.lua and modify as necessary.

To migrate a custom rc.lua from version 3.5.x to version 4.x, see
https://awesomewm.org/apidoc/documentation/17-porting-tips.md.html#v4
evanbsd# 

锁屏

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 开启锁屏快捷键

主题和壁纸

Themes awesome-copycats

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 的主题.

电池显示 battery

cbatticon # 然后设置自启动

Awesome WM主题设置分享

https://github.com/mmalecki/awesome-batteryInfo

https://github.com/velovix/awesome.battery-widget

https://github.com/koenw/awesome-batteryInfo/blob/master/battery.lua

常用快捷键

 Super here is win 
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
 -- Standard program
--rofi 2020 ln 299
    awful.key({ modkey,           }, "d",
               function ()
                   commandPrompter          = "rofi -combi-modi window,drun,ssh -theme solarized -font 'hack 13' -show combi -icon-theme 'Papirus' -show-icons "
                   -- 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://wiki.archlinux.org/title/Rofi

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

自己折腾个rofi配置

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

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

双屏



通过 modkey (me is  win )+ o 快捷键可以发送 window 到另一个 screen
#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#

see also

Xmonad安装及入门配置

参考

官方配置教程 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

Polybar

polybar is a fast and easy-to-use tool for creating status bars. I

Polybar 的配置笔记

wiki.archlinux. Polybar

https://wiki.gentoo.org/wiki/Polybar

Polybar:适用于Linux系统的更好的WM面板

https://github.com/drdeimos/polybar_another_battery

other vm spectrwm is a small, dynamic tiling and reparenting window manager for X11.

https://talk.linuxtoy.org/using-mwm/#31

https://github.com/conformal/spectrwm#readme

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


https://srobb.net/spectrwm.html

Reference.

平铺式窗口管理器-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

awesomewm + urxvt 一个日常使用Linux的轻量环境方案

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

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

开源世界旅行手册 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