I'm using the awesome wm and i want every window to be to the edge of my monitor without any taskbars or title bars.
Is there a way to do this?
I'm on ubuntu 16.04 LTS.
Yes this should be easy. Simply add the line
fullscreen = true,
to your awesome rules.
Your rules would look afterwards something like this:
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
fullscreen = true,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
The taskbar would be still there but it would be hidden behind the fullscreen window.
cheers
Related
I have two css classes on a tornadofx label bound to a SimpleBooleanProperty. One which has a background image and a blue border and one which has no background image and a yellow border.
Snippet from View containing label:
val switch: SimpleBooleanProperty = SimpleBooleanProperty(false)
label("my label"){
toggleClass(UIAppStyle.style1, switch.not())
toggleClass(UIAppStyle.style2, switch)
}
Snippet from UIAppStyle:
s(style1){
textFill = Color.YELLOW
maxWidth = infinity
maxHeight = infinity
alignment = Pos.CENTER
backgroundImage += this::class.java.classLoader.getResource("img.png")!!.toURI()
backgroundPosition += BackgroundPosition.CENTER
backgroundRepeat += Pair(BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT)
borderColor += box(Color.BLUE)
}
s(style2){
textFill = Color.YELLOW
maxWidth = infinity
maxHeight = infinity
alignment = Pos.CENTER
borderColor += box(Color.YELLOW)
}
When switch = false, there is a background image and a blue border. When switch = true, there is the same background image and a yellow border. I'm not finding out how to get the background image to remove. Interestingly enough, if I add a different background image to style2, it changes correctly.
Edit: To remove two toggleClasses and introduce new strange problem:
class MyView : View(){
...
init{
...
row{
repeat(myviewmodel.numSwitches){
val switch = myviewmodel.switches[it]
val notSwitch = switch.not()
label("my label"){
addClass(UIAppStyle.style2)
toggleClass(UIAppStyle.style1, notSwitch)
}
}
}
}
This code snippet does not work for me. However, if I add private var throwsArray = mutableListOf<ObservableValue<Boolean>>() as a field of MyView and add notSwitch to the array, then the same exact code works. It's almost as if notSwitch is going out of scope and becoming invalidated unless I add it to a local array in the class?
I don’t understand why you want to have two different toggleClass for the same control. As you pointed out, the problem in your case is that when the backgroundImage is set, you need to set a new one in order to change it. But in your case, you only have to add the style without backgroundImage first and them set toggleClass with the style with backgroundImage. Like this:
label("my label"){
addClass(UIAppStyle.style2)
toggleClass(UIAppStyle.style1, switch)
}
button {
action {
switch.value = !switch.value;
}
}
Edit: This ilustrate what I'm talking about in comments:
class Example : View("Example") {
override val root = vbox {
val switch = SimpleBooleanProperty(false)
val notSwitch = switch.not()
label("my label"){
addClass(UIAppStyle.style2)
toggleClass(UIAppStyle.style1, notSwitch)
}
button("One") {
action {
switch.value = !switch.value;
}
}
button("Two") {
action {
notSwitch.get()
}
}
}
}
You can put the notSwitch.get() in any action and without trigger that action it does the work. Check how I put it in the action of button Two, but without clicking that button even once, it works.
This is actually some kind of hack, in order to achieve what you want. But I don’t see the reason why my initial solution with true as default value for property shouldn’t work.
Edited to do inverse of status
Here is simple example of a working toggle class using your styling:
class TestView : View() {
override val root = vbox {
val status = SimpleBooleanProperty(false)
label("This is a label") {
addClass(UIAppStyle.base_cell)
val notStatus = SimpleBooleanProperty(!status.value)
status.onChange { notStatus.value = !it } // More consistent than a not() binding for some reason
toggleClass(UIAppStyle.smiling_cell, notStatus)
}
button("Toggle").action { status.value = !status.value }
}
init {
importStylesheet<UIAppStyle>()
}
}
As you can see, the base class is added as the default, while styling with the image is in the toggle class (no not() binding). Like mentioned in other comments, the toggleClass is picky, additive in nature, and quiet in failure so it can sometimes be confusing.
FYI I got to this only by going through your github code and I can say with confidence that the not() binding is what screwed you in regards to the toggleClass behaviour. Everything else causing an error is related to other problems with the code. Feel free to ask in the comments or post another question.
I have a Bot developed in SDK 4. I am using PromptOptions in Dialog as below :
var options = new PromptOptions()
{
Prompt = MessageFactory.Text("Please select the services "),
RetryPrompt = null,
Style = ListStyle.HeroCard,
Choices = GetMainMenuChoices(),
};
I need to style the Hero card which as of now is in rectangle shape. Can I make it look like rounded corner with some color & do some customize style? Thanks.
I want to make Google chrome focusable while using awesomeWM in Ubuntu 18.04. How can I do it?
I'm new to use awesomeWM as a window manager in Ubuntu 18.04, and I prefer Google chrome (not chromium, because my password manager don't work). I installed Chrome as a .deb package in official.
However, in default, Chrome spawned by <mod> + r and google-chrome cannot be focused by <mod> + space and don't obey to layouts.
Besides I found google-chrome's WM_CLASS is Google-chrome by xwininfo and xprop and refered to the doc, I added this code in my rc.lua:
{ rule = { class = "Google-chrome" },
properties = { focusable = true }
},
And reboot. I expect this code enables google-chrome focusable, but it was still not focusable.
How do I correct the code?
Is the problem that the window is not focusable or that it cannot be tiled? Based on your description, I wonder if Chrome is defaulting to a maximized state. If you're able, try pressing <mod> + m to unmaximize the client. If that works, add maximized_vertical = false and maximized_horizontal = false to the rule:
{ rule = { class = "Google-chrome" },
properties = { focusable = true,
maximized_vertical = false,
maximized_horizontal = false }
},
I'm using AwesomeWM 4.2 under Xfce4.
I'm using xfpanel. In rc.lua, I have done the following to prevent the xfpanel getting focus:
-- from https://github.com/zhangkun83/awesome-config/blob/d947e70041fad3e5f34bb832162cacaac62736b1/rc.lua#L492)
{ rule = { type = "dock" },
properties = {
border_width = 0,
titlebars_enabled = false,
focusable = false
}},
This works insofar as now, I cannot put the focus on the xfpanel client using keyboard conrtrols.
However, when I click somewhere on the xfpanel (e.g., open the whisker menu, or click on the NetworkManager applet, ...), Awesome makes xfpanel the focused client.
I don't like this behavior because it means I have to explicitly shift focus back to where I was working before.
Is there a way to prevent awesome from changing focus when a mouse click
occurs?
If you don't want the default settings for docks, make that rule ignore "dock" clients. With this I mean: Find the awful.rules-rule with rule = {}, and change this into rule = {}, except = { type = "dock" },.
Since this default rule sets up button bindings (buttons = clientbuttons), this means that dock-clients will no longer get these button bindings.
I'm using the following settings for my top bar:
-- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt()
-- Create a taglist widget
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)
-- Create a tasklist widget
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons)
-- Create the wibox
s.mywibox = awful.wibar({ position = theme.position, screen = s, height = theme.height })
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{
-- Left widgets
layout = wibox.layout.fixed.horizontal,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{
-- Right widgets
layout = wibox.layout.fixed.horizontal,
theme.systray,
theme.spr_left,
theme.volume,
theme.battery,
theme.clock,
theme.spr_right
},
}
This results in:
I have disabled the names of the tasks. What I want to accomplish is
having the icons of the tasklist displayed in the center. How can I accomplish this, while preserving the tags to the left and the systray
on the right?
Edit
When applying expand = outside, I get the following:
Edit2
When I add these container settings:
-- Tasklist container
local tl = wibox.container.background(s.mytasklist, theme.bg_normal, gears.shape.rectangle)
local pl = wibox.container.margin(tl, 2, 2, 3, 3)
local tasklist = wibox.container.place(pl, {halign="center"})
I get:
Which is a bit better, but still not fully centered.
I solved the problem by applying expand = "none" to the horizontal align. As follows:
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
expand = "none",
{
-- Left widgets
layout = wibox.layout.fixed.horizontal,
s.mytaglist,
s.mypromptbox,
},
-- Middle widget
s.mytasklist,
{
-- Right widgets
layout = wibox.layout.fixed.horizontal,
theme.systray,
theme.spr_left,
theme.volume,
theme.battery,
theme.clock,
theme.spr_right
},
}
end)
Which perfectly aligns the bar as follows on Awesome v4.2-257-g59aa4ac7: