Many common changes.

This commit is contained in:
Kolan Sh 2021-04-16 15:45:46 +03:00
parent 952dfd9463
commit 53711db703
3 changed files with 249 additions and 253 deletions

View File

@ -1,13 +1,15 @@
os.execute ("setxkbmap -layout 'us,ru'")
os.execute ("setxkbmap -option 'grp:shift_toggle,grp_led:scroll,terminate:ctrl_alt_bksp'")
os.execute ("xrandr --setprovideroutputsource modesetting NVIDIA-0 && xrandr --auto")
--os.execute (os.getenv("HOME").."/.config/awesome/set_wall.sh "..os.getenv("HOME").."/.config/awesome/wallpaper.slink &")
os.execute ("pgrep xscreensaver || xscreensaver -no-splash &")
os.execute ("pgrep mail_loop.sh || "..os.getenv("HOME").."/.config/awesome/mail_loop.sh &")
os.execute ("pgrep wicd-client || wicd-gtk --tray &")
os.execute ("pgrep nm-applet || nm-applet &")
os.execute ("numlockx on &")
os.execute ("smbnetfs "..os.getenv("HOME").."/smb &")
--os.execute ("smbnetfs "..os.getenv("HOME").."/smb &")
--os.execute ("pgrep lightsOn.sh || "..os.getenv("HOME").."/.config/awesome/lightsOn.sh &")
--os.execute ("pgrep urxvt || urxvt &")
--os.execute ("pgrep stardict || stardict &")
--os.execute ("pgrep pidgin || pidgin &")
--os.execute ("pgrep firefox || (firefox || firefox-bin) &")
os.execute ("xrandr --output HDMI-0 --left-of eDP-1-1 --mode 1920x1080 &")

492
rc.lua
View File

@ -193,47 +193,47 @@ mymail_mail:buttons(mailicon:buttons())
-- gmail_mail:buttons(mailicon:buttons())
-- nVidia Optimus
local optimus_icon = wibox.widget.imagebox()
local optimus_overclocked = false
optimus_icon:set_image(beautiful.widget_optimus_off)
gears.timer {
timeout = 3,
autostart = true,
callback = function()
local f = io.open("/proc/acpi/bbswitch", "r")
local l = nil
if f ~= nil then
l = f:read()
if string.sub (l, 14) == "ON" then
if optimus_overclocked == true then
optimus_icon:set_image(beautiful.widget_optimus_overclocked)
else
optimus_icon:set_image(beautiful.widget_optimus_on)
end
else
optimus_icon:set_image(beautiful.widget_optimus_off)
optimus_overclocked = false
end
f:close()
else
optimus_icon:set_image(beautiful.widget_optimus_off)
end
end
}
optimus_icon:buttons(awful.util.table.join(
awful.button({ }, 1,
function ()
os.execute ("pgrep nvidia-settings || optirun nvidia-settings -c :8 &")
end
),
awful.button({ }, 3,
function ()
os.execute ("optirun nvidia-settings -c :8 -a '[gpu:0]/GPUGraphicsClockOffset[2]=135' &")
os.execute ("optirun nvidia-settings -c :8 -a '[gpu:0]/GPUMemoryTransferRateOffset[2]=560' &")
optimus_overclocked = true
end
)
))
--local optimus_icon = wibox.widget.imagebox()
--local optimus_overclocked = false
--optimus_icon:set_image(beautiful.widget_optimus_off)
--gears.timer {
-- timeout = 3,
-- autostart = true,
-- callback = function()
-- local f = io.open("/proc/acpi/bbswitch", "r")
-- local l = nil
-- if f ~= nil then
-- l = f:read()
-- if string.sub (l, 14) == "ON" then
-- if optimus_overclocked == true then
-- optimus_icon:set_image(beautiful.widget_optimus_overclocked)
-- else
-- optimus_icon:set_image(beautiful.widget_optimus_on)
-- end
-- else
-- optimus_icon:set_image(beautiful.widget_optimus_off)
-- optimus_overclocked = false
-- end
-- f:close()
-- else
-- optimus_icon:set_image(beautiful.widget_optimus_off)
-- end
-- end
--}
--optimus_icon:buttons(awful.util.table.join(
-- awful.button({ }, 1,
-- function ()
-- os.execute ("pgrep nvidia-settings || optirun nvidia-settings -c :8 &")
-- end
-- ),
-- awful.button({ }, 3,
-- function ()
-- os.execute ("optirun nvidia-settings -c :8 -a '[gpu:0]/GPUGraphicsClockOffset[2]=135' &")
-- os.execute ("optirun nvidia-settings -c :8 -a '[gpu:0]/GPUMemoryTransferRateOffset[2]=560' &")
-- optimus_overclocked = true
-- end
-- )
--))
-- Wi-Fi / Ethernet widgets
local net_widget = wibox.widget.textbox()
@ -262,7 +262,7 @@ volicon:buttons(
awful.util.table.join(
-- awful.button({ }, 1, function () os.execute("pgrep alsamixer || urxvt -e alsamixer --view=all &") end),
awful.button({ }, 1, function () os.execute("pgrep pavucontrol || pavucontrol &") end),
awful.button({ }, 3, function () os.execute("pgrep alsamixer || urxvt -e alsamixer -c 1 &") end),
awful.button({ }, 3, function () os.execute("pgrep alsamixer || urxvt -e alsamixer -c 2 &") end),
awful.button({ }, 4, function () os.execute("pgrep -x amixer || amixer set Master 2%+") end),
awful.button({ }, 5, function () os.execute("pgrep -x amixer || amixer set Master 2%-") end)
)
@ -307,7 +307,7 @@ local diskicon = wibox.widget.imagebox()
diskicon:set_image(beautiful.widget_disk)
diskicon:buttons(awful.util.table.join(awful.button({ }, 1, show_iotop)))
disk = wibox.widget.textbox()
vicious.register(disk, vicious.widgets.fs, '<span color="#E68347">${/home avail_gb}Gb </span>', 15)
vicious.register(disk, vicious.widgets.fs, '<span color="#E68347">${/ avail_gb}/${/home avail_gb}/${/mnt/1tb avail_gb}Gb </span>', 15)
disk:buttons(diskicon:buttons())
@ -430,6 +430,7 @@ awful.screen.connect_for_each_screen(function(s)
-- myslash:buttons(mailicon:buttons())
-- right_layout:add(myslash)
-- right_layout:add(gmail_mail)
-- gmail_mail,
spacer,
cpuicon,
cpu,
@ -437,7 +438,7 @@ awful.screen.connect_for_each_screen(function(s)
mem,
diskicon,
disk,
optimus_icon,
--optimus_icon,
spacer,
baticon,
batpct,
@ -740,61 +741,54 @@ awful.rules.rules = {
}, properties = { titlebars_enabled = false }
},
-- Set Firefox to always map on the tag named "2" on screen 1.
-- { rule = { class = "URxvt" },
-- properties = { tag = "2" } },
-- { rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } },
{ rule = { class = "URxvt" },
properties = { tag = "2" } },
{ rule = { class = "Firefox" },
properties = { tag = "1" } },
{ rule = { class = "Opera" },
properties = { tag = "1" } },
{ rule = { class = "Thunderbird" },
properties = { tag = "1" } },
{ rule = { class = "Geary" },
properties = { tag = "1" } },
{ rule = { class = "Liferea" },
properties = { tag = "1" } },
{ rule = { class = "VirtualBox" },
properties = { tag = "3" } },
{ rule = { class = "Remmina" },
properties = { tag = "3" } },
{ rule = { class = "Spicy" },
properties = { tag = "3" } },
{ rule = { class = "Aqemu" },
properties = { tag = "3" } },
{ rule = { name = "Instances - Vimperator" },
properties = { tag = "3" } },
{ rule = { name = "VMs - .* - Vimperator" },
properties = { tag = "3" } },
{ rule = { name = "noVNC - .* - Vimperator" },
properties = { tag = "3" } },
{ rule = { class = "Soffice" },
properties = { tag = "4" } },
{ rule = { class = "LibreOffice" },
properties = { tag = "4" } },
{ rule = { class = "libreoffice-writer" },
properties = { tag = "4" } },
{ rule = { class = "libreoffice-calc" },
properties = { tag = "4" } },
{ rule = { class = "libreoffice-draw" },
properties = { tag = "4" } },
{ rule = { class = "libreoffice-base" },
properties = { tag = "4" } },
{ rule = { class = "libreoffice-math" },
properties = { tag = "4" } },
{ rule = { class = "libreoffice-impress" },
properties = { tag = "4" } },
{ rule = { class = "libreoffice-startcenter" },
properties = { tag = "4" } },
{ rule = { class = "Okular" },
properties = { tag = "4" } },
{ rule = { class = "Lyx" },
properties = { tag = "4" } },
{ rule = { class = "Evince" },
properties = { tag = "4" } },
{ rule = { class = "Qt Jambi application" },
properties = { tag = "1" } },
-- properties = { tag = "1" } },
-- { rule = { class = "Opera" },
-- properties = { tag = "1" } },
-- { rule = { class = "Thunderbird" },
-- properties = { tag = "1" } },
-- { rule = { class = "VirtualBox" },
-- properties = { tag = "3" } },
-- { rule = { class = "Remmina" },
-- properties = { tag = "3" } },
-- { rule = { class = "Spicy" },
-- properties = { tag = "3" } },
-- { rule = { class = "Aqemu" },
-- properties = { tag = "3" } },
-- { rule = { name = "Instances - Vimperator" },
-- properties = { tag = "3" } },
-- { rule = { name = "VMs - .* - Vimperator" },
-- properties = { tag = "3" } },
-- { rule = { name = "noVNC - .* - Vimperator" },
-- properties = { tag = "3" } },
-- { rule = { class = "Soffice" },
-- properties = { tag = "4" } },
-- { rule = { class = "LibreOffice" },
-- properties = { tag = "4" } },
-- { rule = { class = "libreoffice-writer" },
-- properties = { tag = "4" } },
-- { rule = { class = "libreoffice-calc" },
-- properties = { tag = "4" } },
-- { rule = { class = "libreoffice-draw" },
-- properties = { tag = "4" } },
-- { rule = { class = "libreoffice-base" },
-- properties = { tag = "4" } },
-- { rule = { class = "libreoffice-math" },
-- properties = { tag = "4" } },
-- { rule = { class = "libreoffice-impress" },
-- properties = { tag = "4" } },
-- { rule = { class = "libreoffice-startcenter" },
-- properties = { tag = "4" } },
-- { rule = { class = "Okular" },
-- properties = { tag = "4" } },
-- { rule = { class = "Lyx" },
-- properties = { tag = "4" } },
-- { rule = { class = "Evince" },
-- properties = { tag = "4" } },
-- { rule = { class = "Qt Jambi application" },
-- properties = { tag = "1" } },
{ rule = { class = "Pidgin" },
properties = { tag = "+" } },
{ rule = { class = "Telegram" },
@ -803,160 +797,160 @@ awful.rules.rules = {
properties = { tag = "+" } },
{ rule = { class = "Stardict" },
properties = { tag = "-" } },
{ rule = { class = "MPlayer" },
properties = { floating = true } },
{ rule = { class = "Texreport-gtk" },
properties = { floating = true } },
{ rule = { class = "etr" },
properties = { tag = "6" } },
{ rule = { class = "Eboard" },
properties = { tag = "6" } },
{ rule = { class = "charleygame-bin" },
properties = { tag = "6" } },
{ rule = { class = "lincity-ng" },
properties = { tag = "6" } },
{ rule = { class = "Kodi" },
properties = { tag = "6" } },
{ rule = { class = "Vlc" },
properties = { tag = "6" } },
-- { rule = { class = "MPlayer" },
-- properties = { floating = true } },
-- { rule = { class = "Texreport-gtk" },
-- properties = { floating = true } },
-- { rule = { class = "etr" },
-- properties = { tag = "6" } },
-- { rule = { class = "Eboard" },
-- properties = { tag = "6" } },
-- { rule = { class = "charleygame-bin" },
-- properties = { tag = "6" } },
-- { rule = { class = "lincity-ng" },
-- properties = { tag = "6" } },
-- { rule = { class = "Kodi" },
-- properties = { tag = "6" } },
-- { rule = { class = "Vlc" },
-- properties = { tag = "6" } },
{ rule = { class = "Audacious" },
properties = { tag = "6" } },
{ rule = { class = "Audacity" },
properties = { tag = "6" } },
{ rule = { class = "Gimp" },
properties = { tag = "7" } },
{ rule = { class = "Blender" },
properties = { tag = "7" } },
{ rule = { class = "Anjuta" },
properties = { tag = "5" } },
{ rule = { class = "Android SDK Manager" },
properties = { tag = "5" } },
{ rule = { class = "DDMS" },
properties = { tag = "5" } },
{ rule = { class = "Gucharmap" },
properties = { tag = "5" } },
{ rule = { class = "Pcmanfm" },
properties = { tag = "4" } },
{ rule = { class = "Fm" },
properties = { tag = "4" } },
{ rule = { class = "File-roller" },
properties = { tag = "4" } },
{ rule = { class = "Clamtk" },
properties = { tag = "4" } },
{ rule = { class = "Assistant" },
properties = { tag = "5" } },
{ rule = { class = "Bluefish" },
properties = { tag = "5" } },
{ rule = { class = "Designer" },
properties = { tag = "5" } },
{ rule = { class = "Glade" },
properties = { tag = "5" } },
{ rule = { class = "Geany" },
properties = { tag = "5" } },
{ rule = { class = "Gvim" },
properties = { tag = "5" } },
{ rule = { class = "Qtcreator" },
properties = { tag = "5" } },
{ rule = { class = "Kcachegrind" },
properties = { tag = "5" } },
{ rule = { class = "Wxmaxima" },
properties = { tag = "5" } },
{ rule = { class = "0ad" },
properties = { tag = "6" } },
{ rule = { class = "dosbox" },
properties = { tag = "3" } },
{ rule = { class = "Steam" },
properties = { tag = "6" } },
{ rule = { class = "supertux" },
properties = { tag = "6" } },
{ rule = { name = "Minetest" },
properties = { tag = "6" } },
{ rule = { name = "glxgears" },
properties = { tag = "6" } },
{ rule = { class = "urbanterror" },
properties = { tag = "6" } },
{ rule = { class = "warzone2100" },
properties = { tag = "6" } },
{ rule = { class = "xonotic-sdl" },
properties = { tag = "6" } },
{ rule = { class = "DarkPlaces" },
properties = { tag = "6" } },
{ rule = { class = "Camorama" },
properties = { tag = "6" } },
{ rule = { class = "Dia" },
properties = { tag = "7" } },
{ rule = { class = "feh" },
properties = { tag = "7" } },
{ rule = { class = "FreeCAD" },
properties = { tag = "7" } },
{ rule = { class = "Gcolor2" },
properties = { tag = "7" } },
{ rule = { class = "GQview" },
properties = { tag = "7" } },
{ rule = { class = "Inkscape" },
properties = { tag = "7" } },
{ rule = { class = "Shotwell" },
properties = { tag = "7" } },
{ rule = { name = "Xdvi" },
properties = { tag = "4" } },
{ rule = { class = "Deluge" },
properties = { tag = "1" } },
{ rule = { class = "Eiskaltdcpp" },
properties = { tag = "1" } },
{ rule = { class = "Ekiga" },
properties = { tag = "+" } },
{ rule = { class = "Googleearth-bin" },
properties = { tag = "1" } },
{ rule = { class = "Links" },
properties = { tag = "1" } },
{ rule = { class = "Linphone" },
properties = { tag = "1" } },
properties = { tag = "0" } },
-- { rule = { class = "Audacity" },
-- properties = { tag = "6" } },
-- { rule = { class = "Gimp" },
-- properties = { tag = "7" } },
-- { rule = { class = "Blender" },
-- properties = { tag = "7" } },
-- { rule = { class = "Anjuta" },
-- properties = { tag = "5" } },
-- { rule = { class = "Android SDK Manager" },
-- properties = { tag = "5" } },
-- { rule = { class = "DDMS" },
-- properties = { tag = "5" } },
-- { rule = { class = "Gucharmap" },
-- properties = { tag = "5" } },
-- { rule = { class = "Pcmanfm" },
-- properties = { tag = "4" } },
-- { rule = { class = "Fm" },
-- properties = { tag = "4" } },
-- { rule = { class = "File-roller" },
-- properties = { tag = "4" } },
-- { rule = { class = "Clamtk" },
-- properties = { tag = "4" } },
-- { rule = { class = "Assistant" },
-- properties = { tag = "5" } },
-- { rule = { class = "Bluefish" },
-- properties = { tag = "5" } },
-- { rule = { class = "Designer" },
-- properties = { tag = "5" } },
-- { rule = { class = "Glade" },
-- properties = { tag = "5" } },
-- { rule = { class = "Geany" },
-- properties = { tag = "5" } },
-- { rule = { class = "Gvim" },
-- properties = { tag = "5" } },
-- { rule = { class = "Qtcreator" },
-- properties = { tag = "5" } },
-- { rule = { class = "Kcachegrind" },
-- properties = { tag = "5" } },
-- { rule = { class = "Wxmaxima" },
-- properties = { tag = "5" } },
-- { rule = { class = "0ad" },
-- properties = { tag = "6" } },
-- { rule = { class = "dosbox" },
-- properties = { tag = "3" } },
-- { rule = { class = "Steam" },
-- properties = { tag = "6" } },
-- { rule = { class = "supertux" },
-- properties = { tag = "6" } },
-- { rule = { name = "Minetest" },
-- properties = { tag = "6" } },
-- { rule = { name = "glxgears" },
-- properties = { tag = "6" } },
-- { rule = { class = "urbanterror" },
-- properties = { tag = "6" } },
-- { rule = { class = "warzone2100" },
-- properties = { tag = "6" } },
-- { rule = { class = "xonotic-sdl" },
-- properties = { tag = "6" } },
-- { rule = { class = "DarkPlaces" },
-- properties = { tag = "6" } },
-- { rule = { class = "Camorama" },
-- properties = { tag = "6" } },
-- { rule = { class = "Dia" },
-- properties = { tag = "7" } },
-- { rule = { class = "feh" },
-- properties = { tag = "7" } },
-- { rule = { class = "FreeCAD" },
-- properties = { tag = "7" } },
-- { rule = { class = "Gcolor2" },
-- properties = { tag = "7" } },
-- { rule = { class = "GQview" },
-- properties = { tag = "7" } },
-- { rule = { class = "Inkscape" },
-- properties = { tag = "7" } },
-- { rule = { class = "Shotwell" },
-- properties = { tag = "7" } },
-- { rule = { name = "Xdvi" },
-- properties = { tag = "4" } },
-- { rule = { class = "Deluge" },
-- properties = { tag = "1" } },
-- { rule = { class = "Eiskaltdcpp" },
-- properties = { tag = "1" } },
-- { rule = { class = "Ekiga" },
-- properties = { tag = "+" } },
-- { rule = { class = "Googleearth-bin" },
-- properties = { tag = "1" } },
-- { rule = { class = "Links" },
-- properties = { tag = "1" } },
-- { rule = { class = "Linphone" },
-- properties = { tag = "1" } },
{ rule = { class = "psi" },
properties = { tag = "+" } },
{ rule = { class = "Transmission" },
properties = { tag = "1" } },
{ rule = { class = "Vncviewer" },
properties = { tag = "3" } },
{ rule = { class = "Avidemux" },
properties = { tag = "6" } },
{ rule = { class = "Xfburn" },
properties = { tag = "6" } },
{ rule = { class = "Gtk-recordMyDesktop" },
properties = { tag = "6" } },
{ rule = { class = "Qv4l2" },
properties = { tag = "6" } },
{ rule = { class = "V4l2ucp" },
properties = { tag = "6" } },
{ rule = { class = "TiMidity" },
properties = { tag = "6" } },
{ rule = { class = "Gnumeric" },
properties = { tag = "4" } },
{ rule = { class = "Yagf" },
properties = { tag = "4" } },
{ rule = { class = "Xchm" },
properties = { tag = "4" } },
{ rule = { class = "Flash-player-properties" },
properties = { tag = "1" } },
{ rule = { class = "Libfm-pref-apps" },
properties = { tag = "4" } },
{ rule = { class = "Qtconfig" },
properties = { tag = "5" } },
{ rule = { class = "Baobab" },
properties = { tag = "4" } },
{ rule = { class = "Gcdemu" },
properties = { tag = "3" } },
{ rule = { class = "Wireshark" },
properties = { tag = "1" } },
{ rule = { name = "Frozen-.*Bubble" },
properties = { tag = "6" } },
{ rule = { class = "d-feet" },
properties = { tag = "5" } },
{ rule = { class = "Cinelerra" },
properties = { tag = "6" } },
{ rule = { class = "Kdenlive" },
properties = { tag = "6" } },
{ rule = { class = "Dconf-editor" },
properties = { tag = "5" } },
-- { rule = { class = "Transmission" },
-- properties = { tag = "1" } },
-- { rule = { class = "Vncviewer" },
-- properties = { tag = "3" } },
-- { rule = { class = "Avidemux" },
-- properties = { tag = "6" } },
-- { rule = { class = "Xfburn" },
-- properties = { tag = "6" } },
-- { rule = { class = "Gtk-recordMyDesktop" },
-- properties = { tag = "6" } },
-- { rule = { class = "Qv4l2" },
-- properties = { tag = "6" } },
-- { rule = { class = "V4l2ucp" },
-- properties = { tag = "6" } },
-- { rule = { class = "TiMidity" },
-- properties = { tag = "6" } },
-- { rule = { class = "Gnumeric" },
-- properties = { tag = "4" } },
-- { rule = { class = "Yagf" },
-- properties = { tag = "4" } },
-- { rule = { class = "Xchm" },
-- properties = { tag = "4" } },
-- { rule = { class = "Flash-player-properties" },
-- properties = { tag = "1" } },
-- { rule = { class = "Libfm-pref-apps" },
-- properties = { tag = "4" } },
-- { rule = { class = "Qtconfig" },
-- properties = { tag = "5" } },
-- { rule = { class = "Baobab" },
-- properties = { tag = "4" } },
-- { rule = { class = "Gcdemu" },
-- properties = { tag = "3" } },
-- { rule = { class = "Wireshark" },
-- properties = { tag = "1" } },
-- { rule = { name = "Frozen-.*Bubble" },
-- properties = { tag = "6" } },
-- { rule = { class = "d-feet" },
-- properties = { tag = "5" } },
-- { rule = { class = "Cinelerra" },
-- properties = { tag = "6" } },
-- { rule = { class = "Kdenlive" },
-- properties = { tag = "6" } },
-- { rule = { class = "Dconf-editor" },
-- properties = { tag = "5" } },
}
----< Signals >------------------------------------------------------

2
wi.lua
View File

@ -42,7 +42,7 @@ vicious.register(batpct, vicious.widgets.bat, function(widget, args)
end
return args[2] .. "% "
end, nil, "BAT0")
end, nil, "BAT1")
function popup_bat()
local state = ""