trymeout

joined 2 years ago
[โ€“] trymeout@lemmy.world 0 points 2 days ago (4 children)

I prefer to have PWAs not in my preferred browser and others would as well.

 

I found this very promising app that looks like it can be an alternative to Ferdium, Rambox, Franz, Hamsket.

WebSpace is an app that brings websites and web apps together in one organized, streamlined interface. Any web app you can think off can be used in WebSpace in its own web instance instead of your main web browser. Basically it is a web browser but for web apps you use often and may want running in the background.

For use degoogled users who use website, web apps, PWAs over native apps, this makes using these services much easer.

WebSpace also adds many privacy features such as ad blocking and filtering, cookie isolation, and more.

Also it is written in Flutter! Meaning this could become available on desktop in the future! One app, one codebase for all major OSes!

Check it out and contribute!

[โ€“] trymeout@lemmy.world 8 points 2 days ago* (last edited 2 days ago)

If it cannot detect the glasses or if they are disconnected, it will restore the other displays. I have been using a similar version of the script for about a year that was written in Bash https://lemmy.world/post/29660071, I decided to rewrite it in Nushell since I prefer Nushell over Bash.

Improvements are welcomed as this code is free for all to modify, share, and use.

 

cross-posted from: https://lemmy.world/post/48010802

I created a simple Nushell script that will always disable the default/internal monitor(s) on your laptop or external display when using AR glasses. I find this useful for when using AR glasses such as the XReal One which allows you to change the mode from regular mode to ultra-wide mode and when doing this, it will act as your unplugging the XReal ones and plugging in XReal one again in a new mode, causing the other display to become enabled.

To keep the laptop display always off, weather the laptop lid is either closed or open, this simple Nushell script will always disable the screen every X seconds (You can change it by changing the wait constant)

Simply copy this script and create a new Nushell script such as disable-displays.nu, add it to your startup applications with the command of nu /path/to/disable-displays.nu and it will run in the background. You will need to run xrandr command with all of your displays enabled to get the names of the displays and change the constants values in the script accordingly.

NOTE: This script may not work with a full Wayland setup and may only work on X11.

Enjoy

# RUN xrandr TO GET THE NAMES OF THE DISPLAYS AND SET THE VARIABLES TO THESE NAMES
const ar_glasses_display = 'USB-C-0'
const displays = [
    'eDP',
    'HDMI-0'
]

const wait = 5

def is-ar-glasses-connected [] {
    return (xrandr | str contains $"($ar_glasses_display) connected")
}

def disable-display [display: string] {
    xrandr --output $display --off
}

def enable-display [display: string] {
    xrandr --output $display --auto
}

loop {
    if (is-ar-glasses-connected) {
        for current_display in $displays {
            disable-display $current_display
        }
    } else {
        for current_display in $displays {
            enable-display $current_display
        }
    }

    sleep ($wait * 1sec)
}
 

cross-posted from: https://lemmy.world/post/48010802

I created a simple Nushell script that will always disable the default/internal monitor(s) on your laptop or external display when using AR glasses. I find this useful for when using AR glasses such as the XReal One which allows you to change the mode from regular mode to ultra-wide mode and when doing this, it will act as your unplugging the XReal ones and plugging in XReal one again in a new mode, causing the other display to become enabled.

To keep the laptop display always off, weather the laptop lid is either closed or open, this simple Nushell script will always disable the screen every X seconds (You can change it by changing the wait constant)

Simply copy this script and create a new Nushell script such as disable-displays.nu, add it to your startup applications with the command of nu /path/to/disable-displays.nu and it will run in the background. You will need to run xrandr command with all of your displays enabled to get the names of the displays and change the constants values in the script accordingly.

NOTE: This script may not work with a full Wayland setup and may only work on X11.

Enjoy

# RUN xrandr TO GET THE NAMES OF THE DISPLAYS AND SET THE VARIABLES TO THESE NAMES
const ar_glasses_display = 'USB-C-0'
const displays = [
    'eDP',
    'HDMI-0'
]

const wait = 5

def is-ar-glasses-connected [] {
    return (xrandr | str contains $"($ar_glasses_display) connected")
}

def disable-display [display: string] {
    xrandr --output $display --off
}

def enable-display [display: string] {
    xrandr --output $display --auto
}

loop {
    if (is-ar-glasses-connected) {
        for current_display in $displays {
            disable-display $current_display
        }
    } else {
        for current_display in $displays {
            enable-display $current_display
        }
    }

    sleep ($wait * 1sec)
}
 

I created a simple Nushell script that will always disable the default/internal monitor(s) on your laptop or external display when using AR glasses. I find this useful for when using AR glasses such as the XReal One which allows you to change the mode from regular mode to ultra-wide mode and when doing this, it will act as your unplugging the XReal ones and plugging in XReal one again in a new mode, causing the other display to become enabled.

To keep the laptop display always off, weather the laptop lid is either closed or open, this simple Nushell script will always disable the screen every X seconds (You can change it by changing the wait constant)

Simply copy this script and create a new Nushell script such as disable-displays.nu, add it to your startup applications with the command of nu /path/to/disable-displays.nu and it will run in the background. You will need to run xrandr command with all of your displays enabled to get the names of the displays and change the constants values in the script accordingly.

NOTE: This script may not work with a full Wayland setup and may only work on X11.

Enjoy

# RUN xrandr TO GET THE NAMES OF THE DISPLAYS AND SET THE VARIABLES TO THESE NAMES
const ar_glasses_display = 'USB-C-0'
const displays = [
    'eDP',
    'HDMI-0'
]

const wait = 5

def is-ar-glasses-connected [] {
    return (xrandr | str contains $"($ar_glasses_display) connected")
}

def disable-display [display: string] {
    xrandr --output $display --off
}

def enable-display [display: string] {
    xrandr --output $display --auto
}

loop {
    if (is-ar-glasses-connected) {
        for current_display in $displays {
            disable-display $current_display
        }
    } else {
        for current_display in $displays {
            enable-display $current_display
        }
    }

    sleep ($wait * 1sec)
}
 

EDIT

I made a Nushell version of this script that is updated... https://lemmy.world/post/48010802


I created a simple Bash script that will always disable the default/internal monitor on your laptop when using AR glasses (or any other external monitor). I find this useful for when using AR glasses such as the XReal One which allows you to change the mode from regular mode to ultra-wide mode and when doing this, it will act as your unplugging the XReal ones and plugging in XReal one again in a new mode, causing the interal laptop display to become enabled.

To keep the laptop display always off, weather the laptop lid is either closed or open, this simple bash script will always disable the laptop screen every X seconds (You can change it by changing the wait variable)

Simply copy this script and create a new bash script such as disable-display.sh, make the script file executable and add it to your startup applications and it will run in the background. You will need to run xrandr command with all of your displays enabled to get the names of the displays and change the variable names in the script accordingly.

NOTE: This script may not work with a full Wayland setup and may only work on X11.

Enjoy

#!/bin/bash

#RUN xrandr TO GET THE NAMES OF THE DISPLAYS AND SET THE VARIABLES TO THESE NAMES

readonly default_display="eDP"
readonly external_display="USB-C-0"

readonly wait=5

while true; do
    #Check if there is an external display connected
    if xrandr | grep -q "$external_display connected"; then
        #Disable the internal display
        xrandr --output $default_display --off
    fi

    sleep $wait
done
 

EDIT

I made a Nushell version of this script that is updated... https://lemmy.world/post/48010802


I created a simple Bash script that will always disable the default/internal monitor on your laptop when using AR glasses (or any other external monitor). I find this useful for when using AR glasses such as the XReal One which allows you to change the mode from regular mode to ultra-wide mode and when doing this, it will act as your unplugging the XReal ones and plugging in XReal one again in a new mode, causing the interal laptop display to become enabled.

To keep the laptop display always off, weather the laptop lid is either closed or open, this simple bash script will always disable the laptop screen every X seconds (You can change it by changing the wait variable)

Simply copy this script and create a new bash script such as disable-display.sh, make the script file executable and add it to your startup applications and it will run in the background. You will need to run xrandr command with all of your displays enabled to get the names of the displays and change the variable names in the script accordingly.

NOTE: This script may not work with a full Wayland setup and may only work on X11.

Enjoy

#!/bin/bash

#RUN xrandr TO GET THE NAMES OF THE DISPLAYS AND SET THE VARIABLES TO THESE NAMES

readonly default_display="eDP"
readonly external_display="USB-C-0"

readonly wait=5

while true; do
    #Check if there is an external display connected
    if xrandr | grep -q "$external_display connected"; then
        #Disable the internal display
        xrandr --output $default_display --off
    fi

    sleep $wait
done
 

EDIT

