{"id":26851385,"url":"https://github.com/azizemir/lxc-rofi","last_synced_at":"2025-03-30T22:31:13.787Z","repository":{"id":278612634,"uuid":"936201070","full_name":"AzizEmir/lxc-rofi","owner":"AzizEmir","description":"Managing LXC with Rofi","archived":false,"fork":false,"pushed_at":"2025-02-20T17:37:17.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T18:38:53.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AzizEmir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-20T17:32:13.000Z","updated_at":"2025-02-20T17:37:21.000Z","dependencies_parsed_at":"2025-02-20T18:49:04.984Z","dependency_job_id":null,"html_url":"https://github.com/AzizEmir/lxc-rofi","commit_stats":null,"previous_names":["azizemir/lxc-rofi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzizEmir%2Flxc-rofi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzizEmir%2Flxc-rofi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzizEmir%2Flxc-rofi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzizEmir%2Flxc-rofi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AzizEmir","download_url":"https://codeload.github.com/AzizEmir/lxc-rofi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390896,"owners_count":20769475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-30T22:31:12.656Z","updated_at":"2025-03-30T22:31:13.777Z","avatar_url":"https://github.com/AzizEmir.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lxc-rofi\nManaging LXC with Rofi\n\n[lxc-rofi-app.webm](https://github.com/user-attachments/assets/b42e4743-3590-403d-bcf5-3c2c144d2370)\n\n```bash\n#!/bin/bash\n\n# sudo yetkisi iste\necho \"Lütfen sudo parolanızı girin:\" | rofi -dmenu -password | sudo -S echo \"Yetkilendirildi\"\n\n# LXC konteyner listesini al\noutput=$(sudo lxc-ls -f)\n\n# Eğer konteyner yoksa bildirim göster ve çık\nif [[ -z \"$output\" ]]; then\n    notify-send \"LXC Hata\" \"Hiçbir konteyner bulunamadı!\"\n    exit 1\nfi\n\n# İlk Rofi menüsünde konteyner listesini göster\nwhile true; do\n    # Yenileme satırını da ekle\n    updated_output=$(echo -e \"Yenile\\n$(echo \"$output\")\")\n\n    # Konteyner listesini göster\n    selection=$(echo \"$updated_output\" | rofi -dmenu -markup-rows -scroll-method 1 -p \"Konteyner Seç\" -wrap-mode 0)\n\n    # ESC tuşuna basılırsa uygulamadan çık\n    if [[ -z \"$selection\" ]]; then\n        exit 1\n    fi\n\n    # Eğer \"Yenile\" seçilirse konteyner listesini yeniden al\n    if [[ \"$selection\" == \"Yenile\" ]]; then\n        output=$(sudo lxc-ls -f)\n        continue\n    fi\n\n    # Seçimden sadece konteyner ismini al (ilk sütun)\n    container_name=$(echo \"$selection\" | awk '{print $1}')\n\n    # Seçilen konteynerin durumu\n    state=$(echo \"$selection\" | awk '{print $2}')\n\n    # Start / Stop seçeneklerini sun\n    while true; do\n        if [[ \"$state\" == \"STOPPED\" ]]; then\n            action=$(echo -e \"Start\\nEsc - Geri\" | rofi -dmenu -p \"İşlem Seç\")\n        elif [[ \"$state\" == \"RUNNING\" ]]; then\n            action=$(echo -e \"Stop\\nEsc - Geri\" | rofi -dmenu -p \"İşlem Seç\")\n        else\n            notify-send \"Hata\" \"Bilinmeyen durum: $state\"\n            exit 1\n        fi\n\n        # Eğer ESC tuşuna basılırsa, üst menüye dön\n        if [[ -z \"$action\" || \"$action\" == \"Esc - Geri\" ]]; then\n            break\n        fi\n\n        # Seçime göre işlemi gerçekleştir\n        case \"$action\" in\n            Start)\n                sudo lxc-start -n \"$container_name\"\n                notify-send \"Konteyner Başlatıldı\" \"$container_name başarıyla başlatıldı!\"\n                # Konteyner listesini güncelle\n                output=$(sudo lxc-ls -f)\n                break\n                ;;\n            Stop)\n                sudo lxc-stop -n \"$container_name\"\n                notify-send \"Konteyner Durduruldu\" \"$container_name başarıyla durduruldu!\"\n                # Konteyner listesini güncelle\n                output=$(sudo lxc-ls -f)\n                break\n                ;;\n            *)\n                notify-send \"Hata\" \"Geçersiz seçim yapıldı!\"\n                ;;\n        esac\n    done\ndone\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazizemir%2Flxc-rofi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazizemir%2Flxc-rofi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazizemir%2Flxc-rofi/lists"}