I made a Nushell version of this script that is updated... https://lemmy.world/post/48010802


I created a simple Bash script that will always disable the default/internal monitor on your laptop when using AR glasses (or any other external monitor). I find this useful for when using AR glasses such as the XReal One which allows you to change the mode from regular mode to ultra-wide mode and when doing this, it will act as your unplugging the XReal ones and plugging in XReal one again in a new mode, causing the interal laptop display to become enabled.

To keep the laptop display always off, weather the laptop lid is either closed or open, this simple bash script will always disable the laptop screen every X seconds (You can change it by changing the wait variable)

Simply copy this script and create a new bash script such as disable-display.sh, make the script file executable and add it to your startup applications and it will run in the background. You will need to run xrandr command with all of your displays enabled to get the names of the displays and change the variable names in the script accordingly.

NOTE: This script may not work with a full Wayland setup and may only work on X11.

Enjoy

#!/bin/bash

#RUN xrandr TO GET THE NAMES OF THE DISPLAYS AND SET THE VARIABLES TO THESE NAMES

readonly default_display="eDP"
readonly external_display="USB-C-0"

readonly wait=5

while true; do
    #Check if there is an external display connected
    if xrandr | grep -q "$external_display connected"; then
        #Disable the internal display
        xrandr --output $default_display --off
    fi

    sleep $wait
done
 

I am trying to create a podman compose of NGINX and PHP:FPM. I was able to get NGINX to work on its own using the docker.io./bitnami/nginx image. I gotten close I believe to getting the PHP:FPM to work also but due to an issue with NGINX not cooperating with the PHP:FPM.

In the logs of the NGINX container, I get this error every time I load localhost:8080 in the browser...

10.89.4.2 - - [24/Jul/2024:20:18:35 +0000] "GET / HTTP/1.1" 404 47 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" "-"
2024/07/24 20:18:35 [error] 44#44: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.89.4.2, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://10.89.4.3:9000", host: "localhost:8080"

And when I load localhost:8080 in the browser, it displays a blank page which says "File not found.".

I am using podman 5.1.2 on Linux Mint 21.3. My goal is to simply NGINX and PHP to work, to be able to have a web server that can use PHP.

Any advice would be most appreciated.


Directory structure

nginx-php/
   compose.yml
   nginx.conf
   php.dockerfile
   php.ini
   www/
      public/

compose.yml

version: '3'
networks:
    app-tier:
        driver: bridge
services:
    nginx:
        image: docker.io/bitnami/nginx
        volumes:
            - ./nginx.conf:/opt/bitnami/nginx/conf/server_blocks/my_server_block.conf:ro
            - .:/app/
        networks:
            - app-tier
        ports:
            - 8080:8080
    php:
        build:
            context: .
            dockerfile: php.dockerfile
        volumes:
            - .:/app/
        networks:
            - app-tier

nginx.conf

server {
    server_name localhost;
    listen 0.0.0.0:8080;
    
    root /app/www/public;

    index index.php index.html index.htm;
    autoindex on;

    location / {
        try_files $uri $uri/index.php;
    }

    location ~ \.php$ {
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
}

php.dockerfile (Will like to get debugging and databases to work later on...)

FROM docker.io/bitnami/php-fpm

# Install xdebug for nicer error messages and debugging
# RUN pecl install xdebug
# RUN docker-php-ext-enable xdebug

# Install mysqli
# RUN docker-php-ext-install mysqli
# RUN docker-php-ext-enable mysqli

# Install PDO
# RUN docker-php-ext-install pdo pdo_mysql

php.ini (Will like to get debugging and databases to work later on...)

[PHP]

extension=mysqli
extension=pdo_mysql


; xdebug settings for debugging
zend_extension=xdebug
xdebug.start_with_request = yes
xdebug.client_host=xdebug://gateway

 

On Linux, thr best package type for a portable application is an AppImage since all the dependances are inside the AppImage, its all in one file and can run on any linux distro.

On Android, you dan download an APK and install it manually which is the closest thing to a portable Android app.

Therefore, in the service/server self hosting world. Are containers (docker/podman images) the equivalent to a portable executable of a service? AppImages downside is its size since all the dependancies are bundle with it. Containers not only bundle its dependnacies but the OS to run run them. For a stable, low incompatibility and low dependancy hell, are containers the way to go for portable services?

I know container images are not distributed as tar files often and mostly pulled from a registry, however they can be saved and loaded as portable tar files.